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

Method GetHullBoundingSphere

trinity/Eve/SpaceObjectFactory/EveSOFDNA.cpp:1120–1141  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Return the bounding sphere info of this hull --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1118// Return the bounding sphere info of this hull
1119// --------------------------------------------------------------------------------
1120CcpMath::Sphere EveSOFDNA::GetHullBoundingSphere() const
1121{
1122 CcpMath::Sphere boundingSphere = CcpMath::Sphere();
1123
1124 // cycle over all hulls in the multi-hull list
1125 Vector3 hullOffset( 0.f, 0.f, 0.f );
1126 for( size_t hullIdx = 0; hullIdx < GetMultiHullCount(); ++hullIdx )
1127 {
1128 CcpMath::Sphere s( m_hullDatas[hullIdx]->boundingSphere );
1129 s.center += hullOffset;
1130 boundingSphere.IncludeSphere( s );
1131
1132 // next hull needs offset update from hull's locator
1133 const Vector3* nextSubsystemOffset = GetHullNextSubsystemOffset( hullIdx );
1134 if( nextSubsystemOffset )
1135 {
1136 hullOffset += *nextSubsystemOffset;
1137 }
1138 }
1139
1140 return boundingSphere;
1141}
1142
1143// --------------------------------------------------------------------------------
1144// Description:

Callers 3

BuildFromDNAMethod · 0.80
SetupMeshMethod · 0.80
CreatePlacementMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected