| 202 | //----------------------------------------------------------------------------- |
| 203 | |
| 204 | Box3F 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 | |