public void Transform( Matrix4 matrix )
{
// do nothing for a null box
if ( isNull || isInfinite )
return;
Vector3 min;
Vector3 max;
Vector3 temp;
temp = matrix * corners[ 0 ];
min = max = temp;
for ( int i = 1; i < corners.Length; i++ )
{
// Transform and check extents
temp = matrix * corners[ i ];
if ( temp.x > max.x )
max.x = temp.x;
else if ( temp.x < min.x )
min.x = temp.x;
if ( temp.y > max.y )
max.y = temp.y;
else if ( temp.y < min.y )
min.y = temp.y;
if ( temp.z > max.z )
max.z = temp.z;
else if ( temp.z < min.z )
min.z = temp.z;
}
SetExtents( min, max );
}