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

Method GetBoundingBoxInLocalSpace

trinity/Tr2Model.cpp:205–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205Be::Result<std::string> Tr2Model::GetBoundingBoxInLocalSpace( std::pair<Vector3, Vector3>& result )
206{
207 bool bbFound = false;
208 CcpMath::AxisAlignedBox aabb;
209 for( unsigned int i = 0, count = GetNumOfMeshes(); i < count; ++i )
210 {
211 auto meshAabb = GetMesh( i )->GetBounds();
212
213 if( meshAabb )
214 {
215 bbFound = true;
216 aabb.Include( meshAabb );
217 }
218 }
219
220 if( !bbFound )
221 {
222 return Be::Result<std::string>( "No meshes, or meshes aren't loaded yet." );
223 }
224
225 result = std::make_pair( aabb.m_min, aabb.m_max );
226 return Be::Result<std::string>();
227}

Callers

nothing calls this directly

Calls 2

GetMeshFunction · 0.85
GetBoundsMethod · 0.45

Tested by

no test coverage detected