Changeset 4478 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 2, 2005, 5:01:50 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib/particles
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/particles/particle_emitter.cc
r4439 r4478 42 42 } 43 43 44 /** 45 \brief constructs and loads a ParticleEmitter from a XML-element 46 \param root the XML-element to load from 47 */ 44 48 ParticleEmitter::ParticleEmitter(const TiXmlElement* root) 45 49 { … … 63 67 } 64 68 69 /** 70 \brief loads a ParticleEmitter from a XML-element 71 \param root the XML-element to load from 72 */ 65 73 void ParticleEmitter::loadParams(const TiXmlElement* root) 66 74 { … … 109 117 110 118 /** 111 \param the type of emitter 119 \brief sets the type of emitter 120 \param type the type as a const char* 121 dot: EMITTER_DOT, plane: EMITTER_PLANE, cube: EMITTER_CUBE, sphere, EMITTER_SPHERE; 112 122 */ 113 123 void ParticleEmitter::setType(const char* type) … … 123 133 } 124 134 125 135 /** 136 \brief sets a new size to the emitter 137 */ 126 138 void ParticleEmitter::setSize(float emitterSize) 127 139 { … … 134 146 /** 135 147 \brief set the emission rate 136 \param sets the number of particles emitted per second148 \param emissionRate: sets the number of particles emitted per second 137 149 138 150 if you want to change the value of this variable during emission time (to make it more dynamic) … … 164 176 \brief sets the velocity of all particles emitted 165 177 \param velocity The starting velocity of the emitted particles 166 \param random A random starting velocity, the +- randomness of this option178 \param randomVelocity A random starting velocity, the +- randomness of this option 167 179 168 180 if you want to change the value of this variable during emission time (to make it more dynamic) … … 177 189 /** 178 190 \brief this set the time to life of a particle, after which it will die 179 \param the time to live in seconds 191 \param dt: the time to live in seconds 192 \param system: the system into which to emitt 180 193 181 194 if you want to change the value of this variable during emission time (to make it more dynamic) -
orxonox/trunk/src/lib/particles/particle_emitter.h
r4437 r4478 10 10 11 11 // FORWARD DEFINITION 12 struct Particle;13 12 class ParticleSystem; 14 13 class TiXmlElement; 15 14 16 15 //! The form of the Emitter to emit from 17 typedef enum EMITTER_TYPE { EMITTER_DOT = 1,18 EMITTER_PLANE = 2,19 EMITTER_SPHERE= 4,20 EMITTER_CUBE = 8};16 typedef enum EMITTER_TYPE { EMITTER_DOT = 1, 17 EMITTER_PLANE = 2, 18 EMITTER_SPHERE= 4, 19 EMITTER_CUBE = 8 }; 21 20 22 21 //! A class to handle an Emitter. … … 57 56 void debug(void); 58 57 58 59 59 private: 60 EMITTER_TYPE type;//!< The type of emitter this is61 float emitterSize;//!< The size of the emitter (not for EMITTER_DOT)62 Vector direction;//!< emition direction63 float angle;//!< max angle from the direction of the emitter64 float randomAngle;//!< random emission angle (angle +- angleRandom is the emitted angle.65 float emissionRate;//!< amount of particles per seconds emitted by emitter.66 float velocity;//!< the initial speed of a Particles.67 float randomVelocity;//!< the random variation from the initial Speed.60 EMITTER_TYPE type; //!< The type of emitter this is 61 float emitterSize; //!< The size of the emitter (not for EMITTER_DOT) 62 Vector direction; //!< emition direction 63 float angle; //!< max angle from the direction of the emitter 64 float randomAngle; //!< random emission angle (angle +- angleRandom is the emitted angle. 65 float emissionRate; //!< amount of particles per seconds emitted by emitter. 66 float velocity; //!< the initial speed of a Particles. 67 float randomVelocity; //!< the random variation from the initial Speed. 68 68 69 float saveTime;//!< The time that was missing by the last Tick (otherwise there would be no emission when framefate is too big).69 float saveTime; //!< The time that was missing by the last Tick (otherwise there would be no emission when framefate is too big). 70 70 }; 71 71 -
orxonox/trunk/src/lib/particles/particle_engine.cc
r4381 r4478 253 253 /** 254 254 \brief draws all the systems and their Particles. 255 \param dt the time passed in seconds (since the last Frame)256 255 */ 257 256 void ParticleEngine::draw() const -
orxonox/trunk/src/lib/particles/particle_engine.h
r4394 r4478 14 14 template<class T> class tList; 15 15 16 struct ParticleConnection 16 //! A ParticleConnection enables us to emitt from any emitter into any other particleSystem 17 typedef struct ParticleConnection 17 18 { 18 ParticleEmitter* emitter;//!< The emitter to emit system from.19 ParticleSystem* system; //!< The Particles emitted from emitter.19 ParticleEmitter* emitter; //!< The emitter to emit system from. 20 ParticleSystem* system; //!< The Particles emitted from emitter. 20 21 }; 21 22 -
orxonox/trunk/src/lib/particles/particle_system.cc
r4436 r4478 35 35 /** 36 36 \brief standard constructor 37 \param count the Count of particles in the System37 \param maxCount the Count of particles in the System 38 38 \param type The Type of the ParticleSystem 39 40 \todo this constructor is not jet implemented - do it41 39 */ 42 40 ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type) : PhysicsInterface(this) … … 54 52 this->glID = NULL; 55 53 this->setType(type, 1); 56 // this->setColor(1.0,1.0,1.0,1.0, .5,.5,.5,.5, .0,.0,.0,.0);57 54 ParticleEngine::getInstance()->addSystem(this); 58 55 } … … 88 85 89 86 /** 87 \param particleType the type of particles in this System 88 \param count how many particles (in PARTICLE_MULTI-mode) 90 89 \todo this will be different 91 90 */ … … 115 114 116 115 // setting properties 116 /** 117 \brief sets the material to an external material 118 \param material: the material to set this material to. 119 120 !! important if the extern material gets deleted it MUST be unregistered here or segfault !! 121 */ 117 122 void ParticleSystem::setMaterial(Material* material) 118 123 { … … 124 129 \param value a Value between zero and one 125 130 126 127 131 if you want to change the value of this variable during emission time (to make it more dynamic) 128 132 you may want to use the animation class … … 189 193 /** 190 194 \brief sets a key in the color-animation on a per-particle basis 191 \param lifeCycleTime the time (partilceLifeTime/particleAge) [0-1] 192 \param red red 193 \param green green 194 \param blue blue 195 \param lifeCycleTime: the time (partilceLifeTime/particleAge) [0-1] 196 \param red: red 197 \param green: green 198 \param blue: blue 199 \param alpha: alpha 195 200 */ 196 201 void ParticleSystem::setColor(float lifeCycleTime, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) … … 270 275 \brief applies some force to a Particle. 271 276 \param field the Field to apply. 272 \param dt The time over which the field gets applied273 277 */ 274 278 void ParticleSystem::applyField(Field* field) … … 285 289 /** 286 290 \brief draws all the Particles of this System 287 \param the time passed in seconds (since the last draw)288 291 289 292 The Cases in this Function all do the same: -
orxonox/trunk/src/lib/particles/particle_system.h
r4436 r4478 15 15 #include "quick_animation.h" 16 16 17 #define PARTICLE_DOT_MASK 0x00000118 #define PARTICLE_SPARK_MASK 0x00001019 #define PARTICLE_SPRITE_MASK 0x00010020 #define PARTICLE_MODEL_MASK 0x00100021 #define PARTICLE_WORDL_ENTITY_MASK 0x01000022 #define PARTICLE_MULTI_MASK 0x10000017 #define PARTICLE_DOT_MASK 0x000001 //!< A Mask if the Particles should be displayed as DOTs 18 #define PARTICLE_SPARK_MASK 0x000010 //!< A Mask if the Particles should be displayed as SPARKs 19 #define PARTICLE_SPRITE_MASK 0x000100 //!< A Mask if the Particles should be displayed as SPRITESs 20 #define PARTICLE_MODEL_MASK 0x001000 //!< A Mask if the Particles should be displayed as MODELSs 21 #define PARTICLE_WORDL_ENTITY_MASK 0x010000 //!< A Mask if the Particles should be displayed as WORLD_ENTITIEs 22 #define PARTICLE_MULTI_MASK 0x100000 //!< A Mask if they are Multi-partilces 23 23 24 24 //! An enumerator for the different types of particles. 25 typedef enum PARTICLE_TYPE { PARTICLE_DOT =PARTICLE_DOT_MASK,26 PARTICLE_SPARK =PARTICLE_SPARK_MASK,27 PARTICLE_SPRITE =PARTICLE_SPRITE_MASK,28 PARTICLE_MULTI_SPRITE =PARTICLE_SPRITE_MASK | PARTICLE_MULTI_MASK,29 PARTICLE_MODEL =PARTICLE_MODEL_MASK,30 PARTICLE_MULTI_MODE = PARTICLE_MODEL_MASK | PARTICLE_MULTI_MASK};25 typedef enum PARTICLE_TYPE { PARTICLE_DOT = PARTICLE_DOT_MASK, 26 PARTICLE_SPARK = PARTICLE_SPARK_MASK, 27 PARTICLE_SPRITE = PARTICLE_SPRITE_MASK, 28 PARTICLE_MULTI_SPRITE = PARTICLE_SPRITE_MASK | PARTICLE_MULTI_MASK, 29 PARTICLE_MODEL = PARTICLE_MODEL_MASK, 30 PARTICLE_MULTI_MODE = PARTICLE_MODEL_MASK | PARTICLE_MULTI_MASK }; 31 31 32 #define PARTICLE_DEFAULT_MAX_COUNT 200 //!< adefault count of particles in the system.32 #define PARTICLE_DEFAULT_MAX_COUNT 200 //!< A default count of particles in the system. 33 33 #define PARTICLE_DEFAULT_TYPE PARTICLE_SPRITE //!< A default type of the system. 34 34 … … 49 49 Quaternion rotation; //!< The current rotation of this particle. 50 50 float mass; //!< The mass of this particle. 51 float massRand; 51 float massRand; //!< A random mass 52 52 float radius; //!< The current size of this particle. 53 float radiusRand; 53 float radiusRand; //!< a random Radius 54 54 55 55 GLfloat color [4]; //!< A Color for the particles. 56 57 PARTICLE_TYPE type;58 56 59 57 Particle* next; //!< pointer to the next particle in the List. (NULL if no preceding one) … … 98 96 99 97 virtual void applyField(Field* field); 98 /** \brief this is an empty function, because the Physics are implemented in tick \param dt: useless here */ 100 99 virtual void tickPhys(float dt) {}; 101 100 … … 108 107 109 108 private: 110 char* name; //the Name of the Particle System109 char* name; //!< the Name of the Particle System 111 110 112 float conserve; //!< How much energy gets conserved to the next Tick.113 float lifeSpan; //!< Initial lifetime of a Particle.114 float randomLifeSpan; //!< A random value for the Lifespan (around the initial lifetime)115 float initialMass; //!< The initial Mass of the Particle116 float randomInitialMass; //!< The random initial Mass of the Particle117 float inheritSpeed; //!< How much speed the particle inherits from the Emitters speed \todo move this to the emitter111 float conserve; //!< How much energy gets conserved to the next Tick. 112 float lifeSpan; //!< Initial lifetime of a Particle. 113 float randomLifeSpan; //!< A random value for the Lifespan (around the initial lifetime) 114 float initialMass; //!< The initial Mass of the Particle 115 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 emitter 118 117 119 118 // particles 120 int maxCount;//!< The maximum count of Particles.121 int count;//!< The current count of Particles.122 PARTICLE_TYPE particleType;//!< A type for all the Particles123 Material* material;//!< A Material for all the Particles.124 Particle* particles;//!< A list of particles of this System.125 Particle* deadList;//!< A list of dead Particles in the System.119 int maxCount; //!< The maximum count of Particles. 120 int count; //!< The current count of Particles. 121 PARTICLE_TYPE particleType; //!< A type for all the Particles 122 Material* material; //!< A Material for all the Particles. 123 Particle* particles; //!< A list of particles of this System. 124 Particle* deadList; //!< A list of dead Particles in the System. 126 125 127 GLuint* glID;//!< A List of different gl-List-ID's128 GLuint dialectCount;//!< How many different types of particles are there in the Particle System126 GLuint* glID; //!< A List of different gl-List-ID's 127 GLuint dialectCount; //!< How many different types of particles are there in the Particle System 129 128 130 129 // per particle attributes 131 QuickAnimation radiusAnim; 132 QuickAnimation randRadiusAnim; 133 QuickAnimation massAnim; 134 QuickAnimation randMassAnim; 135 QuickAnimation colorAnim[4]; 130 QuickAnimation radiusAnim; //!< Animation of the radius 131 QuickAnimation randRadiusAnim; //!< Animation of the random Value of the radius 132 QuickAnimation massAnim; //!< Animation of the mass 133 QuickAnimation randMassAnim; //!< Animation of the random Mass 134 QuickAnimation colorAnim[4]; //!< Animation of the 4 colors (r,g,b,a) 136 135 }; 137 136
Note: See TracChangeset
for help on using the changeset viewer.