博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CCActionGrid3D
阅读量:5158 次
发布时间:2019-06-13

本文共 7976 字,大约阅读时间需要 26 分钟。

#ifndef __ACTION_CCGRID3D_ACTION_H__

#define __ACTION_CCGRID3D_ACTION_H__

#include "CCActionGrid.h"

NS_CC_BEGIN

/**

 * @addtogroup actions

 * @{

 */

/** 

@brief CCWaves3D action 

*/

class CC_DLL CCWaves3D : public CCGrid3DAction

{

public:

    inline float getAmplitude(void) { return m_fAmplitude; }

    inline void setAmplitude(float fAmplitude) { m_fAmplitude = fAmplitude; }

    inline float getAmplitudeRate(void) { return m_fAmplitudeRate; }

    inline void setAmplitudeRate(float fAmplitudeRate) { m_fAmplitudeRate = fAmplitudeRate; }

    /** initializes an action with duration, grid size, waves and amplitude */

    bool initWithDuration(float duration, const CCSize& gridSize, unsigned int waves, float amplitude);

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void update(float time);

public:

    /** creates an action with duration, grid size, waves and amplitude */

    static CCWaves3D* create(float duration, const CCSize& gridSize, unsigned int waves, float amplitude);

protected:

    unsigned int m_nWaves;

    float m_fAmplitude;

    float m_fAmplitudeRate;

};

/** @brief CCFlipX3D action */

class CC_DLL CCFlipX3D : public CCGrid3DAction

{

public:

    /** initializes the action with duration */

    virtual bool initWithDuration(float duration);

    virtual bool initWithSize(const CCSize& gridSize, float duration);

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void update(float time);

public:

    /** creates the action with duration */

    static CCFlipX3D* create(float duration);

};

/** @brief CCFlipY3D action */

class CC_DLL CCFlipY3D : public CCFlipX3D

{

public:

    virtual void update(float time);

    virtual CCObject* copyWithZone(CCZone* pZone);

public:

    /** creates the action with duration */

    static CCFlipY3D* create(float duration);

};

/** @brief CCLens3D action */

class CC_DLL CCLens3D : public CCGrid3DAction

{

public:

    /** Get lens center position */

    inline float getLensEffect(void) { return m_fLensEffect; }

    /** Set lens center position */

    inline void setLensEffect(float fLensEffect) { m_fLensEffect = fLensEffect; }

    /** Set whether lens is concave */

    inline void setConcave(bool bConcave) { m_bConcave = bConcave; }

  

    inline const CCPoint& getPosition(void) { return m_position; }

    void setPosition(const CCPoint& position);

    /** initializes the action with center position, radius, a grid size and duration */

    bool initWithDuration(float duration, const CCSize& gridSize, const CCPoint& position, float radius);

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void update(float time);

public:

    /** creates the action with center position, radius, a grid size and duration */

    static CCLens3D* create(float duration, const CCSize& gridSize, const CCPoint& position, float radius);

protected:

    /* lens center position */

    CCPoint m_position;

    float m_fRadius;

    /** lens effect. Defaults to 0.7 - 0 means no effect, 1 is very strong effect */

    float m_fLensEffect;

    /** lens is concave. (true = concave, false = convex) default is convex i.e. false */

    bool m_bConcave;

    bool    m_bDirty;

};

/** @brief CCRipple3D action */

class CC_DLL CCRipple3D : public CCGrid3DAction

{

public:

    /** get center position */

    inline const CCPoint& getPosition(void) { return m_position; }

    /** set center position */

    void setPosition(const CCPoint& position);

    inline float getAmplitude(void) { return m_fAmplitude; }

    inline void setAmplitude(float fAmplitude) { m_fAmplitude = fAmplitude; }

    inline float getAmplitudeRate(void) { return m_fAmplitudeRate; }

    inline void setAmplitudeRate(float fAmplitudeRate) { m_fAmplitudeRate = fAmplitudeRate; }

    /** initializes the action with radius, number of waves, amplitude, a grid size and duration */

    bool initWithDuration(float duration, const CCSize& gridSize, const CCPoint& position, float radius, unsigned int waves, float amplitude);

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void update(float time);

public:

    /** creates the action with radius, number of waves, amplitude, a grid size and duration */

    static CCRipple3D* create(float duration, const CCSize& gridSize, const CCPoint& position, float radius, unsigned int waves, float amplitude);

protected:

    /* center position */

    CCPoint m_position;

    float m_fRadius;

    unsigned int m_nWaves;

    float m_fAmplitude;

    float m_fAmplitudeRate;

};

/** @brief CCShaky3D action */

class CC_DLL CCShaky3D : public CCGrid3DAction

{

public:

    /** initializes the action with a range, shake Z vertices, a grid and duration */

    bool initWithDuration(float duration, const CCSize& gridSize, int range, bool shakeZ);

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void update(float time);

public:

    /** creates the action with a range, shake Z vertices, a grid and duration */

    static CCShaky3D* create(float duration, const CCSize& gridSize, int range, bool shakeZ);

protected:

    int m_nRandrange;

    bool m_bShakeZ;

};

/** @brief CCLiquid action */

class CC_DLL CCLiquid : public CCGrid3DAction

{

public:

    inline float getAmplitude(void) { return m_fAmplitude; }

    inline void setAmplitude(float fAmplitude) { m_fAmplitude = fAmplitude; }

    inline float getAmplitudeRate(void) { return m_fAmplitudeRate; }

    inline void setAmplitudeRate(float fAmplitudeRate) { m_fAmplitudeRate = fAmplitudeRate; }

    /** initializes the action with amplitude, a grid and duration */

    bool initWithDuration(float duration, const CCSize& gridSize, unsigned int waves, float amplitude);

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void update(float time);

public:

    /** creates the action with amplitude, a grid and duration */

    static CCLiquid* create(float duration, const CCSize& gridSize, unsigned int waves, float amplitude);

protected:

    unsigned int m_nWaves;

    float m_fAmplitude;

    float m_fAmplitudeRate;

};

/** @brief CCWaves action */

class CC_DLL CCWaves : public CCGrid3DAction

{

public:

    inline float getAmplitude(void) { return m_fAmplitude; }

    inline void setAmplitude(float fAmplitude) { m_fAmplitude = fAmplitude; }

    inline float getAmplitudeRate(void) { return m_fAmplitudeRate; }

    inline void setAmplitudeRate(float fAmplitudeRate) { m_fAmplitudeRate = fAmplitudeRate; }

    /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */

    bool initWithDuration(float duration, const CCSize& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical);

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void update(float time);

public:

    /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */

    static CCWaves* create(float duration, const CCSize& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical);

protected:

    unsigned int m_nWaves;

    float m_fAmplitude;

    float m_fAmplitudeRate;

    bool m_bVertical;

    bool m_bHorizontal;

};

/** @brief CCTwirl action */

class CC_DLL CCTwirl : public CCGrid3DAction

{

public:

    /** get twirl center */

    inline const CCPoint& getPosition(void) { return m_position; }

    /** set twirl center */

    void setPosition(const CCPoint& position);

    inline float getAmplitude(void) { return m_fAmplitude; }

    inline void setAmplitude(float fAmplitude) { m_fAmplitude = fAmplitude; }

    inline float getAmplitudeRate(void) { return m_fAmplitudeRate; }

    inline void setAmplitudeRate(float fAmplitudeRate) { m_fAmplitudeRate = fAmplitudeRate; }

    /** initializes the action with center position, number of twirls, amplitude, a grid size and duration */

    bool initWithDuration(float duration, const CCSize& gridSize, CCPoint position, unsigned int twirls, float amplitude);

    virtual CCObject* copyWithZone(CCZone* pZone);

    virtual void update(float time);

public:

    /** creates the action with center position, number of twirls, amplitude, a grid size and duration */

    static CCTwirl* create(float duration, const CCSize& gridSize, CCPoint position, unsigned int twirls, float amplitude);

protected:

    /* twirl center */

    CCPoint m_position;

    unsigned int m_nTwirls;

    float m_fAmplitude;

    float m_fAmplitudeRate;

};

// end of actions group

/// @}

NS_CC_END

#endif // __ACTION_CCGRID3D_ACTION_H__

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

你可能感兴趣的文章
[摘录]quarts:Quartz Quick Start Guide
查看>>
Go中局部全局变量的区分
查看>>
Linux_x86下NX与ASLR绕过技术(续)
查看>>
JavaScript的预编译和执行
查看>>
安装maven
查看>>
redis安装及配置
查看>>
[C++] Const详解
查看>>
第一个驱动之字符设备驱动(三)按键查询
查看>>
binutils工具集之---objcopy,ranlib,size,strings,strip
查看>>
Javascript中setTimeout()以及clearTimeout( )的使用
查看>>
软件测试第二周作业
查看>>
浅谈编程语言的历史和发展趋势
查看>>
Python 科学计算涉及模块
查看>>
Android异步下载图片的类和缓存图片到SD卡的类。
查看>>
Unicode
查看>>
【网络流24题】汽车加油行驶问题(最短路)
查看>>
【UOJ#48】【UR #3】核聚变反应强度(质因数分解)
查看>>
ADO.NET基础01
查看>>
最近对问题的分治算法
查看>>
Homebrew安装
查看>>