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

Method FindClosestLocator

trinity/Eve/Turret/EveTurretTarget.cpp:289–304  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Find the best locator ID and it's position for a given source (aka gun) position --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

287// Find the best locator ID and it's position for a given source (aka gun) position
288// --------------------------------------------------------------------------------
289int EveTurretTarget::FindClosestLocator( const Vector3* source, Vector3* position ) const
290{
291 // do we have a target object?
292 if( !m_object )
293 {
294 return -1;
295 }
296
297 // find closest locator to source
298 int loc = m_object->GetClosestDamageLocatorIndex( source );
299 if( !m_object->GetDamageLocatorPosition( position, loc, true ) )
300 {
301 return -1;
302 }
303 return loc;
304}
305
306// --------------------------------------------------------------------------------
307int EveTurretTarget::FindRandomValidLocator( const Vector3& source, Vector3& position ) const

Callers 1

Calls 2

Tested by

no test coverage detected