cocos2d-x  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCCamera Class Reference

A CCCamera is used in every CCNode. More...

#include <CCCamera.h>

Inheritance diagram for CCCamera:
CCObject CCCopying

Public Member Functions

 CCCamera (void)
 ctor ()
 CCCamera ()
 ~CCCamera (void)
void init (void)
local init ()
const char * description (void)
void setDirty (bool bValue)
 sets the dirty value More...
 
local setDirty ( local bValue)
 sets the dirty value More...
 
bool isDirty (void)
 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 setEyeXYZ (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 setEyeXYZ ( local fEyeX, local fEyeY, local fEyeZ)
 sets the eye values in points More...
 
void setCenterXYZ (float fCenterX, float fCenterY, float fCenterZ)
 sets the center values in points More...
 
var setCenter ( var fCenterX, var fCenterY, var fCenterZ)
 sets the center values in points More...
 
local setCenterXYZ ( local fCenterX, local fCenterY, local fCenterZ)
 sets the center values in points More...
 
void setUpXYZ (float fUpX, float fUpY, float fUpZ)
 sets the up values More...
 
var setUp ( var fUpX, var fUpY, var fUpZ)
 sets the up values More...
 
local setUpXYZ ( local fUpX, local fUpY, local fUpZ)
 sets the up values More...
 
void getEyeXYZ (float *pEyeX, float *pEyeY, float *pEyeZ)
 get the eye vector values in points More...
 
local getEyeXYZ ( local pEyeX, local pEyeY, local pEyeZ)
 get the eye vector values in points More...
 
void getCenterXYZ (float *pCenterX, float *pCenterY, float *pCenterZ)
 get the center vector values int points More...
 
local getCenterXYZ ( local pCenterX, local pCenterY, local pCenterZ)
 get the center vector values int points More...
 
void getUpXYZ (float *pUpX, float *pUpY, float *pUpZ)
 get the up vector values More...
 
local getUpXYZ ( local pUpX, local pUpY, local pUpZ)
 get the up vector values More...
 
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObjectautorelease (void)
CCObjectcopy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual bool isEqual (const CCObject *pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)
virtual void update (float dt)
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)

Static Public Member Functions

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

Protected Attributes

float m_fEyeX
var m_fEyeX
local m_fEyeX
float m_fEyeY
var m_fEyeY
local m_fEyeY
float m_fEyeZ
var m_fEyeZ
local m_fEyeZ
float m_fCenterX
var m_fCenterX
local m_fCenterX
float m_fCenterY
var m_fCenterY
local m_fCenterY
float m_fCenterZ
var m_fCenterZ
local m_fCenterZ
float m_fUpX
var m_fUpX
local m_fUpX
float m_fUpY
var m_fUpY
local m_fUpY
float m_fUpZ
var m_fUpZ
local m_fUpZ
bool m_bDirty
var m_bDirty
local m_bDirty
kmMat4 m_lookupMatrix
var m_lookupMatrix
local m_lookupMatrix
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Detailed Description

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.

Constructor & Destructor Documentation

CCCamera ( void  )
var ctor (   )
local CCCamera (   )
~CCCamera ( void  )

Member Function Documentation

const char* description ( void  )
local description (   )
void getCenterXYZ ( float *  pCenterX,
float *  pCenterY,
float *  pCenterZ 
)

get the center vector values int points

local getCenterXYZ ( local  pCenterX,
local  pCenterY,
local  pCenterZ 
)

get the center vector values int points

void getEyeXYZ ( float *  pEyeX,
float *  pEyeY,
float *  pEyeZ 
)

get the eye vector values in points

local getEyeXYZ ( local  pEyeX,
local  pEyeY,
local  pEyeZ 
)

get the eye vector values in points

void getUpXYZ ( float *  pUpX,
float *  pUpY,
float *  pUpZ 
)

get the up vector values

local getUpXYZ ( local  pUpX,
local  pUpY,
local  pUpZ 
)

get the up vector values

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  )
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 setCenterXYZ ( 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 setCenterXYZ ( local  fCenterX,
local  fCenterY,
local  fCenterZ 
)

sets the center values in points

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 setEyeXYZ ( 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 setEyeXYZ ( local  fEyeX,
local  fEyeY,
local  fEyeZ 
)

sets the eye values in points

void setUpXYZ ( float  fUpX,
float  fUpY,
float  fUpZ 
)

sets the up values

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

sets the up values

local setUpXYZ ( local  fUpX,
local  fUpY,
local  fUpZ 
)

sets the up values

Member Data Documentation

bool m_bDirty
protected
var m_bDirty
protected
local m_bDirty
protected
float m_fCenterX
protected
var m_fCenterX
protected
local m_fCenterX
protected
float m_fCenterY
protected
var m_fCenterY
protected
local m_fCenterY
protected
float m_fCenterZ
protected
var m_fCenterZ
protected
local m_fCenterZ
protected
float m_fEyeX
protected
var m_fEyeX
protected
local m_fEyeX
protected
float m_fEyeY
protected
var m_fEyeY
protected
local m_fEyeY
protected
float m_fEyeZ
protected
var m_fEyeZ
protected
local m_fEyeZ
protected
float m_fUpX
protected
var m_fUpX
protected
local m_fUpX
protected
float m_fUpY
protected
var m_fUpY
protected
local m_fUpY
protected
float m_fUpZ
protected
var m_fUpZ
protected
local m_fUpZ
protected
kmMat4 m_lookupMatrix
protected
var m_lookupMatrix
protected
local m_lookupMatrix
protected

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