Theoretically:
If you have a 2D box and a 2D point, you can test if the point is inside the box like by comparing the X,Y coordinates:
The Box:
Code:
// (bx,by)
// *-------------*
// | |
// | (px,py) | bh
// | * |
// *-------------*
// bw
(Point X, Y == px and py)
(Box X, Y == bx, by)
(Box Width == bw)
(Box Height == bh)
Just imagine those are your variables, you could do:
Code:
if( px >= bx && px <= (bx + bw) && py >= by && py <= (by + bh) )
{
// Inside box
}else
{
// Outside box
}
The same theory applies to 3D Boxes/Points, just add the extra coordinate checks for Z!
This is basically what I've done in OOB..