v2.0.2
Instance Methods | Class Methods | Properties | List of all members
CC3NodeBoxBoundingVolume Class Reference

#import <CC3BoundingVolumes.h>

Inheritance diagram for CC3NodeBoxBoundingVolume:
Inheritance graph
[legend]

Instance Methods

(id) - initFromBox:
 
- Instance Methods inherited from CC3NodeBoundingVolume
(CCColorRef- displayNodeColor
 
(CCOpacity- displayNodeOpacity
 
(BOOL) - doesIntersectFrustum:
 
(CC3Vector- locationOfRayIntesection:
 
(void) - markTransformDirty
 
(void) - scaleBy:
 
- Instance Methods inherited from CC3BoundingVolume
(BOOL) - doesIntersect:
 
(BOOL) - doesIntersectConvexHullOf:planes:
 
(BOOL) - doesIntersectConvexHullOf:planes:from:
 
(BOOL) - doesIntersectLocation:
 
(BOOL) - doesIntersectRay:
 
(BOOL) - doesIntersectSphere:
 
(BOOL) - doesIntersectSphere:from:
 
(NSString *) - fullDescription
 
(CC3Vector- globalLocationOfGlobalRayIntesection:
 
(BOOL) - isInFrontOfPlane:
 
(void) - markDirty
 
(void) - populateFrom:
 

Class Methods

(id) + boundingVolumeFromBox:
 

Properties

CC3Vector
*globalBoundingBoxVertices 
__deprecated
 
CC3Box boundingBox
 
- Properties inherited from CC3NodeBoundingVolume
CC3Vector centerOfGeometry
 
CC3Vector globalCenterOfGeometry
 
BOOL isTransformDirty
 
CC3Nodenode
 
BOOL shouldBuildFromMesh
 
BOOL shouldDraw
 
BOOL shouldMaximize
 
- Properties inherited from CC3BoundingVolume
BOOL isDirty
 
GLuint planeCount
 
CC3Planeplanes
 
BOOL shouldIgnoreRayIntersection
 
BOOL shouldLogIntersectionMisses
 
BOOL shouldLogIntersections
 
GLuint vertexCount
 
CC3Vectorvertices
 

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 another bounding volume unless all eight vertices of the transformed bounding box lie outside each of the planes of the other bounding volume.

These tests are 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 other bounding volume, but the object shapes actually do not intersect.

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.

Method Documentation

+ (id) boundingVolumeFromBox: (CC3Box box

Allocates and initializes an autoreleased instance from the specified bounding box, and sets the shouldBuildFromMesh property to NO.

The box dimensions are specified in the coordinate system of the node. The resulting bounding volume is fixed to the sizes provided, and will not take into consideration the vertices of the mesh. It will, however, transform along with the node, as the node is transformed.

- (id) initFromBox: (CC3Box box

Initializes this instance from the specified bounding box, and sets the shouldBuildFromMesh property to NO.

The box dimensions are specified in the coordinate system of the node. The resulting bounding volume is fixed to the sizes provided, and will not take into consideration the vertices of the mesh. It will, however, transform along with the node, as the node is transformed.

Property Documentation

- (CC3Vector* globalBoundingBoxVertices) __deprecated
readnonatomicassign
Deprecated:
Use the superclass vertices property instead.
- (CC3Box) boundingBox
readwritenonatomicassign

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.

Setting the value of this property sets the shouldBuildFromMesh property to NO, so that the bounding box will not be overridden if the vertices of the mesh change.

The initial value of this property is kCC3BoxZero.


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