Changeset 3930 in orxonox.OLD for orxonox/branches/particleEngine/src/lib
- Timestamp:
- Apr 22, 2005, 11:23:48 AM (20 years ago)
- Location:
- orxonox/branches/particleEngine/src/lib/graphics/particles
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc
r3929 r3930 29 29 this->setClassName ("ParticleEmitter"); 30 30 this->direction = direction; 31 this-> angle = angle;31 this->setSpread(angle); 32 32 this->emissionRate = emissionRate; 33 33 this->velocity = velocity; 34 this->timeToLive = ttl;35 34 } 36 35 … … 64 63 \brief set the angle of the emitter 65 64 \param angle around the direction in which there are particles to be emitted 65 \param random A random spread-angle, the +- randomness of this option 66 66 67 67 if you want to change the value of this variable during emission time (to make it more dynamic) 68 you will haveto use the animation class68 you may want to use the animation class 69 69 */ 70 void ParticleEmitter::set Angle(float angle)70 void ParticleEmitter::setSpread(float angle, float random) 71 71 {} 72 72 … … 75 75 \brief set the emission rate 76 76 \param sets the number of particles emitted per second 77 \param random A random emissionRate, the +- randomness of this option 77 78 78 79 if you want to change the value of this variable during emission time (to make it more dynamic) 79 you will haveto use the animation class80 you may want to use the animation class 80 81 */ 81 void ParticleEmitter::setEmissionRate(float emissionRate )82 void ParticleEmitter::setEmissionRate(float emissionRate, float random) 82 83 {} 83 84 … … 85 86 /** 86 87 \brief sets the velocity of all particles emitted 87 \param velocity of the emitted particles 88 \param velocity The starting velocity of the emitted particles 89 \param random A random starting velocity, the +- randomness of this option 88 90 89 91 if you want to change the value of this variable during emission time (to make it more dynamic) 90 you will haveto use the animation class92 you may want to use the animation class 91 93 */ 92 void ParticleEmitter::setVelocity(float velocity )94 void ParticleEmitter::setVelocity(float velocity, float random) 93 95 {} 94 96 … … 98 100 99 101 if you want to change the value of this variable during emission time (to make it more dynamic) 100 you will haveto use the animation class102 you may want to use the animation class 101 103 */ 102 void ParticleEmitter::setTTL(float ttl)103 {}104 105 104 106 105 /** -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.h
r3929 r3930 27 27 28 28 /* controlling the behavour: these can be used as Animation interfaces */ 29 void setAngle(float angle); 30 void setEmissionRate(float emissionRate); 31 void setVelocity(float velocity); 32 void setTTL(float ttl); 29 void setSpread(float angle, float random = 0.0); 30 void setEmissionRate(float emissionRate, float random = 0.0); 31 void setVelocity(float velocity, float random = 0.0); 33 32 34 33 /* some functions needed for internal use */ … … 40 39 float emissionRate; //!< amount of particles per seconds emitted by emiter 41 40 float velocity; //!< the contant speed a particle gets if been emitted 42 float timeToLive; //!< this is the global time to live (ttl) definition43 41 }; 44 42 -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.cc
r3924 r3930 18 18 #include "particle_engine.h" 19 19 20 #include "list.h" 21 20 22 using namespace std; 21 22 23 23 24 /** … … 28 29 this->setClassName ("ParticleEngine"); 29 30 31 this->partSysList = new tList<ParticleSystem>; 30 32 } 31 33 … … 51 53 ParticleEngine::~ParticleEngine () 52 54 { 55 delete this->partSysList; 56 57 53 58 ParticleEngine::singletonRef = NULL; 54 55 59 } -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.h
r3926 r3930 28 28 29 29 tList<ParticleSystem>* partSysList; 30 31 30 }; 32 31 -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc
r3925 r3930 18 18 #include "particle_system.h" 19 19 20 #include "particle_emitter.h" 21 #include "particle_engine.h" 22 20 23 using namespace std; 21 24 … … 23 26 /** 24 27 \brief standard constructor 28 \param count the Count of particles in the System 29 \param type The Type of the ParticleSystem 30 25 31 \todo this constructor is not jet implemented - do it 26 32 */ 27 ParticleSystem::ParticleSystem ( )33 ParticleSystem::ParticleSystem (unsigned int count, PARTICLE_TYPE type) 28 34 { 29 35 this->setClassName ("ParticleSystem"); 36 37 this->particleType = type; 30 38 } 31 39 -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.h
r3926 r3930 9 9 #include "base_object.h" 10 10 #include "vector.h" 11 12 //! An enumerator for the different types of particles. 13 typedef enum PARTICLE_TYPE {PARTICLE_DOT, 14 PARTICLE_SPRITE, 15 PARTICLE_OBJECT, 16 PARTICLE_OBJECT_ARRAY, 17 PARTICLE_PRIMITIVE}; 18 19 #define PARTICLE_DEFAULT_COUNT 200 //!< a default count of particles in the system. 20 #define PARTICLE_DEFAULT_TYPE PARTICLE_SPRITE //!< A default type of the system. 21 11 22 // FORWARD DEFINITION 12 13 23 class Material; 14 class Vector;24 class ParticleEmitter; 15 25 16 26 … … 18 28 typedef struct Particle 19 29 { 20 float timeToLive; 21 Vector position; 22 Quaternion rotation; 23 Material* material; 30 float timeToLive; //!< The time this particle lives from NOW on. 31 Vector position; //!< The current position of this particle. 32 Vector velocity; //!< The current velocity of this particle. 33 Quaternion rotation; //!< The current rotation of this particle. 34 35 // Particle* next; //!< pointer to the next particle in the List. (NULL if no preceding one) 24 36 }; 25 37 … … 28 40 29 41 public: 30 ParticleSystem( );42 ParticleSystem(unsigned int particleCount = PARTICLE_DEFAULT_COUNT, PARTICLE_TYPE type = PARTICLE_DEFAULT_TYPE); 31 43 virtual ~ParticleSystem(); 32 44 45 void setMaterial(Material* material); 46 void addEmitter(ParticleEmitter* emitter); 33 47 34 48 private: 49 int particleCount; //!< the count of Particles for this ParticleSystem. 50 PARTICLE_TYPE particleType;//!< A type for the Particles 51 Particle* particles; //!< A list of particles of this System. 52 Material* material; //!< A Material for all the Particles. 35 53 36 int particleCount; 37 38 Particle* particles; 54 ParticleEmitter* emitter; //!< An emitter for this particleSystem. 39 55 }; 40 56
Note: See TracChangeset
for help on using the changeset viewer.