Microsoft DirectX 8.1 (Visual Basic) |
Determines if a ray intersects the volume of a box's bounding box.
object.BoxBoundProbe( _ MinVert As D3DVECTOR, _ MaxVert As D3DVECTOR, _ RayPosition As D3DVECTOR, _ Raydirection As D3DVECTOR) As Boolean
Returns 1 if the ray intersects the volume of the box's bounding box. Otherwise, returns 0.
D3DX8.BoxBoundProbe determines if the ray intersects the volume of the box's bounding box, not just the surface of the box.
The D3DXVECTOR values passed to D3DX8.BoxBoundProbe 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
If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.