12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // SizeByVelocityModule.h
- // cocos2d_libs
- //
- // Created by 徐俊杰 on 2020/4/24.
- //
- #ifndef SizeByVelocityModule_h
- #define SizeByVelocityModule_h
- //#include "cocos2d.h"
- #include "rparticle/Macros/RParticleMacros.h"
- #include "rparticle/Modules/ParticleSystemModule.h"
- #include "rparticle/ParticleSystemCurves.h"
- //#include "Runtime/Math/Vector2.h"
- NS_RRP_BEGIN
- class SizeBySpeedModule : public ParticleSystemModule
- {
- public:
- DECLARE_MODULE (SizeBySpeedModule)
- SizeBySpeedModule ();
-
- void Update (const ParticleSystemReadOnlyState& roState, const ParticleSystemParticles& ps, float* tempSize, size_t fromIndex, size_t toIndex);
- void UpdateSingle(const ParticleSystemReadOnlyState& roState, const ParticleSystemParticle& particle, bool uses3DSize, float& tempSize) const;
- void CheckConsistency ();
-
- inline MinMaxCurve& GetCurve() { return m_Curve; }
- inline const MinMaxCurve& GetCurve() const { return m_Curve; }
-
- template<class TransferFunction>
- void Transfer (TransferFunction& transfer);
-
- void SetRange(const Vector2f& value) { m_Range = value; }
- const Vector2f& GetRange() const { return m_Range; }
- private:
- MinMaxCurve m_Curve;
- Vector2f m_Range;
- };
- NS_RRP_END
- #endif /* SizeByVelocityModule_h */
|