summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/ParticleSystem/Modules/VelocityModule.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Graphics/ParticleSystem/Modules/VelocityModule.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/Graphics/ParticleSystem/Modules/VelocityModule.h')
-rw-r--r--Runtime/Graphics/ParticleSystem/Modules/VelocityModule.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Runtime/Graphics/ParticleSystem/Modules/VelocityModule.h b/Runtime/Graphics/ParticleSystem/Modules/VelocityModule.h
new file mode 100644
index 0000000..bf76f28
--- /dev/null
+++ b/Runtime/Graphics/ParticleSystem/Modules/VelocityModule.h
@@ -0,0 +1,36 @@
+#ifndef SHURIKENMODULEVELOCITY_H
+#define SHURIKENMODULEVELOCITY_H
+
+#include "ParticleSystemModule.h"
+#include "Runtime/Graphics/ParticleSystem/ParticleSystemCurves.h"
+#include "Runtime/Math/Random/rand.h"
+
+class VelocityModule : public ParticleSystemModule
+{
+public:
+ DECLARE_MODULE (VelocityModule)
+ VelocityModule ();
+
+ void Update (const ParticleSystemReadOnlyState& roState, const ParticleSystemState& state, ParticleSystemParticles& ps, const size_t fromIndex, const size_t toIndex);
+ 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; };
+
+ template<class TransferFunction>
+ void Transfer (TransferFunction& transfer);
+
+private:
+ MinMaxCurve m_X;
+ MinMaxCurve m_Y;
+ MinMaxCurve m_Z;
+ bool m_InWorldSpace;
+
+ Rand m_Random;
+};
+
+
+#endif // SHURIKENMODULEVELOCITY_H