MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetLocatorDirection

Method GetLocatorDirection

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:2575–2605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2573}
2574
2575bool EveSpaceObject2::GetLocatorDirection( Vector3* out, int index, bool inWorldSpace, BlueSharedString locatorSetName )
2576{
2577 if( index < 0 )
2578 {
2579 *out = Vector3( 0.f, 1.f, 0.f );
2580 return false;
2581 }
2582
2583 auto locators = GetLocatorsForSet( locatorSetName );
2584 if( !locators || index >= int( locators->size() ) )
2585 {
2586 *out = Vector3( 0.f, 1.f, 0.f );
2587 return false;
2588 }
2589
2590 const Locator& locator = ( *locators )[index];
2591
2592 Vector3 position, direction;
2593 GetLocatorInObjectSpace( position, direction, locator );
2594
2595 if( inWorldSpace )
2596 {
2597 *out = XMVector3TransformNormal( direction, m_worldTransform );
2598 }
2599 else
2600 {
2601 *out = direction;
2602 }
2603
2604 return true;
2605}
2606
2607void EveSpaceObject2::UpdateModelCenterWorldPosition( Vector3& position, Be::Time t )
2608{

Callers 4

RenderDebugInfoMethod · 0.80
CalculateBehaviorMethod · 0.80

Calls 2

sizeMethod · 0.80
Vector3Class · 0.50

Tested by

no test coverage detected