12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // VelocityModule.h
- // cocos2d_libs
- //
- // Created by 徐俊杰 on 2020/4/24.
- //
- #ifndef VelocityModule_h
- #define VelocityModule_h
- //#include "cocos2d.h"
- #include "rparticle/Macros/RParticleMacros.h"
- #include "rparticle/Modules/ParticleSystemModule.h"
- #include "rparticle/ParticleSystemCurves.h"
- #include "rparticle/Math/Random/rand.h"
- NS_RRP_BEGIN
- class VelocityModule : public ParticleSystemModule
- {
- public:
- DECLARE_MODULE (VelocityModule)
- VelocityModule ();
-
- void Update (const ParticleSystemReadOnlyState& roState, const ParticleSystemState& state, ParticleSystemParticles& ps, const size_t fromIndex, const size_t toIndex);
- void UpdateProcedural (const ParticleSystemReadOnlyState& roState, const ParticleSystemState& state, ParticleSystemParticles& ps);
- void CalculateProceduralBounds(MinMaxAABB& bounds, const Matrix4x4f& localToWorld, float maxLifeTime);
- void CheckConsistency() {};
-
- inline MinMaxCurve& GetXCurve() { return m_X; };
- inline MinMaxCurve& GetYCurve() { return m_Y; };
- inline MinMaxCurve& GetZCurve() { return m_Z; };
-
- template<class TransferFunction>
- void Transfer (TransferFunction& transfer);
-
- void SetInWorldSpace(bool value) { m_InWorldSpace = value; }
- bool GetInWorldSpace() const { return m_InWorldSpace; }
-
- private:
- MinMaxCurve m_X;
- MinMaxCurve m_Y;
- MinMaxCurve m_Z;
- bool m_InWorldSpace;
-
- Rand m_Random;
- };
- NS_RRP_END
- #endif /* VelocityModule_h */
|