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

#import <CC3Camera.h>

Inheritance diagram for CC3Camera:
Inheritance graph
[legend]

Instance Methods

(CC3Vector- calculateLocationToShowAllOf:fromDirection:withPadding:
 
(CC3Vector- calculateLocationToShowAllOf:whileLookingAt:fromDirection:withPadding:
 
(CGPoint) - cc2PointFromGLPoint:
 
(void) - closeWithVisitor:
 
(CGPoint) - glPointFromCC2Point:
 
(void) - markProjectionDirty
 
(void) - moveToShowAllOf:
 
(void) - moveToShowAllOf:fromDirection:
 
(void) - moveToShowAllOf:fromDirection:withPadding:
 
(void) - moveToShowAllOf:whileLookingAt:
 
(void) - moveToShowAllOf:whileLookingAt:fromDirection:
 
(void) - moveToShowAllOf:whileLookingAt:fromDirection:withPadding:
 
(void) - moveToShowAllOf:whileLookingAt:withPadding:
 
(void) - moveToShowAllOf:withPadding:
 
(void) - moveWithDuration:toShowAllOf:
 
(void) - moveWithDuration:toShowAllOf:fromDirection:
 
(void) - moveWithDuration:toShowAllOf:fromDirection:withPadding:
 
(void) - moveWithDuration:toShowAllOf:whileLookingAt:fromDirection:
 
(void) - moveWithDuration:toShowAllOf:whileLookingAt:fromDirection:withPadding:
 
(void) - moveWithDuration:toShowAllOf:whileLookingAt:withPadding:
 
(void) - moveWithDuration:toShowAllOf:withPadding:
 
(void) - moveWithDuration:whileLookingAt:toShowAllOf:
 
(void) - openWithVisitor:
 
(CC3Vector- projectLocation:
 
(CC3Vector- projectLocation:onNode:
 
(CC3Vector- projectNode:
 
(CC3Ray- unprojectPoint:
 
(CC3Vector4- unprojectPoint:ontoPlane:
 
- Instance Methods inherited from CC3Node
(void) - __deprecated
 
(void) - __deprecated
 
(void) - __deprecated
 
(void) - __deprecated
 
(void) - __deprecated
 
(void) - __deprecated
 
(void) - __deprecated
 
(void) - __deprecated
 
(void) - __deprecated
 
(void) - __deprecated
 
(id) - __deprecated
 
(void) - __deprecated
 
(void) - addAndLocalizeChild:
 
(void) - addAnimation:asTrack:
 
(GLuint) - addAnimationFrom:to:
 
(void) - addAnimationFrom:to:asTrack:
 
(GLuint) - addAnimationFrom:to:ofBaseTrack:
 
(void) - addAnimationFrom:to:ofBaseTrack:asTrack:
 
(GLuint) - addAnimationFromCAFFile:
 
(void) - addAnimationFromCAFFile:asTrack:
 
(GLuint) - addAnimationFromCAFFile:linkedToCSFFile:
 
(void) - addAnimationFromCAFFile:linkedToCSFFile:asTrack:
 
(GLuint) - addAnimationFromFrame:toFrame:
 
(void) - addAnimationFromFrame:toFrame:asTrack:
 
(GLuint) - addAnimationFromFrame:toFrame:ofBaseTrack:
 
(void) - addAnimationFromFrame:toFrame:ofBaseTrack:asTrack:
 
(GLuint) - addAnimationFromPODFile:
 
(void) - addAnimationFromPODFile:asTrack:
 
(GLuint) - addAnimationInResource:
 
(void) - addAnimationInResource:asTrack:
 
(void) - addAnimationState:
 
(void) - addAxesDirectionMarkers
 
(void) - addChild:
 
(void) - addContentFromPODFile:
 
(void) - addContentFromPODFile:withName:
 
(void) - addContentFromPODResourceFile:
 
(void) - addContentFromPODResourceFile:withName:
 
(void) - addDirectionMarker
 
(void) - addDirectionMarkerColored:inDirection:
 
(void) - addShadowVolumes
 
(void) - addShadowVolumesForLight:
 
(void) - addTexture:
 
(void) - addTransformListener:
 
(void) - alignInvertedTextures
 
(void) - alignTextures
 
(GLfloat) - animationBlendingWeightOnTrack:
 
(CCTime) - animationTimeOnTrack:
 
(NSString *) - appendStructureDescriptionTo:withIndent:
 
(void) - applyEffectNamed:inPFXResourceFile:
 
(void) - applyEffectNamed:inPFXResourceNamed:
 
(void) - applyLocalTransformsTo:
 
(CC3Node *) - asBumpMapLightTrackingWrapper
 
(CC3Node *) - asCameraTrackingWrapper
 
(CC3Node *) - asOrientingWrapper
 
(CC3Node *) - asTrackingWrapper
 
(void) - bindRestPose
 
(CC3Box- boundingBoxRelativeTo:
 
(void) - buildTransformMatrixWithVisitor:
 
(void) - checkDrawingOrder
 
(void) - cleanupActions
 
(CC3Node *) - closestNodeIntersectedByGlobalRay:
 
(BOOL) - containsAnimationOnTrack:
 
(id) - copy
 
(id) - copyWithName:
 
(void) - createBoundingVolume
 
(void) - createBoundingVolumes
 
(void) - createGLBuffers
 
(void) - createSkinnedBoundingVolumes
 
(CC3NodeBoundingVolume *) - defaultBoundingVolume
 
(void) - deleteBoundingVolumes
 
(void) - deleteGLBuffers
 
(NSString *) - describeAnimationStateForFrames:
 
(NSString *) - describeAnimationStateForFrames:fromTime:toTime:
 
(NSString *) - describeCurrentAnimationState
 
(void) - disableAllAnimation
 
(void) - disableAllAnimationOnTrack:
 
(void) - disableAllLocationAnimation
 
(void) - disableAllQuaternionAnimation
 
(void) - disableAllScaleAnimation
 
(void) - disableAnimation
 
(void) - disableAnimationOnTrack:
 
(void) - disableLocationAnimation
 
(void) - disableQuaternionAnimation
 
(void) - disableScaleAnimation
 
(BOOL) - doesIntersectBoundingVolume:
 
(BOOL) - doesIntersectFrustum:
 
(BOOL) - doesIntersectGlobalRay:
 
(BOOL) - doesIntersectNode:
 
(void) - doNotBufferVertexBitangents
 
(void) - doNotBufferVertexBoneIndices
 
(void) - doNotBufferVertexBoneWeights
 
(void) - doNotBufferVertexColors
 
(void) - doNotBufferVertexContent
 
(void) - doNotBufferVertexIndices
 
(void) - doNotBufferVertexLocations
 
(void) - doNotBufferVertexNormals
 
(void) - doNotBufferVertexPointSizes
 
(void) - doNotBufferVertexTangents
 
(void) - doNotBufferVertexTextureCoordinates
 
(void) - drawWithVisitor:
 
(void) - enableAllAnimation
 
(void) - enableAllAnimationOnTrack:
 
(void) - enableAllLocationAnimation
 
(void) - enableAllQuaternionAnimation
 
(void) - enableAllScaleAnimation
 
(void) - enableAnimation
 
(void) - enableAnimationOnTrack:
 
(void) - enableLocationAnimation
 
(void) - enableQuaternionAnimation
 
(void) - enableScaleAnimation
 
(void) - ensureRigidSkeleton
 
(void) - establishAnimationFrameAt:
 
(void) - establishAnimationFrameAt:onTrack:
 
(NSArray *) - flatten
 
(void) - flattenInto:
 
(void) - flipNormals
 
(void) - flipTexturesHorizontally
 
(void) - flipTexturesVertically
 
(void) - freezeAllInanimatesOnTrack:
 
(void) - freezeIfInanimateOnTrack:
 
(CCAction *) - getActionByTag:
 
(CC3NodeAnimation *) - getAnimationOnTrack:
 
(CC3NodeAnimationState *) - getAnimationStateOnTrack:
 
(CC3MeshNode *) - getMeshNodeNamed:
 
(CC3Node *) - getNodeNamed:
 
(CC3Node *) - getNodeTagged:
 
(CC3ShadowVolumeMeshNode *) - getShadowVolumeForLight:
 
(CC3Vector- globalLocationOfGlobalRayIntesection:
 
(CC3Matrix *) - globalRotationMatrix
 
(BOOL) - hasShadowVolumes
 
(BOOL) - hasShadowVolumesForLight:
 
(void) - hide
 
(BOOL) - isAnimationEnabledOnTrack:
 
(BOOL) - isDescendantOf:
 
(BOOL) - isShadowVisible
 
(void) - linkToPODNodes:
 
(CC3Vector- locationOfGlobalRayIntesection:
 
(void) - markAnimationDirty
 
(void) - markBoundingVolumeDirty
 
(void) - markTransformDirty
 
(PODStructPtr- nodePODStructAtIndex:fromPODResource:
 
(CC3NodePuncturingVisitor *) - nodesIntersectedByGlobalRay:
 
(void) - nodeWasDestroyed:
 
(void) - nodeWasTransformed:
 
(NSInteger) - numberOfRunningActions
 
(void) - pauseAllActions
 
(void) - prewarmForShadowVolumes
 
(void) - reattachBonesFrom:
 
(void) - releaseRedundantContent
 
(void) - remove
 
(void) - removeAllChildren
 
(void) - removeAllDirectionMarkers
 
(void) - removeAllTransformListeners
 
(void) - removeAnimation:
 
(void) - removeAnimationState:
 
(void) - removeAnimationTrack:
 
(void) - removeChild:
 
(void) - removeShaders
 
(void) - removeShadowVolumes
 
(void) - removeShadowVolumesForLight:
 
(void) - removeTransformListener:
 
(void) - resumeAllActions
 
(void) - retainVertexBitangents
 
(void) - retainVertexBoneIndices
 
(void) - retainVertexBoneWeights
 
(void) - retainVertexColors
 
(void) - retainVertexContent
 
(void) - retainVertexIndices
 
(void) - retainVertexLocations
 
(void) - retainVertexNormals
 
(void) - retainVertexPointSizes
 
(void) - retainVertexTangents
 
(void) - retainVertexTextureCoordinates
 
(void) - rotateBy:
 
(void) - rotateByAngle:aroundAxis:
 
(void) - rotateByAngle:aroundAxis:atLocation:
 
(void) - rotateByQuaternion:
 
(CCAction *) - runAction:
 
(CCAction *) - runAction:withTag:
 
(void) - selectShaders
 
(void) - setAnimationBlendingWeight:onTrack:
 
(void) - setSkeletalBoundingVolume:
 
(void) - show
 
(void) - stopAction:
 
(void) - stopActionByTag:
 
(void) - stopAllActions
 
(void) - touchDisableAll
 
(void) - touchEnableAll
 
(void) - trackTargetWithVisitor:
 
(void) - transformAndDrawWithVisitor:
 
(void) - translateBy:
 
(void) - updateAfterTransform:
 
(void) - updateBeforeTransform:
 
(void) - wasAdded
 
(void) - wasRemoved
 
- Instance Methods inherited from CC3Identifiable
(id) - copyAsClass:
 
(void) - copyUserDataFrom:
 
(id) - copyWithName:asClass:
 
(id) - copyWithZone:withName:
 
(id) - copyWithZone:withName:asClass:
 
(BOOL) - deriveNameFrom:
 
(BOOL) - deriveNameFrom:usingSuffix:
 
(NSString *) - fullDescription
 
(id) - init
 
(id) - initAtIndex:fromPODResource:
 
(void) - initUserData
 
(id) - initWithName:
 
(id) - initWithTag:
 
(id) - initWithTag:withName:
 
(GLuint) - nextTag
 
(void) - populateFrom:
 

Properties

GLfloat nearClippingPlane __deprecated
 
GLfloat farClippingPlane __deprecated
 
CC3Matrix *modelviewMatrix __deprecated
 
GLfloat effectiveFieldOfView
 
GLfloat farClippingDistance
 
GLfloat fieldOfView
 
UIInterfaceOrientation fieldOfViewAspectOrientation
 
CC3FieldOfViewOrientation fieldOfViewOrientation
 
CC3Vector forwardDirection
 
CC3Frustumfrustum
 
BOOL hasInfiniteDepthOfField
 
BOOL isCamera
 
BOOL isOpen
 
BOOL isUsingParallelProjection
 
GLfloat nearClippingDistance
 
CC3MatrixprojectionMatrix
 
BOOL shouldClipToViewport
 
CC3MatrixviewMatrix
 
CC3Viewport viewport
 
- Properties inherited from CC3Node
CC3Vector sceneUpDirection __deprecated
 
CC3Vector worldUpDirection __deprecated
 
GLfloat scaleTolerance __deprecated
 
CC3TargettingConstraint
axisRestriction 
__deprecated
 
CC3Vector globalLightLocation __deprecated
 
CC3Matrix *transformMatrix __deprecated
 
CC3Matrix *transformMatrixInverted __deprecated
 
CC3Node *dirtiestAncestor __deprecated
 
CC3Matrix
*parentGlobalTransformMatrix 
__deprecated
 
CC3Matrix *parentTransformMatrix __deprecated
 
CC3Scene *world __deprecated
 
BOOL
shouldCleanupActionsWhenRemoved 
__deprecated
 
BOOL shouldCleanupWhenRemoved __deprecated
 
CC3CameraactiveCamera
 
ccColor4F ambientColor
 
CC3NodeAnimationanimation
 
CC3NodeAnimationStateanimationState
 
ccBlendFunc blendFunc
 
CC3Box boundingBox
 
CC3NodeBoundingVolumeboundingVolume
 
GLfloat boundingVolumePadding
 
GLfloat cameraDistanceProduct
 
CC3Vector centerOfGeometry
 
NSArray * children
 
CCColorRef color
 
BOOL containsAnimation
 
GLfloat decalOffsetFactor
 
GLfloat decalOffsetUnits
 
GLenum depthFunction
 
CC3NodeDescriptordescriptorNode
 
ccColor4F diffuseColor
 
NSArray * directionMarkers
 
ccColor4F emissionColor
 
BOOL expectsVerticallyFlippedTextures
 
CC3Vector forwardDirection
 
CC3Box globalBoundingBox
 
CC3Vector globalCenterOfGeometry
 
CC3Vector globalForwardDirection
 
CC3Vector4 globalHomogeneousPosition
 
CC3Vector4 globalLightPosition
 
CC3Vector globalLocation
 
CC3Vector globalRightDirection
 
CC3Vector globalRotation
 
CC3Vector globalScale
 
CC3MatrixglobalTransformMatrix
 
CC3MatrixglobalTransformMatrixInverted
 
CC3Vector globalUpDirection
 
BOOL hasLocalContent
 
BOOL hasSoftBodyContent
 
BOOL hasTarget
 
BOOL isAnimationEnabled
 
BOOL isBasePODNode
 
BOOL isBillboard
 
BOOL isCamera
 
BOOL isLight
 
BOOL isLightProbe
 
BOOL isMeshNode
 
BOOL isOpaque
 
BOOL isRunning
 
BOOL isScene
 
BOOL isShadowVolume
 
BOOL isTouchable
 
BOOL isTrackingForBumpMapping
 
BOOL isTransformDirty
 
BOOL isTransformRigid
 
BOOL isUniformlyScaledGlobally
 
BOOL isUniformlyScaledLocally
 
GLenum lineSmoothingHint
 
GLfloat lineWidth
 
CC3MatrixlocalTransformMatrix
 
CC3Vector location
 
CC3NormalScaling normalScalingMethod
 
CCOpacity opacity
 
CC3Nodeparent
 
CC3PerformanceStatisticsperformanceStatistics
 
GLint podContentIndex
 
GLint podParentIndex
 
GLint podTargetIndex
 
CC3Vector projectedLocation
 
CGPoint projectedPosition
 
CC3Quaternion quaternion
 
CC3Vector referenceUpDirection
 
GLfloat reflectivity
 
const char * renderStreamGroupMarker
 
CC3Vector rightDirection
 
CC3NoderootAncestor
 
CC3Vector rotation
 
GLfloat rotationAngle
 
CC3Vector rotationAxis
 
CC3Rotatorrotator
 
CC3Vector scale
 
CC3Scenescene
 
CC3ShaderContextshaderContext
 
CC3ShaderProgramshaderProgram
 
GLfloat shadowExpansionLimitFactor
 
GLushort shadowLagCount
 
GLushort shadowLagFactor
 
GLfloat shadowOffsetFactor
 
GLfloat shadowOffsetUnits
 
NSArray * shadowVolumes
 
GLfloat shadowVolumeVertexOffsetFactor
 
GLfloat shininess
 
BOOL shouldAddShadowVolumeEndCapsOnlyWhenNeeded
 
BOOL shouldAllowTouchableWhenInvisible
 
BOOL shouldApplyOpacityAndColorToMeshContent
 
BOOL shouldAutoremoveWhenEmpty
 
BOOL shouldAutotargetCamera
 
BOOL shouldBlendAtFullOpacity
 
BOOL shouldCacheFaces
 
BOOL shouldCastShadows
 
BOOL shouldCastShadowsWhenInvisible
 
BOOL shouldCullBackFaces
 
BOOL shouldCullFrontFaces
 
BOOL shouldDisableDepthMask
 
BOOL shouldDisableDepthTest
 
BOOL shouldDrawAllBoundingVolumes
 
BOOL shouldDrawAllDescriptors
 
BOOL shouldDrawAllLocalContentWireframeBoxes
 
BOOL shouldDrawAllWireframeBoxes
 
BOOL shouldDrawBoundingVolume
 
BOOL shouldDrawDescriptor
 
BOOL shouldDrawInClipSpace
 
BOOL shouldDrawWireframeBox
 
BOOL shouldIgnoreRayIntersection
 
BOOL shouldInheritTouchability
 
BOOL shouldLogIntersectionMisses
 
BOOL shouldLogIntersections
 
BOOL shouldShadowBackFaces
 
BOOL shouldShadowFrontFaces
 
BOOL shouldSmoothLines
 
BOOL shouldStopActionsWhenRemoved
 
BOOL shouldTrackTarget
 
BOOL shouldUseClockwiseFrontFaceWinding
 
BOOL shouldUseFixedBoundingVolume
 
BOOL shouldUseLighting
 
BOOL shouldUseLightProbes
 
BOOL shouldUseSmoothShading
 
CC3Vector skeletalScale
 
CC3SoftBodyNodesoftBodyNode
 
ccColor4F specularColor
 
NSString * structureDescription
 
CC3Nodetarget
 
CC3Vector targetLocation
 
CC3TargettingConstraint targettingConstraint
 
CC3Texturetexture
 
CC3NodetouchableNode
 
BOOL touchEnabled
 
NSSet * transformListeners
 
GLfloat uniformScale
 
CC3Vector upDirection
 
BOOL visible
 
CC3WireframeBoundingBoxNodewireframeBoxNode
 
GLint zOrder
 
- Properties inherited from CC3Identifiable
NSObject *sharedUserData __deprecated
 
NSString * name
 
NSString * nameSuffix
 
GLint podIndex
 
BOOL shouldIncludeInDeepCopy
 
GLuint tag
 
NSObject * userData
 
- Properties inherited from <CC3Cacheable>
NSString * name
 

Additional Inherited Members

- Class Methods inherited from CC3Node
(GLfloat) + __deprecated
 
(CGFloat) + descriptorFontSize
 
(ccColor4F) + directionMarkerColor
 
(id) + node
 
(id) + nodeAtIndex:fromPODResource:
 
(id) + nodeWithName:
 
(id) + nodeWithTag:
 
(id) + nodeWithTag:withName:
 
(void) + setDefaultScaleTolerance:
 
(void) + setDescriptorFontSize:
 
(void) + setDirectionMarkerColor:
 
(void) + setWireframeBoxColor:
 
(ccColor4F) + wireframeBoxColor
 

Detailed Description

CC3Camera represents the camera viewing the 3D scene.

CC3Camera is a type of CC3Node, and can therefore participate in a structural node assembly. An instance can be the child of another node, and the camera itself can have child nodes. For example, a camera can be mounted on a boom object or truck, and will move along with the parent node. Or the camera node itself might have a light node attached as a child, so that the light will move along with the camera, and point where the camera points.

However, when adding a camera to an assembly of nodes, be aware of whether the parent nodes use scaling. To construct the viewMatrix, the camera makes heavy use of matrix inversion of the cummulative transform matrix of the camera's transforms and the transforms of all its ancestors. If scaling has not been added to any ancestor nodes, the cummulative transform will be a Rigid transform. Inverting a Rigid transform matrix is much, much faster (orders of magnitude) than inverting a matrix that contains scaling and is therefore not rigid. If possible, try to avoid applying scaling to the ancestor nodes of this camera.

Like any CC3Node, CC3Camera can be pointed in a specific direction, pointed at a specific location, or at a specific node by setting the forwardDirection, targetLocation, or target properties, respectively.

The camera can be configured for either perspective or parallel projection, using the isUsingParallelProjection property. By default, the camera will use perspective projection.

You can use the projectLocation: and projectNode: methods to project global locations within the 3D scene into 2D view coordinates, indicating where on the screen a 3D object appears.

You can use the unprojectPoint: and unprojectPoint:ontoPlane: methods to project a 2D screen position into either a ray (a line) in the 3D scene, or into a specific intersection location on a 3D plane.

You can use the moveToShowAllOf:... or moveWithDuration:toShowAllOf: family of methods to have the camera automatically focus on, and display all of, a particular node, or even the whole scene itself.

Scaling a camera is a null operation because it scales everything, including the size of objects, but also the distance from the camera to those objects. The effects cancel out, and visually it appears that nothing has changed.

Therefore, for cameras, the scale and uniformScale properties are not applied to the transform matrix. Instead, the uniformScale property acts as a zoom factor (as if the camera lens is zoomed in or out), and influences the fieldOfView property accordingly. See the description of the fieldOfView property for more information about zooming.

If you find that objects in the periphery of your view appear elongated, you can adjust the fieldOfView and/or uniformScale properties to reduce this "fish-eye" effect. See the notes of the fieldOfView property for more on this.

For cameras, any change in the projection parameters, such as fieldOfView, scale, near or far clipping distances, is considered a transform change, and the transformListeners are sent a notification via the nodeWasTransformed: method when the projection matrix is recalculated.

Method Documentation

- (CC3Vector) calculateLocationToShowAllOf: (CC3Node *)  aNode
fromDirection: (CC3Vector aDirection
withPadding: (GLfloat)  padding 

Calculates and returns where to position this camera along a line extending in the specified direction from the center of the specified node, so that the camera will show the entire content of the node, including any descendant nodes.

The entire node can then be shown by positioning the camera at the returned location and setting the forwardDirection of the camera to the negated specified direction.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

By setting CC3Scene as the specified node, you can use this method to determine where to position the camera in order to show the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to determine where to locate your camera to capture the entire scene, or a particular node within the scene, when the scene is first drawn.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (CC3Vector) calculateLocationToShowAllOf: (CC3Node *)  aNode
whileLookingAt: (CC3Vector targetLoc
fromDirection: (CC3Vector aDirection
withPadding: (GLfloat)  padding 

Calculates and returns where to position this camera along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes.

The entire node can then be shown by positioning the camera at the returned location and setting the forwardDirection of the camera to the negated specified direction.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

By setting CC3Scene as the specified node, you can use this method to determine where to position the camera in order to show the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to determine where to locate your camera to capture the entire scene, or a particular node within the scene, when the scene is first drawn.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (CGPoint) cc2PointFromGLPoint: (CGPoint)  __deprecated
- (void) closeWithVisitor: (CC3NodeDrawingVisitor *)  visitor

Closes the camera for drawing operations.

This method is called automatically by the CC3Scene at the end of each frame drawing cycle. Usually, the application never needs to invoke this method directly.

- (CGPoint) glPointFromCC2Point: (CGPoint)  __deprecated
- (void) markProjectionDirty

Indicates that the projection matrix is dirty and needs to be recalculated.

For cameras, a change in projection is considered a transform change, so the transformListeners are sent a notification via the nodeWasTransformed: method when the projection matrix is rebuilt.

This method is invoked automatically as needed. Usually the application never needs to invoke this method directly.

- (void) moveToShowAllOf: (CC3Node *)  aNode

Moves this camera to a location along a line between the center of the specified node and this camera, so that the camera will show the entire content of the node, including any descendant nodes, with minimal padding.

The camera will point back towards the node along the line between itself and the center of the node.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to ensure that the camera is pointed towards the whole scene, or a particular node within the scene, when the scene is first drawn.

Since the camera points to the center of the node, when displayed, the node may not extend to both sides (or top & bottom) of the scene equally, due to perspective. In addition, in some cases, if the bounds of the node are fluid because of movement, or billboards that rotate as the camera moves into position, one or more corners of the node may extend slightly out of the camera's view.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveToShowAllOf: (CC3Node *)  aNode
fromDirection: (CC3Vector aDirection 

Moves this camera to a location along a line extending in the specified direction from the center of the specified node, so that the camera will show the entire content of the node, including any descendant nodes, with minimal padding.

The camera will point back towards the center of the node along the specified direction.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to ensure that the camera is pointed towards the whole scene, or a particular node within the scene, when the scene is first drawn.

Since the camera points to the center of the node, when displayed, the node may not extend to both sides (or top & bottom) of the scene equally, due to perspective. In addition, in some cases, if the bounds of the node are fluid because of movement, or billboards that rotate as the camera moves into position, one or more corners of the node may extend slightly out of the camera's view.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveToShowAllOf: (CC3Node *)  aNode
fromDirection: (CC3Vector aDirection
withPadding: (GLfloat)  padding 

Moves this camera to a location along a line extending in the specified direction from the center of the specified node, so that the camera will show the entire content of the node, including any descendant nodes.

The camera will point back towards the center of the node along the specified direction.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to ensure that the camera is pointed towards the whole scene, or a particular node within the scene, when the scene is first drawn.

Since the camera points to the center of the node, when displayed, the node may not extend to both sides (or top & bottom) of the scene equally, due to perspective. In addition, in some cases, if the bounds of the node are fluid because of movement, or billboards that rotate as the camera moves into position, one or more corners of the node may extend slightly out of the camera's view.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveToShowAllOf: (CC3Node *)  aNode
whileLookingAt: (CC3Vector targetLoc 

Moves this camera to a location along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes, with minimal padding.

The camera will point back towards the specified target location along the line between itself and the target location.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

Although the camera will point at the specified target location, the targetLocation property of the camera is not set to that location, and the camera will not track that location automatically. If you want the target location to be tracked by the camera, you should set the targetLocation and shouldTrackTarget properties of this camera once this method has finished.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveToShowAllOf: (CC3Node *)  aNode
whileLookingAt: (CC3Vector targetLoc
fromDirection: (CC3Vector aDirection 

Moves this camera to a location along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes, with minimal padding.

The camera will point back towards the specified target location along the specified direction.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

Although the camera will point at the specified target location, the targetLocation property of the camera is not set to that location, and the camera will not track that location automatically. If you want the target location to be tracked by the camera, you should set the targetLocation and shouldTrackTarget properties of this camera once this method has finished.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveToShowAllOf: (CC3Node *)  aNode
whileLookingAt: (CC3Vector targetLoc
fromDirection: (CC3Vector aDirection
withPadding: (GLfloat)  padding 

Moves this camera to a location along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes.

The camera will point back towards the specified target location along the specified direction.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

Although the camera will point at the specified target location, the targetLocation property of the camera is not set to that location, and the camera will not track that location automatically. If you want the target location to be tracked by the camera, you should set the targetLocation and shouldTrackTarget properties of this camera once this method has finished.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveToShowAllOf: (CC3Node *)  aNode
whileLookingAt: (CC3Vector targetLoc
withPadding: (GLfloat)  padding 

Moves this camera to a location along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes.

The camera will point back towards the specified target location along the line between itself and the target location.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

Although the camera will point at the specified target location, the targetLocation property of the camera is not set to that location, and the camera will not track that location automatically. If you want the target location to be tracked by the camera, you should set the targetLocation and shouldTrackTarget properties of this camera once this method has finished.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveToShowAllOf: (CC3Node *)  aNode
withPadding: (GLfloat)  padding 

Moves this camera to a location along a line between the center of the specified node and this camera, so that the camera will show the entire content of the node, including any descendant nodes.

The camera will point back towards the node along the line between itself and the center of the node.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to ensure that the camera is pointed towards the whole scene, or a particular node within the scene, when the scene is first drawn.

Since the camera points to the center of the node, when displayed, the node may not extend to both sides (or top & bottom) of the scene equally, due to perspective. In addition, in some cases, if the bounds of the node are fluid because of movement, or billboards that rotate as the camera moves into position, one or more corners of the node may extend slightly out of the camera's view.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveWithDuration: (CCTime)  t
toShowAllOf: (CC3Node *)  aNode 

Moves this camera to a location along a line between the center of the specified node and this camera, so that the camera will show the entire content of the node, including any descendant nodes, with minimal padding.

The camera will point back towards the node along the line between itself and the center of the node.

The camera's movement will take the specified amount of time, starting at its current location and orientation, and ending at the calculated location and oriented to point back towards the center of the node.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to ensure that the camera is pointed towards the whole scene, or a particular node within the scene, when the scene is first drawn.

Since the camera points to the center of the node, when displayed, the node may not extend to both sides (or top & bottom) of the scene equally, due to perspective. In addition, in some cases, if the bounds of the node are fluid because of movement, or billboards that rotate as the camera moves into position, one or more corners of the node may extend slightly out of the camera's view.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveWithDuration: (CCTime)  t
toShowAllOf: (CC3Node *)  aNode
fromDirection: (CC3Vector aDirection 

Moves this camera to a location along a line extending in the specified direction from the center of the specified node, so that the camera will show the entire content of the node, including any descendant nodes, with minimal padding.

The camera will point back towards the center of the node along the specified direction.

The camera's movement will take the specified amount of time, starting at its current location and orientation, and ending at the calculated location and oriented to point back towards the center of the node.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to ensure that the camera is pointed towards the whole scene, or a particular node within the scene, when the scene is first drawn.

Since the camera points to the center of the node, when displayed, the node may not extend to both sides (or top & bottom) of the scene equally, due to perspective. In addition, in some cases, if the bounds of the node are fluid because of movement, or billboards that rotate as the camera moves into position, one or more corners of the node may extend slightly out of the camera's view.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize. This is necessary so that the frustum of the camera has been set from the contentSize of the CC3Layer.

- (void) moveWithDuration: (CCTime)  t
toShowAllOf: (CC3Node *)  aNode
fromDirection: (CC3Vector aDirection
withPadding: (GLfloat)  padding 

Moves this camera to a location along a line extending in the specified direction from the center of the specified node, so that the camera will show the entire content of the node, including any descendant nodes.

The camera will point back towards the center of the node along the specified direction.

The camera's movement will take the specified amount of time, starting at its current location and orientation, and ending at the calculated location and oriented to point back towards the center of the node.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to ensure that the camera is pointed towards the whole scene, or a particular node within the scene, when the scene is first drawn.

Since the camera points to the center of the node, when displayed, the node may not extend to both sides (or top & bottom) of the scene equally, due to perspective. In addition, in some cases, if the bounds of the node are fluid because of movement, or billboards that rotate as the camera moves into position, one or more corners of the node may extend slightly out of the camera's view.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize. This is necessary so that the frustum of the camera has been set from the contentSize of the CC3Layer.

- (void) moveWithDuration: (CCTime)  t
toShowAllOf: (CC3Node *)  aNode
whileLookingAt: (CC3Vector targetLoc
fromDirection: (CC3Vector aDirection 

Moves this camera to a location along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes, with minimal padding.

The camera will point back towards the specified target location along the specified direction.

The camera's movement will take the specified amount of time, starting at its current location and orientation, and ending at the calculated location and oriented to point back towards the center of the node.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

If you want the target location to be tracked by the camera, once this movement is finished, you should consider not using this method, and instead, use the calculateLocationToShowAllOf:whileLookingAt:fromDirection:withPadding: method to determine the location to move the camera to, and create a combination of actions that include using the CC3ActionMoveTo and CC3ActionRotateToLookTowards actions in parallel, plus a callback action once those actions are complete, to a method that will set the appropriate target or targetLocation, and shouldTrackTarget properties. See the implementation of this method for ideas.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize. This is necessary so that the frustum of the camera has been set from the contentSize of the CC3Layer.

- (void) moveWithDuration: (CCTime)  t
toShowAllOf: (CC3Node *)  aNode
whileLookingAt: (CC3Vector targetLoc
fromDirection: (CC3Vector aDirection
withPadding: (GLfloat)  padding 

Moves this camera to a location along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes.

The camera will point back towards the specified target location along the specified direction.

The camera's movement will take the specified amount of time, starting at its current location and orientation, and ending at the calculated location and oriented to point back towards the center of the node.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

If you want the target location to be tracked by the camera, once this movement is finished, you should consider not using this method, and instead, use the calculateLocationToShowAllOf:whileLookingAt:fromDirection:withPadding: method to determine the location to move the camera to, and create a combination of actions that include using the CC3ActionMoveTo and CC3ActionRotateToLookTowards actions in parallel, plus a callback action once those actions are complete, to a method that will set the appropriate target or targetLocation, and shouldTrackTarget properties. See the implementation of this method for ideas.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize. This is necessary so that the frustum of the camera has been set from the contentSize of the CC3Layer.

- (void) moveWithDuration: (CCTime)  t
toShowAllOf: (CC3Node *)  aNode
whileLookingAt: (CC3Vector targetLoc
withPadding: (GLfloat)  padding 

Moves this camera to a location along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes.

The camera will point back towards the specified target location along the line between itself and the target location.

The camera's movement will take the specified amount of time, starting at its current location and orientation, and ending at the calculated location and oriented to point back towards the center of the node.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

If you want the target location to be tracked by the camera, once this movement is finished, you should consider not using this method, and instead, use the calculateLocationToShowAllOf:whileLookingAt:fromDirection:withPadding: method to determine the location to move the camera to, and create a combination of actions that include using the CC3ActionMoveTo and CC3ActionRotateToLookTowards actions in parallel, plus a callback action once those actions are complete, to a method that will set the appropriate target or targetLocation, and shouldTrackTarget properties. See the implementation of this method for ideas.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveWithDuration: (CCTime)  t
toShowAllOf: (CC3Node *)  aNode
withPadding: (GLfloat)  padding 

Moves this camera to a location along a line between the center of the specified node and this camera, so that the camera will show the entire content of the node, including any descendant nodes.

The camera will point back towards the node along the line between itself and the center of the node.

The camera's movement will take the specified amount of time, starting at its current location and orientation, and ending at the calculated location and oriented to point back towards the center of the node.

The padding argument indicates the empty-space padding to add around the bounding box of the node when it is framed in the camera. This value is expressed as a fraction of the size of the bounding box of the node. For example, if the padding value is set to 0.1, then this method will locate the camera so that there will be 10% empty space around the node when it is framed by the camera. A negative padding value will cause the node to expand to more fully fill the camera frame, or even expand beyond it.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

This method can be useful during development to troubleshoot scene display issues. For example, you can invoke this method in the onOpen method of your custom CC3Scene to ensure that the camera is pointed towards the whole scene, or a particular node within the scene, when the scene is first drawn.

Since the camera points to the center of the node, when displayed, the node may not extend to both sides (or top & bottom) of the scene equally, due to perspective. In addition, in some cases, if the bounds of the node are fluid because of movement, or billboards that rotate as the camera moves into position, one or more corners of the node may extend slightly out of the camera's view.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) moveWithDuration: (CCTime)  t
whileLookingAt: (CC3Vector targetLoc
toShowAllOf: (CC3Node *)  aNode 

Moves this camera to a location along a line extending in the specified direction from the specified target location, so that the camera will show the entire content of the node, including any descendant nodes, with minimal padding.

The camera will point back towards the specified target location along the line between itself and the target location.

The camera's movement will take the specified amount of time, starting at its current location and orientation, and ending at the calculated location and oriented to point back towards the center of the node.

The specified node may be the CC3Scene, in which case, the camera will be located to display the entire scene.

Although the camera will point at the specified target location, the targetLocation property of the camera is not set to that location, and the camera will not track that location automatically.

If you want the target location to be tracked by the camera, once this movement is finished, you should consider not using this method, and instead, use the calculateLocationToShowAllOf:whileLookingAt:fromDirection:withPadding: method to determine the location to move the camera to, and create a combination of actions that include using the CC3ActionMoveTo and CC3ActionRotateToLookTowards actions in parallel, plus a callback action once those actions are complete, to a method that will set the appropriate target or targetLocation, and shouldTrackTarget properties. See the implementation of this method for ideas.

This method requires that the CC3Scene is attached to a CC3Layer that has a valid contentSize (typically after the layer has been opened in its view). This is necessary because the frustum of this camera requires the contentSize of the CC3Layer to determine the projection matrix. Because of this, you cannot invoke this method when creating this camera, or from the initializeScene method of the CC3Scene. If you want to open your scene with the camera automatically framing the entire scene, or a particular node, a good place to invoke this method is in the onOpen callback method of your customized CC3Scene.

- (void) openWithVisitor: (CC3NodeDrawingVisitor *)  visitor

Opens the camera for drawing operations.

This method is called automatically by the CC3Scene at the beginning of each frame drawing cycle. Usually, the application never needs to invoke this method directly.

- (CC3Vector) projectLocation: (CC3Vector aGlobal3DLocation

Projects the specified global 3D scene location onto a 2D position in the display coordinate space, indicating where on the CC3Layer this 3D location will be seen.

The 2D position can be read from the X and Y components of the returned 3D location, and is measured in points in the coordinate system of the CC3Layer.

The specified location should be in global coordinates. If you are invoking this method to project the location of a CC3Node, you should use the globalLocation property of the node.

The Z-component of the returned location indicates the distance from the camera to the specified location, in global coordinates, with a positive value indicating that the specified location is in front of the camera, and a negative value indicating that the specified location is behind the camera.

Any 3D scene location can be either in front of or behind the camera, and both cases will be projected onto the 2D space of the viewport plane. If you are only interested in the case when the specified location is in front of the camera (potentially visible to the camera), check that the Z-component of the returned location is positive.

- (CC3Vector) projectLocation: (CC3Vector aLocal3DLocation
onNode: (CC3Node *)  aNode 

Projects the specified 3D location, in the local coordinate system of the specified node, onto a 2D position in the display coordinate space, indicating where on the CC3Layer this 3D location will be seen.

The 2D position can be read from the X and Y components of the returned 3D location, and is measured in points in the coordinate system of the CC3Layer.

The specified location should be in the local coordinates of the specified node.

The Z-component of the returned location indicates the distance from the camera to the specified location, in global coordinates, with a positive value indicating that the specified location is in front of the camera, and a negative value indicating that the specified location is behind the camera.

Any 3D scene location can be either in front of or behind the camera, and both cases will be projected onto the 2D space of the viewport plane. If you are only interested in the case when the specified location is in front of the camera (potentially visible to the camera), check that the Z-component of the returned location is positive.

- (CC3Vector) projectNode: (CC3Node *)  aNode

Projects the globalLocation of the specified node onto a 2D position in the display coordinate space, indicating where on the CC3Layer this 3D location will be seen.

The 2D position can be read from the X and Y components of the returned 3D location, and is measured in points in the coordinate system of the CC3Layer.

In addition to returning the projected 2D location, this method also sets that value into the projectedLocation property of the node, for future access.

The Z-component of the returned location indicates the distance from the camera to the specified location, in global coordinates, with a positive value indicating that the specified location is in front of the camera, and a negative value indicating that the specified location is behind the camera.

Any 3D scene location can be either in front of or behind the camera, and both cases will be projected onto the 2D space of the viewport plane. If you are only interested in the case when the specified location is in front of the camera (potentially visible to the camera), check that the Z-component of the returned location is positive.

- (CC3Ray) unprojectPoint: (CGPoint)  cc2Point

Projects a 2D point, which is specified in the local coordinates of the CC3Layer, into a ray extending from the camera into the 3D scene.

The returned ray contains a starting location and a direction.

If this camera is using perspective projection, the ray will start at the globalLocation of this camera and extend in a direction that passes through the specified point as it is mampped to a global location on the near clipping plane.

If this camera is using parallel projection, the ray will start at the specified point as it is mampped to a global location on the near clipping plane, and will be directed straight out from the camera, in the same direction as the camera's forwardDirection.

This method is the compliment to the projectLocation: method. You can use this method to map touch events to the 3D scene space for activities such as dropping objects into the 3D scene at a location under user finger touch control.

Any object that lies anywhere along the ray in 3D space will appear at the specified 2D point on the view. If you are trying to place an object at a 3D location corresponding to the 2D view point (eg- a finger touch point), you need to choose a specific location on the returned ray.

For example, you might determine where that ray intersects a particular plane, and place the object there. Or you might choose a location a certain distance from the camera, and place the object there.

- (CC3Vector4) unprojectPoint: (CGPoint)  cc2Point
ontoPlane: (CC3Plane plane 

Projects a 2D point, which is specified in the local coordinates of the CC3Layer, to a 3D location on the specified plane.

You can use this method to map touch events to the plane in the 3D scene space for activities such as dropping objects onto the plane at a location under user finger touch control.

The returned result is a 4D vector, where the x, y & z components give the intersection location in 3D space, and the w component gives the distance from the camera to the intersection location. If the w component is negative, the intersection point is behind the camera, which is an indication that the camera is looking away from the plane.

If the ray from the camera through the specified point is parallel to the plane, no intersection occurs, and the returned 4D vector will be zeroed (equal to kCC3Vector4Zero).

You should therefore test the w component value to make sure it is positive and non-zero before proceeding with an activity such as dropping an object on the plane. If the plane has bounds in your scene, you should also check whether the returned intersection is within those bounds.

Property Documentation

- (GLfloat nearClippingPlane) __deprecated
readwritenonatomicassign
Deprecated:
Renamed to nearClippingDistance.
- (GLfloat farClippingPlane) __deprecated
readwritenonatomicassign
Deprecated:
Renamed to farClippingDistance.
- (CC3Matrix* modelviewMatrix) __deprecated
readnonatomicstrong
Deprecated:
Renamed to viewMatrix for a more accurate semantic.
- (GLfloat) effectiveFieldOfView
readnonatomicassign

The effective field of view of this camera, in degrees.

Since the device orientation can change at will, the effective field of view is associated with the narrower of the two viewport dimensions (width or height), regardless of orientation. This allows the perspective to stay the same as the device is rotated by the user.

The effective field of view is influenced by the value of the uniformScale property, which, for cameras, acts as a zoom factor (as if the camera lens is zoomed in or out). The effective field of view of this camera is calculated as (fieldOfView / uniformScale).

Once a nominal field of view has been set in this property, changing the scale or uniformScale properties will change the effective field of view accordingly (although the value of the fieldOfView property remains the same). Scales greater than one zoom in (objects appear larger), and scales between one and zero zoom out (objects appear smaller).

Like real-world cameras, larger values of the effective field of view can result in a "fish-eye" effect, where objects at the periphery of the view can appear elongated. To reduce this effect, lower the value of fieldOfView property, or increase the value of the uniformScale property. In doing so, you may need to move your camera further away from the scene, so that your view will continue to include the same objects.

The effective field of view is clamped to keep it below 180 degrees, beyond which the scene would vanish into the distance.

- (GLfloat) farClippingDistance
readwritenonatomicassign

The distance from the camera to the clipping plane of the camera's frustrum that is farthest from the camera.

Initially set to kCC3DefaultFarClippingDistance.

- (GLfloat) fieldOfView
readwritenonatomicassign

The nominal field of view of this camera, in degrees.

The initial value of this property is set to kCC3DefaultFieldOfView.

The effect of setting this property is affected by the fieldOfViewOrientation, fieldOfViewAspectOrientation, and uniformScale properties.

In handheld devices, the device orientation can change at will, changing the aspect ratio of the camera viewport. The fieldOfViewOrientation, and fieldOfViewAspectOrientation properties work together to establish and maintain a consistent perspective, regardless of the current aspect ratio.

The fieldOfViewOrientation property indicates whether this fieldOfView value is measured horizontally, vertically, or diagonally across the display surface.

The fieldOfViewAspectOrientation property indicates the orientation (portrait or landscape) of the display surface to which this fieldOfView value is specified.

The fieldOfViewOrientation and fieldOfViewAspectOrientation properties combine to determine whether the fieldOfView value is measured horizontally or vertically, and whether it was meant to be applied to the long or short side of the display surface.

Applying a field of view angle across the short side of the display surface will produce a somewhat different view perspective than if the same field of view value is applied across the long side of the display surface.

Knowing these values, this camera can then automatically adjust the perspective, and keep it consistent, regardless of the actual orientation of the device and display surface.

For example, if the fieldOfViewOrientation property indicates that the fieldOfView applies to the horizontal direction, and the fieldOfViewAspectOrientation indicates that the horizontal side is longer than the vertical side (landscape), the camera knows that the fieldOfView property should be applied to the long side, regardless of the orientation of the device and display surface.

As another example, a vertical fieldOfViewOrientation, combined with a landscape fieldOfViewAspectOrientation corresponds to the commonly-used Hor+ FOV technique.

See the notes for the fieldOfViewOrientation and fieldOfViewAspectOrientation properties for more information about how they affect the use of the fieldOfView.

The effective field of view is influenced by the value of the uniformScale property, which, for cameras, acts as a zoom factor (as if the camera lens is zoomed in or out). The effective field of view of this camera is calculated as (fieldOfView / uniformScale).

Once a nominal field of view has been set in this property, changing the scale or uniformScale properties will change the effective field of view accordingly (although the value of the fieldOfView property remains the same). Scales greater than one zoom in (objects appear larger), and scales between one and zero zoom out (objects appear smaller).

Like real-world cameras, larger values of the effective field of view can result in a "fish-eye" effect, where objects at the periphery of the view can appear elongated. To reduce this effect, lower the value of fieldOfView property, or increase the value of the uniformScale property. In doing so, you may need to move your camera further away from the scene, so that your view will continue to include the same objects.

The effective field of view is clamped to keep it below 180 degrees, beyond which the scene would vanish into the distance.

- (UIInterfaceOrientation) fieldOfViewAspectOrientation
readwritenonatomicassign

Indicates the orientation (portrait or landscape) of the display surface to which the value of the fieldOfView value is specified.

This property works together with the fieldOfViewOrientation property to ensure that the fieldOfView is applied to the camera's perspective on the display surface in a consistent manner, regardless of changes to the orientation of the display surface resulting from changes to the orientation of the device. See the notes for the fieldOfView property for more information about this interaction.

This property is only concerned with whether the display surface orientation is portrait or landscape. It doesn't matter whether a portrait orientation is right-side-up or upside-down, or whether a landscape orientation is left or right. To indicate a portrait orientation, either UIInterfaceOrientationPortrait or UIInterfaceOrientationPortraitUpsideDown may be used, and to indicate a landscape orientation, either UIInterfaceOrientationLandscapeLeft or UIInterfaceOrientationLandscapeRight may be used.

The initial value of this propety is UIInterfaceOrientationLandscapeLeft, indicating that the value of the fieldOfView propery is meant to apply to a display surface whose horizontal side is longer than its vertical side.

- (CC3FieldOfViewOrientation) fieldOfViewOrientation
readwritenonatomicassign

Indicates whether the value of the fieldOfView property is measured horizontally, vertically, or diagonally across the display surface.

This property works together with the fieldOfViewAspectOrientation property to ensure that the fieldOfView is applied to the camera's perspective on the display surface in a consistent manner, regardless of changes to the orientation of the display surface resulting from changes to the orientation of the device. See the notes for the fieldOfView property for more information about this interaction.

The initial value of this property is CC3FieldOfViewOrientationDiagonal, indicating that the fieldOfView is measured diagonally across the display surface. This is a good general-purpose setting for framing a scene where it is not certain whether the scene will be displayed with portrait or landscape orientation.

Specifying a vertical fieldOfViewOrientation is good when you want to frame a scene containing a character close-up, and you don't want the character's head to be clipped off if the device is rotated. Combining a vertical fieldOfViewOrientation and a horizontal fieldOfViewAspectOrientation corresponds to the commonly-used Hor+ FOV technique.

- (CC3Vector) forwardDirection
readwritenonatomicassign

The direction in which this camera is pointing, relative to the coordinate system of this camera, which is relative to the parent's rotation.

The initial value of this property is kCC3VectorUnitZNegative, pointing down the negative Z-axis in the local coordinate system of this camera. When this camera is rotated, the original negative-Z axis of the camera's local coordinate system will point in this direction.

This orientation is opposite that for most other nodes, whose forwardDirection property orients the positve Z-axis of the node's coordinate system in the stated direction. This arrangement allows unrotated nodes to face the camera in a natural stance, and allows the unrotated camera to face the nodes.

See further notes in the notes for this property in the CC3Node class.

- (CC3Frustum*) frustum
readwritenonatomicstrong

The frustum of the camera.

This is constructed automatically from the field of view and the clipping plane properties. Usually the application never has need to set this property directly.

- (BOOL) hasInfiniteDepthOfField
readwritenonatomicassign

Indicates whether, during rendering, this camera uses an infinite depth of field, with a far clipping plane set at infinity.

The setting of this property affects the value of the projectionMatrix property.

The frustum of this camera calculates two projection matrices. One has a finite depth of field, and is held in the frustum finiteProjectionMatrix property. The other has an infinite depth of field and is held in the frustum infiniteProjectionMatrix property.

If the value of this property is set to NO, the projectionMatix property of this camera returns the value of the finiateProjectionMatrix of the frustum. If the value of this property is set to YES, the projectionMatix property of this camera returns the value of the infiniateProjectionMatrix of the frustum, effectively creating an infinite depth of field.

The value of this property does not affect the culling of nodes outside the camera's frustum. During drawing, regardless of the value of this property, the value of the farClippingDistance property is used to cull objects outside the camera's frustum. This is done to avoid wasting time rendering objects that are too far away to be seen (as defined by the value of the farClippingDistance property).

The initial value of this property is NO, indicating that the camera will have a finite depth of field, based on the value of the farClippingDistance.

For the most part, a finite depth of field provides slightly more accurate rendering, and this property should generally be left set to NO. However, there are a few circumstances, such as the rendering of infinite shadow volumes, where clipping at the far clipping plane within the GL engine needs to be avoided. In such circumstances, setting this property to YES can be useful.

Because of its use for rendering shadows, whenever a camera is set into the activeCamera property of the CC3Scene, the value of this property is copied from the old active camera.

- (BOOL) isCamera
readnonatomicassign

Returns whether this node is a camera.

Returns YES.

- (BOOL) isOpen
readnonatomicassign

Indicates whether this camera is open.

The initial value of this property is NO. It will return YES after the open method has been invoked, and will revert back to NO when the close method is invoked.

- (BOOL) isUsingParallelProjection
readwritenonatomicassign

Indicates whether this camera uses parallel projection.

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

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

- (GLfloat) nearClippingDistance
readwritenonatomicassign

The distance from the camera to the clipping plane of the camera's frustrum that is nearest to the camera.

Initially set to kCC3DefaultNearClippingDistance.

- (CC3Matrix*) projectionMatrix
readnonatomicstrong

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

This projection matrix takes into account the value of the farClippingDistance property, and will be finite in depth. This is contrasted by the projection matrix found in the infiniteProjectionMatrix property.

- (BOOL) shouldClipToViewport
readwritenonatomicassign

Indicates whether a scissor test should be used to ensure that redering remains within the viewport.

The initial value of this property is NO.

- (CC3Matrix*) viewMatrix
readnonatomicstrong

The matrix that holds the transform from model space to view space.

This is a convenience method that simply returns the value of the globalTransformMatrixInverted property.

- (CC3Viewport) viewport
readwritenonatomicassign

The viewport to which the camera will render its view.

This property must be set prior to attempting to render the camera's view.


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