| 6 | |
| 7 | |
| 8 | class Particle(object): |
| 9 | def __init__(self): |
| 10 | super(Particle, self).__init__() |
| 11 | self.id = 0 |
| 12 | self.age = 0 |
| 13 | self.state = 0 |
| 14 | self.mass = 1.0 |
| 15 | self.velocity = om2.MVector() |
| 16 | |
| 17 | self.gl = mscreen.drawPoint() |
| 18 | self.color = mscreen.COLOR_DARKCYAN |
| 19 | self.size = 5 |
| 20 | |
| 21 | def destroy(self): |
| 22 | mscreen.erase(self.gl) |
| 23 | |
| 24 | @property |
| 25 | def position(self): |
| 26 | return self.gl.transform.translation(om2.MSpace.kWorld) |
| 27 | |
| 28 | @position.setter |
| 29 | def position(self, value): |
| 30 | self.gl.transform.setTranslation(value, om2.MSpace.kWorld) |
| 31 | |
| 32 | @property |
| 33 | def size(self): |
| 34 | return self.gl.size |
| 35 | |
| 36 | @size.setter |
| 37 | def size(self, value): |
| 38 | self.gl.size = value |
| 39 | |
| 40 | @property |
| 41 | def color(self): |
| 42 | return self.gl.color |
| 43 | |
| 44 | @color.setter |
| 45 | def color(self, value): |
| 46 | self.gl.color = value |
| 47 | |
| 48 | |
| 49 | class Emitter(object): |