Changeset 10132 in orxonox.OLD for branches/playability/src/world_entities/projectiles
- Timestamp:
- Dec 20, 2006, 5:36:18 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/projectiles
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/mbolt.cc
r10117 r10132 78 78 this->buildObbTree(4); 79 79 80 this->trail = new Trail(6, 4,.1, this);80 this->trail = new Trail(6, 4, .1, this); 81 81 //this->trail->setParent( this); 82 82 this->trail->setTexture( "maps/laser.png"); … … 124 124 this->setHealth(0); 125 125 126 127 126 this->emitter->setSpread(0); 128 127 this->emitter->setEmissionRate(10.0); … … 150 149 this->hitEntity = entity; 151 150 dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage()); 152 this->destroy(this); 151 //this->destroy(this); 152 this->deactivate(); 153 153 154 154 return; 155 155 156 if( entity == NULL || dynamic_cast<SpaceShip*>(entity) == NULL) 157 return; 158 159 dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage()); 156 //dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage()); 160 157 //entity->destroy(this); 161 158 //this->deactivate(); -
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10117 r10132 55 55 this->emitter->setSpread(M_PI, M_PI); 56 56 57 this->turningSpeed = 30;57 this->turningSpeed = 10; 58 58 59 59 this->physDamage = 200; … … 164 164 // printf("turning angle: %f\ntemp: %f\n", angle, tmp); 165 165 166 if( fabsf(angle) > fabsf(tmp) ) { angle = tmp; } 166 if( fabsf(angle) > fabsf(tmp) ) 167 angle = tmp; 168 else 169 angle *= tmp/fabsf(tmp); 167 170 168 171 Vector d = curDirection.cross(estTargetDir).cross(curDirection); 169 172 d.normalize(); 170 if( unlikely( angle== 90)) { return d; } //avoid complication173 if( unlikely( fabsf(angle) == 90)) { return d; } //avoid complication 171 174 172 175 Vector newDir = curDirection + d * curDirection.len() * tan (angle); … … 221 224 // else 222 225 // tti = (this->getAbsCoor() - this->target->getAbsCoor()).len() / sqrt ( projectileVelocity * projectileVelocity + targetVelocity * targetVelocity); 223 Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()) ;226 Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized(); 224 227 // estTargetDir.slerpTo(this->velocity, 1); 225 228 this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time ); … … 275 278 glPushMatrix(); 276 279 277 Vector tmpDir = this->curDir *.7 + this->lastDir * .3; 280 Vector tmpDir = this->curDir; // *.7 + this->lastDir * .3; 281 tmpDir.slerpTo(this->lastDir, .4); 278 282 279 283 float matrix[4][4]; -
branches/playability/src/world_entities/projectiles/swarm_projectile.h
r10087 r10132 50 50 Vector curDir; 51 51 Vector lastDir; 52 Vector oldPos; 52 53 53 54 WorldEntity* hitEntity; // FIXME TEMPORARY
Note: See TracChangeset
for help on using the changeset viewer.