Changeset 3708 in orxonox.OLD for orxonox/trunk/src/world_entities/projectile.cc
- Timestamp:
- Apr 1, 2005, 1:41:38 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/projectile.cc
r3690 r3708 62 62 tick function 63 63 */ 64 void Projectile::setFlightDirection(Quaternion *flightDirection)64 void Projectile::setFlightDirection(Quaternion flightDirection) 65 65 { 66 66 if( this->flightDirection == NULL) 67 67 this->flightDirection = new Vector(); 68 68 Vector v(1, 0, 0); 69 *this->flightDirection = flightDirection ->apply(v);69 *this->flightDirection = flightDirection.apply(v); 70 70 this->flightDirection->normalize(); 71 71 } … … 89 89 void Projectile::setSpeed(float speed) 90 90 { 91 this->speed = speed * 3; 91 this->speed = speed * 3; /* fix speed settings */ 92 92 PRINTF(4)("Projectile::setting speed to: %f\n", this->speed); 93 93 } … … 99 99 void Projectile::tick (float time) 100 100 { 101 //this->speed = this->weapon->getSpeed(); 102 Vector v; 103 v = *this->flightDirection * ( this->speed * time * 1000 + 0.7); 101 Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.7); 104 102 this->shiftCoor(v); 105 //printf("PROJECTILE: current direction is: (%f, %f, %f)\n",this->flightDirection->x, this->flightDirection->y, this->flightDirection->z );106 //printf("PROJECTILE: current shift vector is: (%f, %f, %f)\n", v.x, v.y, v.z);107 //printf("PROJECTILE: current speed is: %f\n", this->speed);108 //printf("PROJECTILE: current dt is: %f\n", time);109 //this->debug();110 103 111 104 this->currentLifeTime += time; 112 105 if( this->ttl < this->currentLifeTime) 113 106 { 114 PRINTF(5)("FINALIZE========================== ===================================\n");107 PRINTF(5)("FINALIZE==========================\n"); 115 108 PRINTF(5)("current life time is: %f/%f\n", this->currentLifeTime, this->ttl); 116 PRINTF(5)("FINALIZE=========================== ==================================\n");109 PRINTF(5)("FINALIZE===========================\n"); 117 110 this->finalize(); 118 111 this->currentLifeTime = 0.0f;
Note: See TracChangeset
for help on using the changeset viewer.