summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/ParticleSystem/Modules/ForceModule.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Graphics/ParticleSystem/Modules/ForceModule.h')
-rw-r--r--Runtime/Graphics/ParticleSystem/Modules/ForceModule.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Runtime/Graphics/ParticleSystem/Modules/ForceModule.h b/Runtime/Graphics/ParticleSystem/Modules/ForceModule.h
new file mode 100644
index 0000000..9ad54ec
--- /dev/null
+++ b/Runtime/Graphics/ParticleSystem/Modules/ForceModule.h
@@ -0,0 +1,36 @@
+#ifndef SHURIKENMODULEFORCE_H
+#define SHURIKENMODULEFORCE_H
+
+#include "ParticleSystemModule.h"
+#include "Runtime/Graphics/ParticleSystem/ParticleSystemCurves.h"
+#include "Runtime/Math/Random/rand.h"
+
+class ForceModule : public ParticleSystemModule
+{
+public:
+ DECLARE_MODULE (ForceModule)
+ ForceModule ();
+
+ void Update (const ParticleSystemReadOnlyState& roState, const ParticleSystemState& state, ParticleSystemParticles& ps, const size_t fromIndex, const size_t toIndex, float dt);
+ void UpdateProcedural (const ParticleSystemReadOnlyState& roState, const ParticleSystemState& state, ParticleSystemParticles& ps);
+ void CalculateProceduralBounds(MinMaxAABB& bounds, const Matrix4x4f& localToWorld, float maxLifeTime);
+ void CheckConsistency() {};
+
+ inline MinMaxCurve& GetXCurve() { return m_X; }
+ inline MinMaxCurve& GetYCurve() { return m_Y; }
+ inline MinMaxCurve& GetZCurve() { return m_Z; }
+ inline bool GetRandomizePerFrame() { return m_RandomizePerFrame; }
+
+ template<class TransferFunction>
+ void Transfer (TransferFunction& transfer);
+
+private:
+ MinMaxCurve m_X;
+ MinMaxCurve m_Y;
+ MinMaxCurve m_Z;
+ bool m_InWorldSpace;
+ bool m_RandomizePerFrame;
+ Rand m_Random;
+};
+
+#endif // SHURIKENMODULEFORCE_H