summaryrefslogtreecommitdiff
path: root/Runtime/Graphics/ParticleSystem/Modules/VelocityModule.h
blob: bf76f28c498d6972e56d89965f153e07fc89db5d (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 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