Changeset 6756 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 26, 2006, 1:55:40 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/environments/water.cc
r6695 r6756 180 180 4 * this->grid->height(i, j); 181 181 this->velocities[i][j] += dt * this->viscosity * this->viscosity * u / this->height; 182 this->grid->height(i, j) += dt * this->velocities[i][j] ;182 this->grid->height(i, j) += dt * this->velocities[i][j] + dt * this->cohesion * u / this->height;; 183 183 } 184 184 } … … 194 194 this->grid->height(i,this->grid->columns()-1) = this->grid->height(i, this->grid->columns()-2); 195 195 } 196 /* // advect197 196 /* 197 for(j = 1; j < this->grid->rows() - 1; j++) { 198 198 for(i = 1; i < this->grid->columns() - 1; i++) { 199 199 this->grid->height(i, j) += dt * this->velocities[i][j]; 200 200 } 201 201 }*/ 202 // bound203 // unsigned int w = this->grid->columns - 1;204 // for(i = 0; i < this->grid->columns; i++) {205 // _map[i][0].u[1] = _map[i][1 ].u[1];206 // _map[i][w].u[1] = _map[i][w-1].u[1];207 // _map[0][i].u[1] = _map[1 ][i].u[1];208 // _map[w][i].u[1] = _map[w-1][i].u[1];209 // }210 211 // diffusion212 for(j = 1; j < this->grid->rows() - 1; j++)213 {214 for(i = 1; i < this->grid->columns() - 1 ; i++)215 {216 u = this->grid->height(i+1, j) + this->grid->height(i-1, j) +217 this->grid->height(i, j+1) + this->grid->height(i, j-1) -218 4* this->grid->height(i, j);219 this->grid->height(i,j) += dt * this->cohesion * u / this->height;220 }221 }222 202 223 203 // calc normals -
trunk/src/world_entities/space_ships/space_ship.cc
r6753 r6756 27 27 #include "weapons/turret.h" 28 28 #include "weapons/cannon.h" 29 30 #include "particle_emitter.h" 31 #include "sprite_particles.h" 29 32 30 33 #include "factory.h" … … 210 213 211 214 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); 215 216 this->burstEmitter = new ParticleEmitter(Vector(-1,0,0), 1, 200, 0.0); 217 this->burstEmitter->setParent(this); 218 this->burstEmitter->setName("SpaceShip_Burst_emitter"); 219 220 221 this->burstSystem = new SpriteParticles(1000); 222 this->burstSystem->addEmitter(this->burstEmitter); 223 this->burstSystem->setName("SpaceShip_Burst_System"); 224 ((SpriteParticles*)this->burstSystem)->setMaterialTexture("maps/radial-trans-noise.png"); 225 this->burstSystem->setLifeSpan(1.0, .3); 226 this->burstSystem->setRadius(0.0, 2.0); 227 this->burstSystem->setRadius(0.05, 3.0); 228 this->burstSystem->setRadius(.5, .8); 229 this->burstSystem->setRadius(1.0, .8); 230 this->burstSystem->setColor(0.0, 1,0,0,.7); 231 this->burstSystem->setColor(0.2, .8,.8,0,.5); 232 this->burstSystem->setColor(0.5, .8,.8,.8,.8); 233 this->burstSystem->setColor(1.0, .8,.8,.8,.0); 234 212 235 } 213 236 … … 219 242 void SpaceShip::loadParams(const TiXmlElement* root) 220 243 { 221 WorldEntity::loadParams(root);244 Playable::loadParams(root); 222 245 } 223 246 … … 315 338 velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity; 316 339 velocity = (velocity.getNormalized())*travelSpeed; 340 this->burstEmitter->setEmissionRate(travelSpeed); 317 341 318 342 //orient the spaceship in direction of the mouse -
trunk/src/world_entities/space_ships/space_ship.h
r6737 r6756 10 10 #include "extendable.h" 11 11 12 12 // Forward Declaration 13 13 template<class T> class tList; 14 14 class Vector; 15 15 class Event; 16 class ParticleEmitter; 17 class ParticleSystem; 16 18 17 19 class SpaceShip : public Playable … … 83 85 int oldMask; 84 86 87 ParticleEmitter* burstEmitter; 88 ParticleSystem* burstSystem; 85 89 }; 86 90 -
trunk/src/world_entities/weapons/weapon.cc
r6736 r6756 86 86 this->soundSource = new SoundSource(this); //< Every Weapon has exacty one SoundSource. 87 87 this->emissionPoint.setParent(this); //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles 88 89 this->target = NULL; //< Nothing is Targeted by default. 88 90 89 91 this->projectile = CL_NULL; //< No Projectile Class is Connected to this weapon -
trunk/src/world_entities/weapons/weapon.h
r6736 r6756 125 125 inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); }; 126 126 127 inline void setTarget(PNode* target) { this->target = target; }; 128 127 129 // STATE CHANGES // 128 130 /** @param state the State to time @param duration the duration of the State */ … … 207 209 GLGuiBar* energyWidget; 208 210 211 PNode* target; //!< A target for targeting Weapons. 212 209 213 //////////// 210 214 // PHASES //
Note: See TracChangeset
for help on using the changeset viewer.