Microsoft DirectX 8.1 (C++) |
Determines if a ray intersects the volume of a box.
BOOL D3DXBoxBoundProbe( CONST D3DXVECTOR3* pMin, CONST D3DXVECTOR3* pMax, CONST D3DXVECTOR3* pRayPosition, CONST D3DXVECTOR3* pRayDirection );
Returns TRUE if the ray intersects the volume of the box. Otherwise, returns FALSE.
D3DXBoxBoundProbe determines if the ray intersects the volume of the box, not just the surface of the box.
The D3DXVECTOR3 values passed to D3DXBoxBoundProbe are xmin, xmax, ymin, ymax, zmin, and zmax. Thus, the following defines the corners of the bounding box.
xmax, ymax, zmax xmax, ymax, zmin xmax, ymin, zmax xmax, ymin, zmin xmin, ymax, zmax xmin, ymax, zmin xmin, ymin, zmax xmin, ymin, zmin
The depth of the bounding box in the z direction is zmax - zmin, in the y direction is ymax - ymin, and in the x direction is xmax - xmin. For example, with the following minimum and maximum vectors, min (-1, -1, -1) and max (1, 1, 1), the bounding box is defined in the following manner.
1, 1, 1 1, 1, -1 1, -1, 1 1, -1, -1 -1, 1, 1 -1, 1, -1 -1, -1, 1 -1, -1, -1
Header: Declared in D3dx8mesh.h.
Import Library: Use D3dx8.lib.