RotationByVelocityModule.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // RotationByVelocityModule.h
  3. // libcocos2d Mac
  4. //
  5. // Created by 徐俊杰 on 2020/4/24.
  6. //
  7. #ifndef RotationByVelocityModule_h
  8. #define RotationByVelocityModule_h
  9. //#include "cocos2d.h"
  10. #include "rparticle/Macros/RParticleMacros.h"
  11. #include "rparticle/Modules/ParticleSystemModule.h"
  12. #include "rparticle/ParticleSystemCurves.h"
  13. //#include "Runtime/Math/Vector2.h"
  14. NS_RRP_BEGIN
  15. class RotationBySpeedModule : public ParticleSystemModule
  16. {
  17. public:
  18. DECLARE_MODULE (RotationBySpeedModule)
  19. RotationBySpeedModule ();
  20. void Update (const ParticleSystemReadOnlyState& roState, const ParticleSystemState& state, ParticleSystemParticles& ps, const size_t fromIndex, const size_t toIndex);
  21. void CheckConsistency ();
  22. inline MinMaxCurve& GetCurve() { return m_Curve; }
  23. inline const MinMaxCurve& GetCurve() const { return m_Curve; }
  24. template<class TransferFunction>
  25. void Transfer (TransferFunction& transfer);
  26. void SetRange(const Vector2f& value) { m_Range = value; }
  27. const Vector2f& GetRange() const { return m_Range; }
  28. private:
  29. MinMaxCurve m_Curve;
  30. Vector2f m_Range;
  31. };
  32. NS_RRP_END
  33. #endif /* RotationByVelocityModule_h */