CCCamera
CCCamera
Cocos2DA 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.
Inheritance: System.Object
Constructors
CCCamera()
CCCamera()()
Fields
Properties
sets get the dirty value
Methods
GetCenterXyz(out float, out float, out float)
GetCenterXyz(out float, out float, out float)(System.Single pCenterX, System.Single pCenterY, System.Single pCenterZ)
get the center vector values int points
Parameters:
pCenterX
(System.Single)pCenterY
(System.Single)pCenterZ
(System.Single)Example
GetEyeXyz(out float, out float, out float)
GetEyeXyz(out float, out float, out float)(System.Single pEyeX, System.Single pEyeY, System.Single pEyeZ)
get the eye vector values in points
Parameters:
pEyeX
(System.Single)pEyeY
(System.Single)pEyeZ
(System.Single)Example
GetUpXyz(out float, out float, out float)
GetUpXyz(out float, out float, out float)(System.Single pUpX, System.Single pUpY, System.Single pUpZ)
get the up vector values
Parameters:
pUpX
(System.Single)pUpY
(System.Single)pUpZ
(System.Single)Example
GetZEye()
System.Single GetZEye()()
returns the Z eye
Returns:
System.Single
Example
Init()
Init()()
Locate()
Locate()()
Sets the camera using gluLookAt using its eye, center and up_vector
Example
Restore()
Restore()()
sets the camera in the default position
Example
SetCenterXyz(float, float, float)
SetCenterXyz(float, float, float)(System.Single fCenterX, System.Single fCenterY, System.Single fCenterZ)
sets the center values in points
Parameters:
fCenterX
(System.Single)fCenterY
(System.Single)fCenterZ
(System.Single)Example
SetEyeXyz(float, float, float)
SetEyeXyz(float, float, float)(System.Single fEyeX, System.Single fEyeY, System.Single fEyeZ)
sets the eye values in points
Parameters:
fEyeX
(System.Single)fEyeY
(System.Single)fEyeZ
(System.Single)Example
SetUpXyz(float, float, float)
SetUpXyz(float, float, float)(System.Single fUpX, System.Single fUpY, System.Single fUpZ)
sets the up values
Parameters:
fUpX
(System.Single)fUpY
(System.Single)fUpZ
(System.Single)Example
ToString()
System.String ToString()()
Returns:
System.String
Example