- Timestamp:
- Jun 2, 2005, 1:18:44 AM (19 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/projectile.cc
r4322 r4464 93 93 } 94 94 95 96 /** 97 \brief sets the velocity vector to a spec speed 98 \param velocity: vector of the velocity 99 */ 100 void Projectile::setVelocity(const Vector &velocity) 101 { 102 this->offsetVel = this->velocity = velocity; 103 this->offsetVel.normalize(); 104 this->velocity += (this->offsetVel * 50.0); 105 } 106 107 95 108 /** 96 109 \brief signal tick, time dependent things will be handled here … … 99 112 void Projectile::tick (float time) 100 113 { 101 Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.7);114 Vector v = this->velocity * (time); 102 115 this->shiftCoor(v); 103 116 -
orxonox/trunk/src/world_entities/projectile.h
r3710 r4464 22 22 23 23 #include "world_entity.h" 24 #include "vector.h" 24 25 25 26 class Vector; … … 36 37 void setFlightDirection(Quaternion flightDirection); 37 38 void setSpeed(float speed); 39 void setVelocity(const Vector &velocity); 38 40 void setTTL(float ttl); 39 41 … … 52 54 Weapon* weapon; //!< weapon the shoot belongs to 53 55 56 Vector velocity; //!< velocity of the projectile 57 Vector offsetVel; //!< offset velocity TEMP 54 58 }; 55 59 -
orxonox/trunk/src/world_entities/test_bullet.cc
r4322 r4464 58 58 void TestBullet::tick (float time) 59 59 { 60 Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1); 60 //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1); 61 Vector v = this->velocity * (time); 61 62 this->shiftCoor(v); 62 63 -
orxonox/trunk/src/world_entities/test_gun.cc
r4391 r4464 145 145 146 146 Projectile* pj = dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET)); 147 148 //printf( "object ref %p\n", ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET));149 150 //Projectile* pj = new TestBullet(this);151 147 pj->setAbsCoor(this->getAbsCoor() + this->projectileOffset); 152 148 pj->setAbsDir(this->getAbsDir()); 153 pj->setFlightDirection(this->getAbsDir()); 154 pj->setSpeed(this->getSpeed()); 149 pj->setVelocity(this->getVelocity()); 155 150 this->worldEntities->add(pj); 156 151 this->localTime = 0;
Note: See TracChangeset
for help on using the changeset viewer.