Public Member Functions | Public Attributes | List of all members
BoundingBox Class Reference

Inherits ScriptObject.

Public Member Functions

 BoundingBox ()
 BoundingBox (Vector a, Vector b)
 expandTo (Vector point)
 expandToBox (BoundingBox box)
VectorPair getRayIntersection (Vector origin, Vector direction, Vector expansion=Vector())

Public Attributes

Vector lower
Vector upper

Detailed Description

3D bounding box specified by the lower and upper corners.

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

Initializes the bounding box and (0, 0, 0) -> (0, 0, 0).

◆ BoundingBox() [2/2]

BoundingBox ( Vector  a,
Vector  b 

Initializes the bounding box for the specified corners.

aCorner of box.
bCorner of box.

Member Function Documentation

◆ expandTo()

expandTo ( Vector  point)

Expands the bounding box to include the specified position.

◆ expandToBox()

expandToBox ( BoundingBox  box)

Expands the bounding box to include the specified bounding box.

◆ getRayIntersection()

VectorPair getRayIntersection ( Vector  origin,
Vector  direction,
Vector  expansion = Vector() 

Gets intersection between the bounding box and a ray.

originOrigin point of the ray.
directionDirection vector of the ray. Should be non-zero.
expansionAdditional thickness added to the bounding box. Should be non-negative.
Pair of intersection points. First intersection point is where the ray enters the bounding box. Second point, where the ray exits from the bounding. If ray's origin is inside the bounding box, first point is equal to second. Returns null, if the ray does not intersect the bounding box.

Member Data Documentation

◆ lower

Vector lower

The lower corner.

◆ upper

Vector upper

The upper corner.

Generated by Autodesk, Inc. 05 April 2024
Copyright (c) 2012-2024 by Autodesk, Inc.