Public Member Functions | Static Public Member Functions | Properties

CC3Frustum Class Reference

Represents a camera's frustum. More...

#import <CC3Camera.h>

List of all members.

Public Member Functions

(void) - buildPlanes:
(BOOL) - doesIntersectPointAt:
(BOOL) - doesIntersectSphereAt:withRadius:
(NSString *) - fullDescription
(void) - markPlanesDirty
(void) - populateFrom:andAspect:andNearClip:andFarClip:andZoom:

Static Public Member Functions

(id) + frustum

Properties

GLfloat bottom
CC3Plane bottomPlane
GLfloat far
CC3Plane farPlane
BOOL isUsingParallelProjection
GLfloat left
CC3Plane leftPlane
GLfloat near
CC3Plane nearPlane
CC3GLMatrixprojectionMatrix
GLfloat right
CC3Plane rightPlane
GLfloat top
CC3Plane topPlane

Detailed Description

Represents a camera's frustum.

Each CC3Camera instance contains an instance of this class.


Member Function Documentation

- (void) buildPlanes: (CC3GLMatrix *)  aModelViewMatrix

Builds the planes in this frustum from the internal projectionMatrix and specified modelviewMatrix by multiplying the two matrices together and extracting the six frustum planes from the resulting model-view-projection matrix.

- (BOOL) doesIntersectPointAt: (CC3Vector location

Returns whether the specified global location intersects (is inside) this frustum.

- (BOOL) doesIntersectSphereAt: (CC3Vector location
withRadius: (GLfloat)  radius 

Returns whether a sphere, centered at the specified global location, and with the specified radius, intersects this frustum.

+ (id) frustum

Allocates and initializes an autorelease instance.

- (NSString*) fullDescription

Returns a string containing a more complete description of this frustum, including a description of each of the six planes that make up this frustum.

- (void) markPlanesDirty

Marks the planes as dirty and in need of recalculation.

- (void) populateFrom: (GLfloat)  fieldOfView
andAspect: (GLfloat)  aspect
andNearClip: (GLfloat)  nearClip
andFarClip: (GLfloat)  farClip
andZoom: (GLfloat)  zoomFactor 

Calculates the six frustum dimensions and the projectionMatrix from the specified projection parameters.


Property Documentation

- (GLfloat) bottom [read, assign]

The distance from view center to the bottom of this frustum at the near clipping plane.

- (CC3Plane) bottomPlane [read, assign]

The clip plane at the bottom of this frustum, in global coordinates.

- (GLfloat) far [read, assign]

The distance to the far end of this frustum.

- (CC3Plane) farPlane [read, assign]

The clip plane at the far end of this frustum, in global coordinates.

- (BOOL) isUsingParallelProjection [read, write, assign]

Indicates whether this frustum uses parallel projection.

If this value is set to NO, the projection matrix will be configured for perspective projection, which is typical for 3D worlds. If this value is set to YES, the projection matrix will be configured for orthographic projection.

The initial value of this property is NO, indicating that perspective projection will be used.

- (GLfloat) left [read, assign]

The distance from view center to the left edge of this frustum at the near clipping plane.

- (CC3Plane) leftPlane [read, assign]

The clip plane at the left side of this frustum, in global coordinates.

- (GLfloat) near [read, assign]

The distance to the near end of this frustum.

- (CC3Plane) nearPlane [read, assign]

The clip plane at the near end of this frustum, in global coordinates.

- (CC3GLMatrix *) projectionMatrix [read, assign]

The projection matrix that takes the camera's modelview and projects it to the viewport.

- (GLfloat) right [read, assign]

The distance from view center to the right edge of this frustum at the near clipping plane.

- (CC3Plane) rightPlane [read, assign]

The clip plane at the right side of this frustum, in global coordinates.

- (GLfloat) top [read, assign]

The distance from view center to the top of this frustum at the near clipping plane.

- (CC3Plane) topPlane [read, assign]

The clip plane at the top of this frustum, in global coordinates.


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