Changeset 4274 in orxonox.OLD for orxonox/branches/physics/src
- Timestamp:
- May 22, 2005, 10:21:00 PM (20 years ago)
- Location:
- orxonox/branches/physics/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/lib/coord/p_node.h
r4178 r4274 73 73 /** \returns the Velocity of the Node */ 74 74 inline const Vector& getVelocity() const {return this->velocity;} 75 /** \returns the last calculated coordinate */ 76 inline Vector getLastAbsCoor(void) {return this->lastAbsCoordinate;} 75 77 76 78 void addChild (PNode* pNode, int parentingMode = DEFAULT_MODE); -
orxonox/branches/physics/src/lib/graphics/particles/particle_emitter.cc
r4178 r4274 31 31 { 32 32 this->setClassName ("ParticleEmitter"); 33 34 this->type = EMITTER_DOT; 35 this->emitterSize = 1.0; 33 36 this->direction = direction; 34 37 this->setSpread(angle); … … 50 53 { 51 54 ParticleEngine::getInstance()->removeEmitter(this); 52 53 55 } 54 56 … … 69 71 70 72 /* these are Animation interfaces: so you can change spec values as you want */ 73 74 /** 75 \param type the new Type of this emitter 76 */ 77 void ParticleEmitter::setType(EMITTER_TYPE type) 78 { 79 this->type = type; 80 } 81 82 void ParticleEmitter::setSize(float emitterSize) 83 { 84 this->emitterSize = emitterSize; 85 } 71 86 72 87 /** … … 140 155 // this should spread the Particles evenly. if the Emitter is moved around quickly 141 156 Vector equalSpread = this->getVelocity() * random()/RAND_MAX * dt; 157 Vector extension; // the Vector for different fields. 142 158 143 system->addParticle(this->getAbsCoor() - equalSpread, velocityV); 159 if (this->type & 2) 160 { 161 extension = Vector(this->emitterSize * ((float)rand()/RAND_MAX -.5), 0, this->emitterSize * ((float)rand()/RAND_MAX - .5)); 162 extension = this->getAbsDir().apply(extension); 163 } 164 else if (this->type & 8) 165 { 166 extension = Vector((float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5) * this->emitterSize; 167 } 168 169 system->addParticle(this->getAbsCoor() + extension - equalSpread, velocityV); 170 144 171 } 145 172 } -
orxonox/branches/physics/src/lib/graphics/particles/particle_emitter.h
r4178 r4274 13 13 class ParticleSystem; 14 14 15 typedef enum EMITTER_TYPE {EMITTER_DOT, 16 EMITTER_PLANE, 17 EMITTER_SPHERE, 18 EMITTER_CUBE}; 15 //! The form of the Emitter to emit from 16 typedef enum EMITTER_TYPE {EMITTER_DOT = 1, 17 EMITTER_PLANE = 2, 18 EMITTER_SPHERE= 4, 19 EMITTER_CUBE = 8}; 19 20 20 21 //! A default singleton class. … … 32 33 33 34 /* controlling the behavour: these can be used as Animation interfaces */ 35 void setType(EMITTER_TYPE type); 36 void setSize(float emitterSize); 34 37 void setEmissionRate(float emissionRate); 35 38 void setSpread(float angle, float randomAngle = 0.0); … … 39 42 40 43 private: 44 EMITTER_TYPE type; //!< The type of emitter this is 45 float emitterSize; //!< The size of the emitter (not for EMITTER_DOT) 41 46 Vector direction; //!< emition direction 42 47 float angle; //!< max angle from the direction of the emitter -
orxonox/branches/physics/src/story_entities/world.cc
r4223 r4274 499 499 // Creating a Test Particle Emitter 500 500 ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), M_PI_4, 400, .5); 501 emitter->setType(EMITTER_CUBE); 502 emitter->setSize(20); 501 503 emitter->setParent(this->localPlayer); 502 504 emitter->setRelCoor(Vector(0,-3,0));
Note: See TracChangeset
for help on using the changeset viewer.