Changeset 10104 in orxonox.OLD for branches/playability/src/world_entities/projectiles/swarm_projectile.cc
- Timestamp:
- Dec 19, 2006, 8:00:52 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10095 r10104 3 3 orxonox - the future of 3D-vertical-scrollers 4 4 5 Copyright (C) 2004 orx5 Copyright (C) 2004-2006 orx 6 6 7 7 This program is free software; you can redistribute it and/or modify … … 11 11 12 12 ### File Specific 13 main-programmer: Silvan Nellen13 main-programmer: Marc Schaerrer, Nicolas Schlumberger 14 14 co-programmer: 15 15 … … 58 58 59 59 this->physDamage = 200; 60 this->elecDamage = 0; 60 61 61 62 this->trail = new Trail(2.5,4,.2, this); … … 135 136 this->destroy( entity ); 136 137 this->hitEntity = entity; 137 dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),0); 138 dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage()); 139 this->destroy(NULL); 138 140 } 139 141 … … 219 221 // else 220 222 // tti = (this->getAbsCoor() - this->target->getAbsCoor()).len() / sqrt ( projectileVelocity * projectileVelocity + targetVelocity * targetVelocity); 221 Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized() * maxVelocity; 223 Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()); 224 // estTargetDir.slerpTo(this->velocity, 1); 222 225 this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time ); 223 226 } 224 227 else 225 if (likely(projectileVelocity != 0 ))228 if (likely(projectileVelocity != 0 || projectileVelocity != this->maxVelocity) ) 226 229 this->velocity *= (this->maxVelocity / projectileVelocity); // set speed to max 227 230 … … 240 243 this->lastDir = this->curDir; 241 244 this->curDir = this->velocity; 242 if( (this->getAbsCoor() - this->target->getAbsCoor()).len() < 4) // FIXME Temp fake workaround for collision :)245 if( (this->getAbsCoor() - this->target->getAbsCoor()).len() < 1) // FIXME Temp fake workaround for collision :) 243 246 { 244 247 dynamic_cast<WorldEntity*>(target)->destroy( this); … … 253 256 { 254 257 255 printf("THIS SHOULD WOR Lk\n");258 printf("THIS SHOULD WORK!\n"); 256 259 257 260 Projectile::destroy( killer ); … … 272 275 glPushMatrix(); 273 276 274 Vector tmpDir = this->curDir *. 5 + this->lastDir * .5;277 Vector tmpDir = this->curDir *.7 + this->lastDir * .3; 275 278 276 279 float matrix[4][4];
Note: See TracChangeset
for help on using the changeset viewer.