CCActionCamera

.h

#ifndef __CCCAMERA_ACTION_H__

#define __CCCAMERA_ACTION_H__


#include "CCActionInterval.h"


NS_CC_BEGIN


class CCCamera;


/**

 * @addtogroup actions

 * @{

 */


/** 

@brief Base class for CCCamera actions

@ingroup Actions

*/

class CC_DLL CCActionCamera : public CCActionInterval //<NSCopying> 

{

public:

    CCActionCamera()

        :m_fCenterXOrig(0)

        ,m_fCenterYOrig(0)

        ,m_fCenterZOrig(0)

        ,m_fEyeXOrig(0)

        ,m_fEyeYOrig(0)

        ,m_fEyeZOrig(0)

        ,m_fUpXOrig(0)

        ,m_fUpYOrig(0)

        ,m_fUpZOrig(0)

    {}

    virtual ~CCActionCamera(){}

    // super methods

    virtual void startWithTarget(CCNode *pTarget);

    virtual CCActionInterval * reverse();

protected:

    float m_fCenterXOrig;

    float m_fCenterYOrig;

    float m_fCenterZOrig;


    float m_fEyeXOrig;

    float m_fEyeYOrig;

    float m_fEyeZOrig;


    float m_fUpXOrig;

    float m_fUpYOrig;

    float m_fUpZOrig;

};


/** 

@brief CCOrbitCamera action

Orbits the camera around the center of the screen using spherical coordinates

@ingroup Actions

*/

class CC_DLL CCOrbitCamera : public CCActionCamera //<NSCopying> 

{

public:

    CCOrbitCamera()

        : m_fRadius(0.0)

        , m_fDeltaRadius(0.0)

        , m_fAngleZ(0.0)

        , m_fDeltaAngleZ(0.0)

        , m_fAngleX(0.0)            

        , m_fDeltaAngleX(0.0)

        , m_fRadZ(0.0)

        , m_fRadDeltaZ(0.0)

        , m_fRadX(0.0)                        

        , m_fRadDeltaX(0.0)        

    {}

    ~CCOrbitCamera(){}

    

    /** creates a CCOrbitCamera action with radius, delta-radius,  z, deltaZ, x, deltaX */

    static CCOrbitCamera* create(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX);

    

    /** initializes a CCOrbitCamera action with radius, delta-radius,  z, deltaZ, x, deltaX */

    bool initWithDuration(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX);

    /** positions the camera according to spherical coordinates */

    void sphericalRadius(float *r, float *zenith, float *azimuth);

    // super methods

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void startWithTarget(CCNode *pTarget);

    virtual void update(float time);


protected:

    float m_fRadius;

    float m_fDeltaRadius;

    float m_fAngleZ;

    float m_fDeltaAngleZ;

    float m_fAngleX;

    float m_fDeltaAngleX;


    float m_fRadZ;

    float m_fRadDeltaZ;

    float m_fRadX;

    float m_fRadDeltaX;

};


// end of actions group

/// @}


NS_CC_END


#endif //__CCCAMERA_ACTION_H__


转载于:https://www.cnblogs.com/sssssnian/p/3748673.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值