123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // ClampVelocityModule.h
- // cocos2d_libs
- //
- // Created by 徐俊杰 on 2020/4/24.
- //
- #ifndef ClampVelocityModule_h
- #define ClampVelocityModule_h
- //#include "cocos2d.h"
- #include "rparticle/Macros/RParticleMacros.h"
- #include "rparticle/Modules/ParticleSystemModule.h"
- #include "rparticle/ParticleSystemCurves.h"
- NS_RRP_BEGIN
- class ClampVelocityModule : public ParticleSystemModule
- {
- public:
- DECLARE_MODULE (ClampVelocityModule)
- ClampVelocityModule ();
-
- void Update (const ParticleSystemReadOnlyState& roState, const ParticleSystemState& state, ParticleSystemParticles& ps, const size_t fromIndex, const size_t toIndex, float dt);
- void CheckConsistency ();
-
- template<class TransferFunction>
- void Transfer (TransferFunction& transfer);
-
- inline MinMaxCurve& GetXCurve() { return m_X; };
- inline MinMaxCurve& GetYCurve() { return m_Y; };
- inline MinMaxCurve& GetZCurve() { return m_Z; };
- inline MinMaxCurve& GetMagnitude() { return m_Magnitude; };
- inline MinMaxCurve& GetDrag() { return m_Drag; };
- void SetInWorldSpace(bool value) { m_InWorldSpace = value; }
- bool GetInWorldSpace() const { return m_InWorldSpace; }
- void SetSeparateAxis(bool value) { m_SeparateAxis = value; }
- bool GetSeparateAxis() const { return m_SeparateAxis; }
- void SetMultiplyDragByParticleSize(bool value) { m_MultiplyDragByParticleSize = value; }
- bool GetMultiplyDragByParticleSize() const { return m_MultiplyDragByParticleSize; }
- void SetMultiplyDragByParticleVelocity(bool value) { m_MultiplyDragByParticleVelocity = value; }
- bool GetMultiplyDragByParticleVelocity() const { return m_MultiplyDragByParticleVelocity; }
- void SetDampen(float value) { m_Dampen = value; }
- float GetDampen() const { return m_Dampen; }
- private:
- MinMaxCurve m_X;
- MinMaxCurve m_Y;
- MinMaxCurve m_Z;
- MinMaxCurve m_Magnitude;
- MinMaxCurve m_Drag;
- bool m_InWorldSpace;
- bool m_SeparateAxis;
- bool m_MultiplyDragByParticleSize;
- bool m_MultiplyDragByParticleVelocity;
- float m_Dampen;
- };
- NS_RRP_END
- #endif /* ClampVelocityModule_h */
|