cocos2d-x  2.2.3-gd2.113-rev1ec524e
Loading...
Searching...
No Matches
CCCamera Class Reference

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

#include <CCCamera.h>

Inheritance diagram for CCCamera:
[legend]
Collaboration diagram for CCCamera:
[legend]

Public Member Functions

 CCCamera (void)
 ctor More...
 
 ~CCCamera (void)
 NA NA. More...
 
void init (void)
 
const char * description (void)
 NA. More...
 
void setDirty (bool 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...
 
void locate (void)
 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 setEye More...
 
void setCenterXYZ (float fCenterX, float fCenterY, float fCenterZ)
 sets the center values in points setCenter More...
 
void setUpXYZ (float fUpX, float fUpY, float fUpZ)
 sets the up values setUp More...
 
void getEyeXYZ (float *pEyeX, float *pEyeY, float *pEyeZ)
 get the eye vector values in points NA More...
 
void getCenterXYZ (float *pCenterX, float *pCenterY, float *pCenterZ)
 get the center vector values int points NA More...
 
void getUpXYZ (float *pUpX, float *pUpY, float *pUpZ)
 get the up vector values NA More...
 
- Public Member Functions inherited from CCObject
 CCObject (void)
 
virtual ~CCObject (void)
 NA. More...
 
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)
 
 CCObject (const CCObject &)
 
CCObjectoperator= (const CCObject &)
 
virtual void encodeWithCoder (DS_Dictionary *)
 
virtual bool canEncode ()
 
CCObjectType getObjType () const
 
virtual int getTag () const
 
virtual void setTag (int nTag)
 
void setObjType (CCObjectType)
 
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)
 

Static Public Member Functions

static float getZEye ()
 returns the Z eye More...
 
- Static Public Member Functions inherited from CCObject
static CCObjectcreateWithCoder (DS_Dictionary *)
 

Protected Attributes

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

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

CCCamera ( void  )

ctor

◆ ~CCCamera()

~CCCamera ( void  )

NA NA.

Member Function Documentation

◆ description()

const char * description ( void  )

NA.

◆ getCenterXYZ()

void getCenterXYZ ( float *  pCenterX,
float *  pCenterY,
float *  pCenterZ 
)

get the center vector values int points NA

◆ getEyeXYZ()

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

get the eye vector values in points NA

◆ getUpXYZ()

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

get the up vector values NA

◆ getZEye()

static float getZEye ( )
static

returns the Z eye

◆ init()

void init ( void  )

◆ isDirty()

bool isDirty ( void  )
inline

get the dirty value

◆ locate()

void locate ( void  )

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

◆ restore()

void restore ( void  )

sets the camera in the default position

◆ setCenterXYZ()

void setCenterXYZ ( float  fCenterX,
float  fCenterY,
float  fCenterZ 
)

sets the center values in points setCenter

◆ setDirty()

void setDirty ( bool  bValue)
inline

sets the dirty value

◆ setEyeXYZ()

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

sets the eye values in points setEye

◆ setUpXYZ()

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

sets the up values setUp

Member Data Documentation

◆ m_bDirty

bool m_bDirty
protected

◆ m_fCenterX

float m_fCenterX
protected

◆ m_fCenterY

float m_fCenterY
protected

◆ m_fCenterZ

float m_fCenterZ
protected

◆ m_fEyeX

float m_fEyeX
protected

◆ m_fEyeY

float m_fEyeY
protected

◆ m_fEyeZ

float m_fEyeZ
protected

◆ m_fUpX

float m_fUpX
protected

◆ m_fUpY

float m_fUpY
protected

◆ m_fUpZ

float m_fUpZ
protected

◆ m_lookupMatrix

kmMat4 m_lookupMatrix
protected

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