Public Member Functions | Properties

CC3NodeDrawingVisitor Class Reference

CC3NodeDrawingVisitor is a CC3NodeVisitor that is passed to a node when it is visited during drawing operations. More...

#import <CC3NodeVisitor.h>

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

List of all members.

Public Member Functions

(void) - draw:

Properties

CC3NodeSequencerdrawingSequencer
CC3Frustumfrustum
BOOL shouldClearDepthBuffer
BOOL shouldDecorateNode
GLuint textureUnit
GLuint textureUnitCount

Detailed Description

CC3NodeDrawingVisitor is a CC3NodeVisitor that is passed to a node when it is visited during drawing operations.

The camera's frustum must be set in the frustum property before invoking this method, so that only nodes that are within the camera's field of view will be visited. Nodes outside the frustum will neither be visited nor drawn.


Member Function Documentation

- (void) draw: (CC3Node *)  aNode

Draws the specified node.

Invoked by the node itself when the node's local content is to be drawn.

This implementation first caches the current lighting enablement state in case lighting is turned off during drawing of the material, then it double-dispatches back to the node's drawWithVisitor: method to perform the drawing. Finally, this implementation updates the drawing performance statistics.

Subclass may override to enhance or modify this behaviour.


Property Documentation

- (CC3NodeSequencer *) drawingSequencer [read, write, assign]

The node sequencer that contains the drawable nodes, in the sequence in which they will be drawn.

If this property is not nil, the nodes will be drawn in the order they appear in the node sequencer. If this property is set to nil, the visitor will traverse the node tree during the visitation run, drawing each node that contains local content as it is encountered.

- (CC3Frustum *) frustum [read, write, assign]

The frustum used to determine if a node is within the camera's view.

This property must be set before the visit: method is invoked. It is therefore only available during a visitation run. Since the CC3World may contain multiple cameras, this ensures that the frustum of the current activeCamera is used.

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

Indicates whether the OpenGL depth buffer should be cleared before drawing the 3D world.

This property is automatically set to the value of the shouldClearDepthBufferBefore3D property of the CC3World.

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

Indicates whether nodes should decorate themselves with their configured material, textures, or color arrays.

In most cases, nodes should be drawn decorated. However, specialized visitors may turn off normal decoration drawing in order to do specialized coloring instead.

The default initial value is YES.

- (GLuint) textureUnit [read, write, assign]

The current texture unit being drawn.

This value is set during drawing when the visitor is passed to the texture coordinates array.

- (GLuint) textureUnitCount [read, write, assign]

The number of texture units being drawn.

This value is set by the texture contained in the node's material, and is then consumed by the mesh when binding texture coordinates.


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