psychopy.tools.mathtools.BoundingBox

class psychopy.tools.mathtools.BoundingBox(extents=None, dtype=None)[source]

Class for representing object bounding boxes.

A bounding box is a construct which represents a 3D rectangular volume about some pose, defined by its minimum and maximum extents in the reference frame of the pose. The axes of the bounding box are aligned to the axes of the world or the associated pose.

Bounding boxes are primarily used for visibility testing; to determine if the extents of an object associated with a pose (eg. the vertices of a model) falls completely outside of the viewing frustum. If so, the model can be culled during rendering to avoid wasting CPU/GPU resources on objects not visible to the viewer.

__init__(extents=None, dtype=None)[source]

Methods

__init__([extents, dtype])

clear()

Clear a bounding box, invalidating it.

fit(verts)

Fit the bounding box to vertices.

Attributes

dtype

Data type used for computations and arrays (numpy.dtype).

extents

isValid

True if the bounding box is valid.


Back to top