summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/ParticleSystem/Modules/ForceModule.h
blob: 9ad54ec67d21c14e42b04a03bde278ccf0f9c30e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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