cococococococococos 2 d-Xノード(CCCamera.h.)API
4109 ワード
本論文はhttp://blog.csdn.net/runaying ,引用は出典を明記しなければならない!
cococococococococos 2 d-Xノード(CCCamera.h.)API
みなさんがよりよく勉強できるように、私のブログを見ることを強くおすすめします。 Cocos 2 d-X権威ガイドノート
cococococococococos 2 d-Xノード(CCCamera.h.)API
みなさんがよりよく勉強できるように、私のブログを見ることを強くおすすめします。 Cocos 2 d-X権威ガイドノート
///cocos2d-x-3.0alpha0/cocos2dx
#ifndef __COCOS2DX_CAMERA_H__
#define __COCOS2DX_CAMERA_H__
#include <string>
#include "cocoa/CCObject.h"
#include "ccMacros.h"
#include "kazmath/mat4.h"
NS_CC_BEGIN
/**
* @addtogroup base_nodes
* @{
*/
/**
Camera .
camera( )
camera OpenGL gluLookAt()
scale( ), rotation( 、 position , camera
IMPORTANT: camera rotation/scale/position .
camera rotation/scale/position World coordinates
Limitations:
- , camera( ) ; ParallaxNode, Particle ( )
using the camera.
- SpriteBatchNode( ) (Sprite)
- 3D 。 2D action position/scale/rotate.
*/
class CC_DLL Camera : public Object
{
public:
/** returns Z */
static float getZEye();
/**
* @js ctor
*/
Camera(void);
/**
* @js NA
* @lua NA
*/
~Camera(void);
void init(void);
/**
* @js NA
* @lua NA
*/
const char* description(void) const;
/** sets dirty( ) */
inline void setDirty(bool bValue) { _dirty = bValue; }
/** get dirty( ) */
inline bool isDirty(void) const { return _dirty; }
/** sets camera */
void restore(void);
/** Sets camera gluLookAt eye center 、 up_vector */
void locate(void);
/** sets eye */
void setEye(float fEyeX, float fEyeY, float fEyeZ);
/**
@ API, setEye()
* @js NA
* @lua NA
*/
CC_DEPRECATED_ATTRIBUTE void setEyeXYZ(float fEyeX, float fEyeY, float fEyeZ){ setEye(fEyeX, fEyeY, fEyeZ);}
/** sets */
void setCenter(float fCenterX, float fCenterY, float fCenterZ);
/**
@ API setCenter()
* @js NA
* @lua NA
*/
CC_DEPRECATED_ATTRIBUTE void setCenterXYZ(float fCenterX, float fCenterY, float fCenterZ){ setCenter(fCenterX,fCenterY,fCenterZ);}
/** sets vector( ) */
void setUp(float fUpX, float fUpY, float fUpZ);
/**
@ API setUp()
* @js NA
* @lua NA
*/
CC_DEPRECATED_ATTRIBUTE void setUpXYZ(float fUpX, float fUpY, float fUpZ){ setUp(fUpX,fUpY,fUpZ); }
/** get eye vector( )
* @code
* js or lua ,
* in js: var getEye()
* in lua:local getEye()
* @endcode
*/
void getEye(float *pEyeX, float *pEyeY, float *pEyeZ) const;
/**
@ API getEye()
* @js NA
* @lua NA
*/
CC_DEPRECATED_ATTRIBUTE void getEyeXYZ(float *pEyeX, float *pEyeY, float *pEyeZ) const { getEye(pEyeX, pEyeY, pEyeZ); }
/** get
* js or lua ,
* in js: var getCenter()
* in lua:local getCenter()
*/
void getCenter(float *pCenterX, float *pCenterY, float *pCenterZ) const;
/**
@ API getCenter()
* @js NA
* @lua NA
*/
CC_DEPRECATED_ATTRIBUTE void getCenterXYZ(float *pCenterX, float *pCenterY, float *pCenterZ) const{ getCenter(pCenterX,pCenterY,pCenterZ); }
/** get vector( )
* js or lua ,
* in js: var getUp()
* in lua:local getUp()
*/
void getUp(float *pUpX, float *pUpY, float *pUpZ) const;
/**
@ API getUp()
* @js NA
* @lua NA
*/
CC_DEPRECATED_ATTRIBUTE void getUpXYZ(float *pUpX, float *pUpY, float *pUpZ) const{ getUp(pUpX, pUpY, pUpZ); }
protected:
float _eyeX;
float _eyeY;
float _eyeZ;
float _centerX;
float _centerY;
float _centerZ;
float _upX;
float _upY;
float _upZ;
bool _dirty;
kmMat4 _lookupMatrix;
private:
DISALLOW_COPY_AND_ASSIGN(Camera);
};
// end of base_node group
/// @}
NS_CC_END
#endif // __COCOS2DX_CAMERA_H__