Changeset 3709 in orxonox.OLD for orxonox/trunk/src/world_entities/test_bullet.cc
- Timestamp:
- Apr 1, 2005, 1:45:47 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/test_bullet.cc
r3708 r3709 17 17 18 18 19 #include " simple_bullet.h"19 #include "test_bullet.h" 20 20 21 21 #include "world_entity.h" … … 31 31 \brief standard constructor 32 32 */ 33 SimpleBullet::SimpleBullet (Weapon* weapon) : WorldEntity()33 TestBullet::TestBullet (Weapon* weapon) : WorldEntity() 34 34 {} 35 35 … … 38 38 \brief standard deconstructor 39 39 */ 40 SimpleBullet::~SimpleBullet ()40 TestBullet::~TestBullet () 41 41 { 42 42 /* … … 48 48 49 49 50 /**51 \brief this sets the flight direction of the projectile52 \param directin in which to flight53 54 this function will calculate a vector out of this to be used in the55 tick function56 */57 void SimpleBullet::setFlightDirection(Quaternion flightDirection)58 {59 if( this->flightDirection == NULL)60 this->flightDirection = new Vector();61 Vector v(1, 0, 0);62 *this->flightDirection = flightDirection.apply(v);63 this->flightDirection->normalize();64 }65 66 67 /**68 \brief this sets the time to life of the projectile69 \param ttl in second70 71 after this life time, the projectile will garbage collect itself72 */73 void SimpleBullet::setTTL(float ttl)74 {75 this->ttl = ttl;76 }77 78 79 /**80 \brief sets the speed of the projectile81 */82 void SimpleBullet::setSpeed(float speed)83 {84 this->speed = speed * 3; /* fix speed settings */85 PRINTF(4)("SimpleBullet::setting speed to: %f\n", this->speed);86 }87 50 88 51 /** … … 90 53 \param time since last tick 91 54 */ 92 void SimpleBullet::tick (float time)55 void TestBullet::tick (float time) 93 56 { 94 57 Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.7); … … 111 74 \param place where it is hit 112 75 */ 113 void SimpleBullet::hit (WorldEntity* entity, Vector* place)76 void TestBullet::hit (WorldEntity* entity, Vector* place) 114 77 {} 115 78 … … 118 81 \brief the function gets called, when the projectile is destroyed 119 82 */ 120 void SimpleBullet::destroy ()83 void TestBullet::destroy () 121 84 {} 122 85 123 86 124 void SimpleBullet::draw ()87 void TestBullet::draw () 125 88 { 126 89 glMatrixMode(GL_MODELVIEW);
Note: See TracChangeset
for help on using the changeset viewer.