MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / aroundPoints

Method aroundPoints

Engine/source/math/mBox.cpp:204–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202//-----------------------------------------------------------------------------
203
204Box3F Box3F::aroundPoints( const Point3F* points, U32 numPoints )
205{
206 AssertFatal( points != NULL, "Box3F::aroundPoints - Receive a NULL pointer" );
207 AssertFatal( numPoints >= 1, "Box3F::aroundPoints - Must have at least one point" );
208
209 Box3F box;
210
211 Point3F minPoint = points[ 0 ];
212 Point3F maxPoint = points[ 0 ];
213
214 for( U32 i = 1; i < numPoints; ++ i )
215 for( U32 n = 0; n < 3; ++ n )
216 {
217 minPoint[ n ] = getMin( minPoint[ n ], points[ i ][ n ] );
218 maxPoint[ n ] = getMax( maxPoint[ n ], points[ i ][ n ] );
219 }
220
221 return Box3F( minPoint, maxPoint );
222}
223
224//-----------------------------------------------------------------------------
225

Callers

nothing calls this directly

Calls 2

getMaxFunction · 0.85
Box3FClass · 0.70

Tested by

no test coverage detected