cocos2d-x  3.0alpha1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Camera Class Reference

A Camera is used in every Node. More...

#include <CCCamera.h>

Inheritance diagram for Camera:
Object

Public Member Functions

 Camera ()
 ctor ()
 Camera ()
 ~Camera ()
void init ()
var init ()
local init ()
const char * description () const
void setDirty (bool value)
 sets the dirty value More...
 
var setDirty ( var value)
 sets the dirty value More...
 
local setDirty ( local value)
 sets the dirty value More...
 
bool isDirty () const
 get the dirty value More...
 
void restore ()
 sets the camera in the default position More...
 
var restore ()
 sets the camera in the default position More...
 
local restore ()
 sets the camera in the default position More...
 
void locate ()
 Sets the camera using gluLookAt using its eye, center and up_vector. More...
 
void setEye (float eyeX, float eyeY, float eyeZ)
 sets the eye values in points More...
 
var setEye ( var eyeX, var eyeY, var eyeZ)
 sets the eye values in points More...
 
local setEye ( local eyeX, local eyeY, local eyeZ)
 sets the eye values in points More...
 
CC_DEPRECATED_ATTRIBUTE void setEyeXYZ (float eyeX, float eyeY, float eyeZ)
void setCenter (float centerX, float centerY, float centerZ)
 sets the center values in points More...
 
CC_DEPRECATED_ATTRIBUTE void setCenterXYZ (float centerX, float centerY, float centerZ)
void setUp (float upX, float upY, float upZ)
 sets the up values More...
 
var setUp ( var upX, var upY, var upZ)
 sets the up values More...
 
CC_DEPRECATED_ATTRIBUTE void setUpXYZ (float upX, float upY, float upZ)
void getEye (float *eyeX, float *eyeY, float *eyeZ) const
 get the eye vector values in points More...
 
var getEye ( var eyeX, var eyeY, var eyeZ)
 get the eye vector values in points More...
 
local getEye ( local eyeX, local eyeY, local eyeZ)
 get the eye vector values in points More...
 
CC_DEPRECATED_ATTRIBUTE void getEyeXYZ (float *eyeX, float *eyeY, float *eyeZ) const
void getCenter (float *centerX, float *centerY, float *centerZ) const
 get the center vector values int points when this function bound to js or lua,the input params are changed in js: var getCenter() in lua:local getCenter() More...
 
var getCenter ( var centerX, var centerY, var centerZ)
 get the center vector values int points when this function bound to js or lua,the input params are changed in js: var getCenter() in lua:local getCenter() More...
 
local getCenter ( local centerX, local centerY, local centerZ)
 get the center vector values int points when this function bound to js or lua,the input params are changed in js: var getCenter() in lua:local getCenter() More...
 
CC_DEPRECATED_ATTRIBUTE void getCenterXYZ (float *centerX, float *centerY, float *centerZ) const
void getUp (float *upX, float *upY, float *upZ) const
 get the up vector values when this function bound to js or lua,the input params are changed in js: var getUp() in lua:local getUp() More...
 
var getUp ( var upX, var upY, var upZ)
 get the up vector values when this function bound to js or lua,the input params are changed in js: var getUp() in lua:local getUp() More...
 
local getUp ( local upX, local upY, local upZ)
 get the up vector values when this function bound to js or lua,the input params are changed in js: var getUp() in lua:local getUp() More...
 
CC_DEPRECATED_ATTRIBUTE void getUpXYZ (float *upX, float *upY, float *upZ) const
- Public Member Functions inherited from Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)
virtual void update (float dt)

Static Public Member Functions

static float getZEye ()
 returns the Z eye More...
 

Protected Attributes

float _eyeX
var _eyeX
local _eyeX
float _eyeY
float _eyeZ
float _centerX
var _centerX
local _centerX
float _centerY
float _centerZ
var _centerZ
local _centerZ
float _upX
var _upX
local _upX
float _upY
float _upZ
bool _dirty
var _dirty
local _dirty
kmMat4 _lookupMatrix
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 

Detailed Description

A Camera is used in every Node.

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 ParallaxNode, Particle 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 Sprite objects when they are parented to a SpriteBatchNode object.
  • It is recommended to use it ONLY if you are going to create 3D effects. For 2D effects, use the action Follow or position/scale/rotate.

Constructor & Destructor Documentation

Camera ( )
var ctor ( )
local Camera ( )
~Camera ( )

Member Function Documentation

const char* description ( ) const
void getCenter ( float *  centerX,
float *  centerY,
float *  centerZ 
) const

get the center vector values int points when this function bound to js or lua,the input params are changed in js: var getCenter() in lua:local getCenter()

var getCenter ( var  centerX,
var  centerY,
var  centerZ 
)

get the center vector values int points when this function bound to js or lua,the input params are changed in js: var getCenter() in lua:local getCenter()

local getCenter ( local  centerX,
local  centerY,
local  centerZ 
)

get the center vector values int points when this function bound to js or lua,the input params are changed in js: var getCenter() in lua:local getCenter()

CC_DEPRECATED_ATTRIBUTE void
getCenterXYZ
( float *  centerX,
float *  centerY,
float *  centerZ 
) const
inline
Deprecated:
. Use getCenter() instead
void getEye ( float *  eyeX,
float *  eyeY,
float *  eyeZ 
) const

get the eye vector values in points

when this function bound to js or lua,the input params are changed
in js: var getEye()
in lua:local getEye()
var getEye ( var  eyeX,
var  eyeY,
var  eyeZ 
)

get the eye vector values in points

when this function bound to js or lua,the input params are changed
in js: var getEye()
in lua:local getEye()
local getEye ( local  eyeX,
local  eyeY,
local  eyeZ 
)

get the eye vector values in points

when this function bound to js or lua,the input params are changed
in js: var getEye()
in lua:local getEye()
CC_DEPRECATED_ATTRIBUTE void
getEyeXYZ
( float *  eyeX,
float *  eyeY,
float *  eyeZ 
) const
inline
Deprecated:
. Use getEye() instead
void getUp ( float *  upX,
float *  upY,
float *  upZ 
) const

get the up vector values when this function bound to js or lua,the input params are changed in js: var getUp() in lua:local getUp()

var getUp ( var  upX,
var  upY,
var  upZ 
)

get the up vector values when this function bound to js or lua,the input params are changed in js: var getUp() in lua:local getUp()

local getUp ( local  upX,
local  upY,
local  upZ 
)

get the up vector values when this function bound to js or lua,the input params are changed in js: var getUp() in lua:local getUp()

CC_DEPRECATED_ATTRIBUTE void
getUpXYZ
( float *  upX,
float *  upY,
float *  upZ 
) const
inline
Deprecated:
. Use getUp() instead
static float getZEye ( )
static

returns the Z eye

var getZEye ( )
static

returns the Z eye

local getZEye ( )
static

returns the Z eye

void init ( )
var init ( )
local init ( )
bool isDirty ( ) const
inline

get the dirty value

var isDirty ( )
inline

get the dirty value

local isDirty ( )
inline

get the dirty value

void locate ( )

Sets the camera using gluLookAt using its eye, center and up_vector.

var locate ( )

Sets the camera using gluLookAt using its eye, center and up_vector.

local locate ( )

Sets the camera using gluLookAt using its eye, center and up_vector.

void restore ( )

sets the camera in the default position

var restore ( )

sets the camera in the default position

local restore ( )

sets the camera in the default position

void setCenter ( float  centerX,
float  centerY,
float  centerZ 
)

sets the center values in points

var setCenter ( var  centerX,
var  centerY,
var  centerZ 
)

sets the center values in points

local setCenter ( local  centerX,
local  centerY,
local  centerZ 
)

sets the center values in points

CC_DEPRECATED_ATTRIBUTE void
setCenterXYZ
( float  centerX,
float  centerY,
float  centerZ 
)
inline
Deprecated:
. Use setCenter() instead
void setDirty ( bool  value)
inline

sets the dirty value

var setDirty ( var  value)
inline

sets the dirty value

local setDirty ( local  value)
inline

sets the dirty value

void setEye ( float  eyeX,
float  eyeY,
float  eyeZ 
)

sets the eye values in points

var setEye ( var  eyeX,
var  eyeY,
var  eyeZ 
)

sets the eye values in points

local setEye ( local  eyeX,
local  eyeY,
local  eyeZ 
)

sets the eye values in points

CC_DEPRECATED_ATTRIBUTE void
setEyeXYZ
( float  eyeX,
float  eyeY,
float  eyeZ 
)
inline
Deprecated:
. Use setEye() instead
void setUp ( float  upX,
float  upY,
float  upZ 
)

sets the up values

var setUp ( var  upX,
var  upY,
var  upZ 
)

sets the up values

local setUp ( local  upX,
local  upY,
local  upZ 
)

sets the up values

CC_DEPRECATED_ATTRIBUTE void
setUpXYZ
( float  upX,
float  upY,
float  upZ 
)
inline
Deprecated:
. Use setUp() instead

Member Data Documentation

float _centerX
protected
var _centerX
protected
local _centerX
protected
float _centerY
protected
var _centerY
protected
local _centerY
protected
float _centerZ
protected
var _centerZ
protected
local _centerZ
protected
bool _dirty
protected
var _dirty
protected
local _dirty
protected
float _eyeX
protected
var _eyeX
protected
local _eyeX
protected
float _eyeY
protected
var _eyeY
protected
local _eyeY
protected
float _eyeZ
protected
kmMat4 _lookupMatrix
protected
var _lookupMatrix
protected
local _lookupMatrix
protected
float _upX
protected
var _upX
protected
local _upX
protected
float _upY
protected
var _upY
protected
local _upY
protected
float _upZ
protected

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