particle_base.h 732 Bytes
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
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
#ifndef PARTBASE_H
#define PARTBASE_H

#include "Geometry/vector_gen.h"

namespace CGoGN
{

namespace Algo
{

namespace MovingObjects
{

typedef Geom::Vec3f VEC3;

/* A particle base defines a position with a displacement function */

class ParticleBase
{
	public :
		VEC3 m_position;

		ParticleBase()
		{
			m_position.zero();
		}

		ParticleBase(VEC3 position)
		{
			m_position = position;
		}

Thomas's avatar
Thomas committed
34
35
36
37
38
		virtual unsigned int getState()
		{
			return 0;
		}
		
Pierre Kraemer's avatar
Pierre Kraemer committed
39
40
41
		/**
		* @param newPosition new position to reach
		*/
Thomas's avatar
Thomas committed
42
		virtual bool move(VEC3 position)
Pierre Kraemer's avatar
Pierre Kraemer committed
43
44
45
46
47
		{
			m_position = position;
			return true;
		}

Thomas's avatar
Thomas committed
48
49
50
51
52
		virtual unsigned int getState()
		{
			return 0;
		}

Pierre Kraemer's avatar
Pierre Kraemer committed
53
54
55
56
57
58
59
60
61
62
63
64
		VEC3 getPosition() { return m_position; }
};

//namespace
}

}

}


#endif