cocos2d-x  3.0-alpha0
 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 (void)
 ctor ()
 Camera ()
 ~Camera (void)
void init (void)
var init ()
local init ()
const char * description (void) const
void setDirty (bool bValue)
 sets the dirty value More...
 
var setDirty ( var bValue)
 sets the dirty value More...
 
local setDirty ( local bValue)
 sets the dirty value More...
 
bool isDirty (void) const
 get the dirty value More...
 
var isDirty ()
 get the dirty value More...
 
local isDirty ()
 get the dirty value More...
 
void restore (void)
 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 (void)
 Sets the camera using gluLookAt using its eye, center and up_vector. More...
 
var locate ()
 Sets the camera using gluLookAt using its eye, center and up_vector. More...
 
local locate ()
 Sets the camera using gluLookAt using its eye, center and up_vector. More...
 
void setEye (float fEyeX, float fEyeY, float fEyeZ)
 sets the eye values in points More...
 
var setEye ( var fEyeX, var fEyeY, var fEyeZ)
 sets the eye values in points More...
 
local setEye ( local fEyeX, local fEyeY, local fEyeZ)
 sets the eye values in points More...
 
CC_DEPRECATED_ATTRIBUTE void setEyeXYZ (float fEyeX, float fEyeY, float fEyeZ)
void setCenter (float fCenterX, float fCenterY, float fCenterZ)
 sets the center values in points More...
 
CC_DEPRECATED_ATTRIBUTE void setCenterXYZ (float fCenterX, float fCenterY, float fCenterZ)
void setUp (float fUpX, float fUpY, float fUpZ)
 sets the up values More...
 
var setUp ( var fUpX, var fUpY, var fUpZ)
 sets the up values More...
 
CC_DEPRECATED_ATTRIBUTE void setUpXYZ (float fUpX, float fUpY, float fUpZ)
void getEye (float *pEyeX, float *pEyeY, float *pEyeZ) const
 get the eye vector values in points More...
 
var getEye ( var pEyeX, var pEyeY, var pEyeZ)
 get the eye vector values in points More...
 
local getEye ( local pEyeX, local pEyeY, local pEyeZ)
 get the eye vector values in points More...
 
CC_DEPRECATED_ATTRIBUTE void getEyeXYZ (float *pEyeX, float *pEyeY, float *pEyeZ) const
void getCenter (float *pCenterX, float *pCenterY, float *pCenterZ) 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 pCenterX, var pCenterY, var pCenterZ)
 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 pCenterX, local pCenterY, local pCenterZ)
 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 *pCenterX, float *pCenterY, float *pCenterZ) const
void getUp (float *pUpX, float *pUpY, float *pUpZ) 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 pUpX, var pUpY, var pUpZ)
 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 pUpX, local pUpY, local pUpZ)
 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 *pUpX, float *pUpY, float *pUpZ) 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...
 
var getZEye ()
 returns the Z eye More...
 
local getZEye ()
 returns the Z eye More...
 

Protected Attributes

float _eyeX
var _eyeX
local _eyeX
float _eyeY
var _eyeY
local _eyeY
float _eyeZ
var _eyeZ
local _eyeZ
float _centerX
var _centerX
local _centerX
float _centerY
var _centerY
local _centerY
float _centerZ
var _centerZ
local _centerZ
float _upX
var _upX
local _upX
float _upY
var _upY
local _upY
float _upZ
var _upZ
local _upZ
bool _dirty
var _dirty
local _dirty
kmMat4 _lookupMatrix
var _lookupMatrix
local _lookupMatrix
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
var _reference
 count of references More...
 
local _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 
var _autoReleaseCount
 count of autorelease More...
 
local _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 ( void  )
var ctor (   )
local Camera (   )
~Camera ( void  )

Member Function Documentation

const char* description ( void  ) const
void getCenter ( float *  pCenterX,
float *  pCenterY,
float *  pCenterZ 
) 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  pCenterX,
var  pCenterY,
var  pCenterZ 
)

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  pCenterX,
local  pCenterY,
local  pCenterZ 
)

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 *  pCenterX,
float *  pCenterY,
float *  pCenterZ 
) const
inline
Deprecated:
. Use getCenter() instead
void getEye ( float *  pEyeX,
float *  pEyeY,
float *  pEyeZ 
) 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  pEyeX,
var  pEyeY,
var  pEyeZ 
)

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  pEyeX,
local  pEyeY,
local  pEyeZ 
)

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 *  pEyeX,
float *  pEyeY,
float *  pEyeZ 
) const
inline
Deprecated:
. Use getEye() instead
void getUp ( float *  pUpX,
float *  pUpY,
float *  pUpZ 
) 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  pUpX,
var  pUpY,
var  pUpZ 
)

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  pUpX,
local  pUpY,
local  pUpZ 
)

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 *  pUpX,
float *  pUpY,
float *  pUpZ 
) 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 ( void  )
var init (   )
local init (   )
bool isDirty ( void  ) const
inline

get the dirty value

var isDirty (   )
inline

get the dirty value

local isDirty (   )
inline

get the dirty value

void locate ( void  )

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 ( void  )

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  fCenterX,
float  fCenterY,
float  fCenterZ 
)

sets the center values in points

var setCenter ( var  fCenterX,
var  fCenterY,
var  fCenterZ 
)

sets the center values in points

local setCenter ( local  fCenterX,
local  fCenterY,
local  fCenterZ 
)

sets the center values in points

CC_DEPRECATED_ATTRIBUTE void
setCenterXYZ
( float  fCenterX,
float  fCenterY,
float  fCenterZ 
)
inline
Deprecated:
. Use setCenter() instead
void setDirty ( bool  bValue)
inline

sets the dirty value

var setDirty ( var  bValue)
inline

sets the dirty value

local setDirty ( local  bValue)
inline

sets the dirty value

void setEye ( float  fEyeX,
float  fEyeY,
float  fEyeZ 
)

sets the eye values in points

var setEye ( var  fEyeX,
var  fEyeY,
var  fEyeZ 
)

sets the eye values in points

local setEye ( local  fEyeX,
local  fEyeY,
local  fEyeZ 
)

sets the eye values in points

CC_DEPRECATED_ATTRIBUTE void
setEyeXYZ
( float  fEyeX,
float  fEyeY,
float  fEyeZ 
)
inline
Deprecated:
. Use setEye() instead
void setUp ( float  fUpX,
float  fUpY,
float  fUpZ 
)

sets the up values

var setUp ( var  fUpX,
var  fUpY,
var  fUpZ 
)

sets the up values

local setUp ( local  fUpX,
local  fUpY,
local  fUpZ 
)

sets the up values

CC_DEPRECATED_ATTRIBUTE void
setUpXYZ
( float  fUpX,
float  fUpY,
float  fUpZ 
)
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
var _eyeZ
protected
local _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
var _upZ
protected
local _upZ
protected

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