Properties

CC3NodeSphericalBoundingVolume Class Reference

A bounding volume that forms a sphere around a single point. More...

#import <CC3BoundingVolumes.h>

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

List of all members.

Properties

GLfloat globalRadius
GLfloat radius

Detailed Description

A bounding volume that forms a sphere around a single point.

When applied to a node, the center of the sphere is the node's center of geometry, and this class indicates that the node intersects the frustum if any part of the sphere intersects the frustum.

The radius of the sphere must cover the node, and is scaled automatically to match the globalScale of the node. For meshes, the center of geometry and local radius are calculated from the vertex locations. For other nodes, the center of gravity and radius can be set directly within the bounding volume via their respective properties.


Property Documentation

- (GLfloat) globalRadius [read, assign]

The radius that encompasses the extent of the node in the global coordinate system, as measured from the global center of geometry of this instance.

- (GLfloat) radius [read, write, assign]

The radius that encompasses the extent of the node in the node's local coordinate system, as measured from the center of geometry of this instance.

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 zero.


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