Bounding volumes are used by CC3Nodes to determine whether a node interset the camera's frustum, or to determine boundaries for collision detection during physics simulation. More...
#import <CC3BoundingVolumes.h>
Public Member Functions | |
(BOOL) | - doesIntersectFrustum: |
(void) | - update |
Static Public Member Functions | |
(id) | + boundingVolume |
Properties | |
CC3Node * | node |
BOOL | volumeNeedsBuilding |
Many different shapes of boundaries are available, including points, spheres, bounding boxes, etc, permitting tradeoffs between accuracy and computational processing time.
+ (id) boundingVolume |
Allocates and initializes an autoreleased instance.
- (BOOL) doesIntersectFrustum: | (CC3Frustum *) | aFrustum |
Returns whether this bounding volume intersects the specfied frustum.
This default implementation always returns YES. Subclasses will override appropriately.
This method is invoked automatically by the node whenever it needs to determine whether or not it should be drawn.
- (void) update |
Builds the bounding volume if needed, and transforms it to match the transformation of the node.
This method is invoked automatically by the node whenever it recalculates its transformMatrix. Usually, the application never needs to invoke this method directly.
- (CC3Node *) node [read, write, assign] |
The node whose boundary this instance is keeping track of.
- (BOOL) volumeNeedsBuilding [read, write, assign] |
Indicates whether the volume needs building.
This is typically set to YES during instance initialization, and then to NO when the local bounding volume is calculated. This occurs the first time the update method is invoked. Usually, that is sufficient, and the application never needs to set this property. But, if for some reason it is determined that the bounding volume needs to be recalculated, this property can be reset back to YES.