SizeByVelocityModule.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // SizeByVelocityModule.h
  3. // cocos2d_libs
  4. //
  5. // Created by 徐俊杰 on 2020/4/24.
  6. //
  7. #ifndef SizeByVelocityModule_h
  8. #define SizeByVelocityModule_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 SizeBySpeedModule : public ParticleSystemModule
  16. {
  17. public:
  18. DECLARE_MODULE (SizeBySpeedModule)
  19. SizeBySpeedModule ();
  20. void Update (const ParticleSystemReadOnlyState& roState, const ParticleSystemParticles& ps, float* tempSize, size_t fromIndex, size_t toIndex);
  21. void UpdateSingle(const ParticleSystemReadOnlyState& roState, const ParticleSystemParticle& particle, bool uses3DSize, float& tempSize) const;
  22. void CheckConsistency ();
  23. inline MinMaxCurve& GetCurve() { return m_Curve; }
  24. inline const MinMaxCurve& GetCurve() const { return m_Curve; }
  25. template<class TransferFunction>
  26. void Transfer (TransferFunction& transfer);
  27. void SetRange(const Vector2f& value) { m_Range = value; }
  28. const Vector2f& GetRange() const { return m_Range; }
  29. private:
  30. MinMaxCurve m_Curve;
  31. Vector2f m_Range;
  32. };
  33. NS_RRP_END
  34. #endif /* SizeByVelocityModule_h */