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

Method GetLocatorPosition

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:2449–2478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2447}
2448
2449bool EveSpaceObject2::GetLocatorPosition( Vector3* out, int index, bool inWorldSpace, BlueSharedString locatorSetName )
2450{
2451 if( index < 0 )
2452 {
2453 *out = inWorldSpace ? m_worldTransform.GetTranslation() : Vector3( 0.f, 0.f, 0.f );
2454 return false;
2455 }
2456
2457 auto locators = GetLocatorsForSet( locatorSetName );
2458 if( !locators || index >= int( locators->size() ) )
2459 {
2460 *out = inWorldSpace ? m_worldTransform.GetTranslation() : Vector3( 0.f, 0.f, 0.f );
2461 return false;
2462 }
2463 const Locator& locator = ( *locators )[index];
2464
2465 Vector3 position, direction;
2466 GetLocatorInObjectSpace( position, direction, locator );
2467
2468 if( inWorldSpace )
2469 {
2470 *out = XMVector3TransformCoord( position, m_worldTransform );
2471 }
2472 else
2473 {
2474 *out = position;
2475 }
2476
2477 return true;
2478}
2479
2480// --------------------------------------------------------------------------------
2481// Description:

Callers 5

RenderDebugInfoMethod · 0.80
CalculateBehaviorMethod · 0.80

Calls 3

GetTranslationMethod · 0.80
sizeMethod · 0.80
Vector3Class · 0.50

Tested by

no test coverage detected