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

Method GetLocalBoundingBox

trinity/Eve/SpaceObject/EveSwarm.cpp:849–877  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: From EveShip2 --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

847// From EveShip2
848// --------------------------------------------------------------------------------
849bool EveSwarm::GetLocalBoundingBox( Vector3& min, Vector3& max )
850{
851 if( m_mesh && m_mesh->GetBoundingBox( min, max ) )
852 {
853 Vector4 bs;
854 BoundingSphereFromBox( bs, min, max );
855 BoundingBoxUpdate( min, max, bs );
856 min += m_squadBoundsMin;
857 max += m_squadBoundsMax;
858 }
859 else
860 {
861 min = m_squadBoundsMin;
862 max = m_squadBoundsMax;
863 }
864 if( m_swarmingEnabled )
865 {
866 m_localAabbMin = min - m_worldPosition;
867 m_localAabbMax = max - m_worldPosition;
868 min = m_localAabbMin;
869 max = m_localAabbMax;
870 }
871 else
872 {
873 m_localAabbMin = min;
874 m_localAabbMax = max;
875 }
876 return true;
877}
878
879// --------------------------------------------------------------------------------
880// Description:

Callers 1

SplitBoundingBoxMethod · 0.45

Calls 3

BoundingSphereFromBoxFunction · 0.85
BoundingBoxUpdateFunction · 0.85
GetBoundingBoxMethod · 0.45

Tested by

no test coverage detected