SizeModule.h 967 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // SizeModule.h
  3. // cocos2d_libs
  4. //
  5. // Created by 徐俊杰 on 2020/4/24.
  6. //
  7. #ifndef SizeModule_h
  8. #define SizeModule_h
  9. //#include "cocos2d.h"
  10. #include "rparticle/Macros/RParticleMacros.h"
  11. #include "rparticle/Modules/ParticleSystemModule.h"
  12. #include "rparticle/ParticleSystemCurves.h"
  13. NS_RRP_BEGIN
  14. class SizeModule : public ParticleSystemModule
  15. {
  16. public:
  17. DECLARE_MODULE (SizeModule)
  18. SizeModule();
  19. void Update (const ParticleSystemParticles& ps, float* tempSize, size_t fromIndex, size_t toIndex);
  20. void UpdateSingle(const ParticleSystemParticle& particle, bool uses3DSize, float& tempSize) const;
  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. private:
  27. MinMaxCurve m_Curve;
  28. };
  29. NS_RRP_END
  30. #endif /* SizeModule_h */