Microsoft DirectX 8.1 (Visual Basic)

D3DX8.BoxBoundProbe

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

Parts

object
Object expression that resolves to a D3DX8 object.
MinVert
A D3DVECTOR type, describing the lower-left corner of the bounding box. See Remarks.
MaxVert
A D3DXVECTOR type, describing the upper-right corner of the bounding box. See Remarks.
RayPosition
A D3DXVECTOR type, specifying the origin coordinate of the ray.
Raydirection
A D3DXVECTOR type, specifying the direction of the ray.

Return Values

Returns 1 if the ray intersects the volume of the box's bounding box. Otherwise, returns 0.

Remarks

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

Error Codes

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.