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

CC3Cameracamera
CC3NodeSequencerdrawingSequencer
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 property must be set before invoking the visit, so that only nodes that are within the camera's field of view will be visited. Nodes outside the camera's 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

- (CC3Camera *) camera [read, write, assign]

The camera that is viewing the 3D scene that is being drawn.

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 current activeCamera is used.

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

- (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: