Properties

CC3NodeBoundingBoxVolume Class Reference

A bounding volume that forms an axially aligned bounding box (AABB) around the node, in the node's local coordinate system. More...

#import <CC3BoundingVolumes.h>

Inheritance diagram for CC3NodeBoundingBoxVolume:
Inheritance graph
[legend]
Collaboration diagram for CC3NodeBoundingBoxVolume:
Collaboration graph
[legend]

List of all members.

Properties

CC3BoundingBox boundingBox
CC3VectorglobalBoundingBoxVertices

Detailed Description

A bounding volume that forms an axially aligned bounding box (AABB) around the node, in the node's local coordinate system.

When transformed, this becomes an oriented bounding box (OBB) in the global coordinate system.

This class indicates that the node is inside the frustum unless all eight vertices of the transformed bounding box lie outside each of the frustum planes. This is much more computationally intenstive than a spherical bounding volume, but for many shapes, particularly those that are rectangular, provides a tighter bounding volume and therefore results in lower false-positives, which occurs when the bounding volume intersects the frustum, but the object shape actually does not, resulting in potentially significant unnecessary drawing activity.

The local bounding box must cover the node, and is translated, rotated, and scaled automatically to match the transformation of the node. For meshes, the local bounding box is calculated from the vertex locations. For other nodes, the local bounding box can be set directly within the bounding volume via the boundingBox property.


Property Documentation

- (CC3BoundingBox) boundingBox [read, write, assign]

The axially-aligned-bounding-box (AABB) in the node's local coordinate system.

For mesh nodes, the value of this property is automatically calculated from the vertex locations, via specialized subclasses of CC3NodeBoundingVolume used for meshes. For other nodes, this property can be set directly, if needed.

You can also set this property directly for mesh nodes as well. Doing so will override the value that was calculated automatically. This can be useful when the vertices will be changing frequently, and therefore the bounding volume will need to be recalculated frequently. By setting this property to a value that suits all possible vertex configurations, you can avoid expensive recalculations of the bounding volume as the vertices change.

When setting the value of this property on a mesh node directly, be sure to also set the shouldUseFixedBoundingVolume property of the node to YES, to stop automatic recalculation of this bounding volume whenever the underlying mesh vertices change.

The initial value of this property is kCC3BoundingBoxZero.

- (CC3Vector*) globalBoundingBoxVertices [read, assign]

An array of the eight vertices of the bounding box in the global coordinate system, after the bounding box has been transformed (translated, rotated and scaled) to match the transformation of the node.

For a node to be definitively outside the frustum, all eight vertices of the global bounding box must be outside each of the planes of the frustum.


The documentation for this class was generated from the following file: