Changeset 4493 in orxonox.OLD for orxonox/trunk/src/lib/particles/particle_system.h
- Timestamp:
- Jun 3, 2005, 2:10:47 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/particles/particle_system.h
r4478 r4493 7 7 #define _PARTICLE_SYSTEM_H 8 8 9 #include " base_object.h"9 #include "world_entity.h" 10 10 #include "physics_interface.h" 11 11 … … 41 41 typedef struct Particle 42 42 { 43 float lifeTime;//!< The time this particle has to live.44 float lifeCycle;//!< The fraction of time passed. (in percentage of its lifeTime)43 float lifeTime; //!< The time this particle has to live. 44 float lifeCycle; //!< The fraction of time passed. (in percentage of its lifeTime) 45 45 46 Vector position; //!< The current position of this particle. 47 Vector velocity; //!< The current velocity of this particle. 48 Vector extForce; //!< The external Force that influences this Particle. 49 Quaternion rotation; //!< The current rotation of this particle. 50 float mass; //!< The mass of this particle. 51 float massRand; //!< A random mass 52 float radius; //!< The current size of this particle. 53 float radiusRand; //!< a random Radius 46 Vector position; //!< The current position of this particle. 47 Vector velocity; //!< The current velocity of this particle. 48 Vector extForce; //!< The external Force that influences this Particle. 49 Quaternion rotation; //!< The current rotation of this particle. 50 float mass; //!< The mass of this particle. 51 float massRand; //!< A random mass 52 float radius; //!< The current size of this particle. 53 float radiusRand; //!< a random Radius 54 GLfloat color [4]; //!< A Color for the particles. 54 55 55 GLfloat color [4]; //!< A Color for the particles. 56 57 Particle* next; //!< pointer to the next particle in the List. (NULL if no preceding one) 56 Particle* next; //!< pointer to the next particle in the List. (NULL if no preceding one) 58 57 }; 59 58 60 59 //! A class to handle ParticleSystems 61 class ParticleSystem : public PhysicsInterface { 62 friend class ParticleEmitter; 60 class ParticleSystem : public WorldEntity, public PhysicsInterface { 63 61 64 62 public: … … 69 67 void setType(PARTICLE_TYPE particleType, int count = 0); 70 68 void setMaterial(Material* material); 71 void setInheritSpeed(float value);72 69 void setLifeSpan(float lifeSpan, float randomLifeSpan = 0.0); 73 70 void setConserve(float conserve); … … 82 79 /** \returns the Material that lies on this particles */ 83 80 inline const Material* getMaterial(void) const { return this->material; }; 84 /** \returns the inherit-speed-factor */85 inline float getInheritSpeed(void) const { return this->inheritSpeed; };86 81 /** \returns the lifespan of the particles */ 87 82 inline float getLifeSpan(void) const { return this->lifeSpan; }; … … 101 96 void addParticle(const Vector& position, const Vector& velocity, unsigned int data = 0); 102 97 103 v oid tick(float dt);104 v oid draw(void) const;98 virtual void tick(float dt); 99 virtual void draw(void) const; 105 100 106 101 void debug(void); 107 102 108 103 private: 109 char* name; //!< the Name of the Particle System110 111 104 float conserve; //!< How much energy gets conserved to the next Tick. 112 105 float lifeSpan; //!< Initial lifetime of a Particle. … … 114 107 float initialMass; //!< The initial Mass of the Particle 115 108 float randomInitialMass; //!< The random initial Mass of the Particle 116 float inheritSpeed; //!< How much speed the particle inherits from the Emitters speed \todo move this to the emitter117 109 118 // particles119 110 int maxCount; //!< The maximum count of Particles. 120 111 int count; //!< The current count of Particles. … … 128 119 129 120 // per particle attributes 130 QuickAnimation radiusAnim;//!< Animation of the radius131 QuickAnimation randRadiusAnim;//!< Animation of the random Value of the radius132 QuickAnimation massAnim;//!< Animation of the mass133 QuickAnimation randMassAnim;//!< Animation of the random Mass134 QuickAnimation colorAnim[4];//!< Animation of the 4 colors (r,g,b,a)121 QuickAnimation radiusAnim; //!< Animation of the radius 122 QuickAnimation randRadiusAnim; //!< Animation of the random Value of the radius 123 QuickAnimation massAnim; //!< Animation of the mass 124 QuickAnimation randMassAnim; //!< Animation of the random Mass 125 QuickAnimation colorAnim[4]; //!< Animation of the 4 colors (r,g,b,a) 135 126 }; 136 127
Note: See TracChangeset
for help on using the changeset viewer.