CCCamera Class Reference
Inherits from | NSObject |
Declared in | CCCamera.h |
Overview
A CCCamera is used in every CCNode.
Useful to look at the object from different views.
The OpenGL gluLookAt() function is used to locate the
camera.
If the object is transformed by any of the scale, rotation or
position attributes, then they will override the camera.
IMPORTANT: Either your use the camera or the rotation/scale/position properties. You can't use both.
World coordinates won't work if you use the camera.
Limitations:
- Some nodes, like CCParallaxNode, CCParticle uses world node coordinates, and they won't work properly if you move them (or any of their ancestors)
using the camera.
- It doesn't work on batched nodes like CCSprite objects when they are parented to a CCSpriteBatchNode object.
- It is recommended to use it ONLY if you are going to create 3D effects. For 2D effects, use the action CCFollow or position/scale/rotate.
Tasks
-
dirty
whether of not the camera is dirty
property -
+ getZEye
returns the Z eye
-
– restore
sets the camera in the defaul position
-
– locate
Sets the camera using gluLookAt using its eye, center and up_vector
-
– setEyeX:eyeY:eyeZ:
sets the eye values in points
-
– setCenterX:centerY:centerZ:
sets the center values in points
-
– setUpX:upY:upZ:
sets the up values
-
– eyeX:eyeY:eyeZ:
get the eye vector values in points
-
– centerX:centerY:centerZ:
get the center vector values in points
-
– upX:upY:upZ:
get the up vector values
Instance Methods
centerX:centerY:centerZ:
get the center vector values in points
- (void)centerX:(float *)x centerY:(float *)y centerZ:(float *)z
Declared In
CCCamera.h
eyeX:eyeY:eyeZ:
get the eye vector values in points
- (void)eyeX:(float *)x eyeY:(float *)y eyeZ:(float *)z
Declared In
CCCamera.h
locate
Sets the camera using gluLookAt using its eye, center and up_vector
- (void)locate
Declared In
CCCamera.h
setCenterX:centerY:centerZ:
sets the center values in points
- (void)setCenterX:(float)x centerY:(float)y centerZ:(float)z
Declared In
CCCamera.h
setEyeX:eyeY:eyeZ:
sets the eye values in points
- (void)setEyeX:(float)x eyeY:(float)y eyeZ:(float)z
Declared In
CCCamera.h