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

Method GetDamageLocatorPosition

trinity/Eve/SpaceObject/EveSwarm.cpp:1097–1136  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Override from EveSpaceObject2 --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1095// Override from EveSpaceObject2
1096// --------------------------------------------------------------------------------
1097bool EveSwarm::GetDamageLocatorPosition( Vector3* out, int index, bool inWorldSpace )
1098{
1099 if( !m_count )
1100 {
1101 return EveShip2::GetDamageLocatorPosition( out, index, inWorldSpace );
1102 }
1103
1104 if( index >= 0 )
1105 {
1106 auto damageLocators = GetLocatorsForSet( BlueSharedString( "damage" ) );
1107 if( damageLocators && index < int( damageLocators->size() ) )
1108 {
1109 const Locator& damageLocator = ( *damageLocators )[index];
1110
1111 Vector3 position, direction;
1112 GetLocatorInObjectSpace( position, direction, damageLocator );
1113
1114 if( inWorldSpace )
1115 {
1116 *out = XMVector3TransformCoord( direction, m_worldTransform );
1117 }
1118 else
1119 {
1120 *out = position;
1121 }
1122 return true;
1123 }
1124 }
1125
1126 if( inWorldSpace )
1127 {
1128 *out = m_renderables[m_targetIndex]->GetWorldTransform()->GetTranslation();
1129 }
1130 else
1131 {
1132 Matrix localTransform = *m_renderables[m_targetIndex]->GetWorldTransform() * m_invWorldTransform;
1133 *out = localTransform.GetTranslation();
1134 }
1135 return false;
1136}
1137
1138// --------------------------------------------------------------------------------
1139// Description:

Callers 9

GetDamageLocatorMethod · 0.45
GetImpactPositionMethod · 0.45
FindClosestLocatorMethod · 0.45
UpdateSyncronousMethod · 0.45
UpdateSyncronousMethod · 0.45
UpdateAsyncronousMethod · 0.45
CreateShieldImpactMethod · 0.45

Calls 3

sizeMethod · 0.80
GetTranslationMethod · 0.80
GetWorldTransformMethod · 0.80

Tested by

no test coverage detected