Changeset 10037 in orxonox.OLD for branches/playability/src/world_entities/projectiles
- Timestamp:
- Dec 10, 2006, 1:51:44 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/projectiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10035 r10037 38 38 39 39 /* this->loadModel("models/projectiles/orx-rocket.obj", 0.5);*/ 40 this->loadModel("models/projectiles/swarm_projectile.obj"); 40 this->loadModel("models/projectiles/swarm_projectile.obj"); // no double rescale (see draw()) 41 41 this->loadExplosionSound("sound/explosions/explosion_4.wav"); 42 42 … … 51 51 this->emitter->setParent(this); 52 52 this->emitter->setSpread(M_PI, M_PI); 53 54 this->rotationSpeed = 100; 55 this->angle = 0; 53 56 } 54 57 … … 214 217 velocity *= maxVelocity / velocity.len(); // set speed to max 215 218 219 216 220 this->shiftCoor(velocity * time); 217 221 218 222 if(this->tickLifeCycle(time)) 219 223 this->deactivate(); 224 225 this->updateAngle(time); 220 226 } 221 227 … … 239 245 } 240 246 247 void SwarmProjectile::updateAngle(float time) 248 { 249 this->angle += this->rotationSpeed * time; 250 } 241 251 242 252 void SwarmProjectile::draw () const … … 247 257 float matrix[4][4]; 248 258 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 259 glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile 249 260 this->getAbsDir().matrix (matrix); 250 261 glMultMatrixf((float*)matrix); 251 //glScalef(2.0, 2.0, 2.0); 262 //glScalef(2.0, 2.0, 2.0); // no double rescale 252 263 this->getModel()->draw(); 253 264 -
branches/playability/src/world_entities/projectiles/swarm_projectile.h
r10035 r10037 51 51 Vector newDirection(Vector curDirection, Vector estTargetDir, float angle); 52 52 53 // spinning missle 54 void updateAngle(float time); 55 float rotationSpeed; 56 float angle; 53 57 }; 54 58
Note: See TracChangeset
for help on using the changeset viewer.