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

Method GetImpactPosition

trinity/Eve/Turret/EveTurretTarget.cpp:162–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160// --------------------------------------------------------------------------------
161
162void EveTurretTarget::GetImpactPosition( Vector3& out, const Vector3* source )
163{
164 if( m_object )
165 {
166 if( m_impactBehaviour == ImpactBehaviour::DAMAGE_LOCATOR )
167 {
168 m_object->GetDamageLocatorPosition( &out, m_locator, true );
169
170 if( LengthSq( out ) > 22379561604000000000000.f ) // AU squared
171 {
172 out = m_objectPos->GetWorldPosition();
173 }
174 }
175 else if( m_impactBehaviour == ImpactBehaviour::CENTER )
176 {
177 out = m_objectPos->GetWorldPosition();
178 }
179 else if( m_impactBehaviour == ImpactBehaviour::SHIELD_ELLIPSOID )
180 {
181 if( !m_object->GetImpactPosition( out, m_locator, *source, m_objectPos->GetWorldPosition(), 0 ) )
182 {
183 // handle when we are inside the shield ellipsoid
184 m_object->GetDamageLocatorPosition( &out, m_locator, true );
185 }
186 }
187 }
188}
189
190// --------------------------------------------------------------------------------
191// Description:

Callers

nothing calls this directly

Calls 3

LengthSqFunction · 0.85
GetWorldPositionMethod · 0.45

Tested by

no test coverage detected