1 /* 2 * Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com> 3 * Copyright 2014 Haiku, Inc. All rights reserved. 4 * 5 * Distributed under the terms of the MIT license. 6 * 7 * Authors: 8 * Tri-Edge AI 9 * John Scipione, jscipione@gmail.com 10 */ 11 #ifndef PARTICLE_H 12 #define PARTICLE_H 13 14 15 #include <ObjectList.h> 16 #include <GLView.h> 17 18 19 class Particle { 20 public: 21 static BObjectList<Particle>* list; 22 23 static void Initialize(int32 size, int32 shade); 24 static void AddParticles(int32 size, int32 shade); 25 static void RemoveParticles(int32 size, int32 shade); 26 static void ColorParticles(int32 size, int32 shade); 27 static void Terminate(); 28 static void Tick(); 29 30 float x; 31 float y; 32 float z; 33 float r; 34 35 float vx; 36 float vy; 37 float vz; 38 float vr; 39 40 float red; 41 float green; 42 float blue; 43 44 private: 45 void _Logic(); 46 void _Render() const; 47 48 static void _FillParticle(Particle* p, int32 size, 49 int32 shade); 50 static void _ColorParticle(Particle* p, int32 size, 51 int32 shade); 52 }; 53 54 55 #endif // PARTICLE_H 56