If a 3D box(a bounding box) knows it's position, it's width, it's height and it's depth, what would be the most efficient(can run in real time) way of detecting if a 3D co-ordinate is inside that box?
I already have something in place to check for it but I am wondering if there is anything more efficient,
vPosition is the position of the 3D Coordinate
GetPosition( ) returns the position of the 3D box
bool CBoundingBox::IsInside( VEC vPosition )
{
return ( ( vPosition.x > GetPosition( ).x && vPosition.x < GetPosition( ).x + m_fWidth ) ||
( vPosition.y < GetPosition( ).y && vPosition.y > GetPosition( ).y - m_fHeight ) ||
( vPosition.z > GetPosition( ).z && vPosition.z < GetPosition( ).z + m_fWidth ) );
}