ExternalForcesModule.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // ExternalForcesModule.h
  3. // libcocos2d Mac
  4. //
  5. // Created by 徐俊杰 on 2020/4/24.
  6. //
  7. #ifndef ExternalForcesModule_h
  8. #define ExternalForcesModule_h
  9. //#include "cocos2d.h"
  10. #include "rparticle/Macros/RParticleMacros.h"
  11. #include "rparticle/Modules/ParticleSystemModule.h"
  12. NS_RRP_BEGIN
  13. class ExternalForcesModule : public ParticleSystemModule
  14. {
  15. public:
  16. DECLARE_MODULE (ExternalForcesModule)
  17. ExternalForcesModule ();
  18. void Update (const ParticleSystemReadOnlyState& roState, const ParticleSystemState& state, ParticleSystemParticles& ps, const size_t fromIndex, const size_t toIndex, float dt);
  19. void CheckConsistency() {};
  20. static void AllocateAndCache(const ParticleSystemReadOnlyState& roState, ParticleSystemState& state);
  21. static void FreeCache(ParticleSystemState& state);
  22. template<class TransferFunction>
  23. void Transfer (TransferFunction& transfer);
  24. void SetMultiplier(float multiplier) { m_Multiplier = multiplier; }
  25. float GetMultiplier() const { return m_Multiplier; }
  26. private:
  27. float m_Multiplier;
  28. };
  29. NS_RRP_END
  30. #endif /* ExternalForcesModule_h */