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

#import <CC3NodeVisitor.h>

Inheritance diagram for CC3NodePickingVisitor:
Inheritance graph
[legend]

Instance Methods

(void) - alignShotWith:
 
- Instance Methods inherited from CC3NodeDrawingVisitor
(void) - bindEnvironmentalTextures
 
(void) - clearCCRenderers
 
(void) - clearGL
 
(void) - disableUnusedTextureUnits
 
(void) - draw:
 
(const CC3Matrix4x3 *) - eyeSpaceBoneMatrixAt:
 
(const CC3Matrix4x3 *) - globalBoneMatrixAt:
 
(void) - increment2DTextureUnit
 
(void) - incrementCubeTextureUnit
 
(const CC3Matrix4x3 *) - modelSpaceBoneMatrixAt:
 
(void) - populateLayerTransformMatrixFrom:
 
(void) - populateModelMatrixFrom:
 
(void) - populateProjMatrixFrom:
 
(void) - populateViewMatrixFrom:
 
(void) - resetTextureUnits
 
(CC3Vector- transformGlobalLocationToEyeSpace:
 
(CC3Vector- transformGlobalLocationToModelSpace:
 
- Instance Methods inherited from CC3NodeVisitor
(CC3TextureUnit *) - currentTextureUnitAt:
 
(NSString *) - fullDescription
 
(CC3Light *) - lightAt:
 
(CC3LightProbe *) - lightProbeAt:
 
(void) - requestRemovalOf:
 
(BOOL) - visit:
 

Properties

id< CC3RenderSurfacedefaultRenderSurface
 
CC3NodepickedNode
 
GLuint tagColorShift
 
- Properties inherited from CC3NodeDrawingVisitor
CCRendererbillboardCCRenderer
 
CCRendererccRenderer
 
GLuint current2DTextureUnit
 
ccColor4F currentColor
 
ccColor4B currentColor4B
 
GLuint currentCubeTextureUnit
 
CC3SkinSectioncurrentSkinSection
 
id< CC3RenderSurfacedefaultRenderSurface
 
CCTime deltaTime
 
CC3OpenGLgl
 
BOOL isDrawingEnvironmentMap
 
const GLKMatrix4 * layerTransformMatrix
 
const CC3Matrix4x3modelMatrix
 
const CC3Matrix4x3modelViewMatrix
 
const CC3Matrix4x4modelViewProjMatrix
 
const CC3Matrix4x4projMatrix
 
id< CC3RenderSurfacerenderSurface
 
BOOL shouldDecorateNode
 
CC3SceneDrawingSurfaceManagersurfaceManager
 
const CC3Matrix4x3viewMatrix
 
const CC3Matrix4x4viewProjMatrix
 
- Properties inherited from CC3NodeVisitor
CC3Cameracamera
 
CC3MaterialcurrentMaterial
 
CC3MeshcurrentMesh
 
CC3MeshNodecurrentMeshNode
 
CC3NodecurrentNode
 
CC3ShaderProgramcurrentShaderProgram
 
CC3CameradefaultCamera
 
GLuint lightCount
 
GLuint lightProbeCount
 
CC3PerformanceStatisticsperformanceStatistics
 
CC3Scenescene
 
BOOL shouldVisitChildren
 
CC3NodestartingNode
 
GLuint textureCount
 

Additional Inherited Members

- Class Methods inherited from CC3NodeVisitor
(id) + visitor
 

Detailed Description

CC3NodePickingVisitor is a CC3NodeDrawingVisitor that is passed to a node when it is visited during node picking operations using color-buffer based picking.

The visit: method must be invoked with a CC3Scene instance as the argument.

Node picking is the act of picking a 3D node from user input, such as a touch. One method of accomplishing this is to draw the scene such that each object is drawn in a unique solid color. Once the scene is drawn, the color of the pixel that has been touched can be read from the OpenGL ES color buffer, and mapped back to the object that was painted with that color.

Method Documentation

- (void) alignShotWith: (CC3NodeDrawingVisitor *)  otherVisitor

Aligns this visitor to use the same camera as the specified visitor.

The camera and surfaceManager properties of this visitor are set to those of the specified visitor.

The renderSurface property is left cleared, so that the defaultRenderSurface property will set it to the pickingSurface of the surfaceManager, when the renderSurface property is next accessed.

Implements CC3NodeDrawingVisitor.

Property Documentation

- (id<CC3RenderSurface>) defaultRenderSurface
readnonatomicassign

Template property that returns the default value used to automatically set the value of the renderSurface property.

Overridden to return the value of the pickingSurface property of the CC3SceneDrawingSurfaceManager held in the surfaceManager property.

- (CC3Node*) pickedNode
readnonatomicassign

Returns the node that was most recently picked.

This picked node is valid at a point in time. The value of this property is cleared immediately after it has been read. Subsequent queries of this property will return nil, so you should cache the returned value elsewhere if you need it to persist.

- (GLuint) tagColorShift
readwritenonatomicassign

Indicates the value to shift the bits of the value of the tag property of each node to determine the color to paint that node.

The initial value of this property is zero, indicating that the node tag value will not be shifted when converting it to and from a color. Increasing the value will increase the color separation between different nodes, which can be helpful during development when debugging node picking visually (ie- when the shouldDisplayPickingRender property of the CC3Scene is set to YES), However, increasing the shift value will also decrease the number of nodes that can be displayed and resolved on screen.

This value is a shift value that operates on the bits of the tag value. A value of one will effectively double the tag value before it is converted to a color, a value of two will quadruple the tag value, etc.


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