Changeset 9989 in orxonox.OLD for branches/playability/src/world_entities/projectiles
- Timestamp:
- Dec 3, 2006, 5:07:55 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/projectiles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/hbolt.cc
r9987 r9989 39 39 this->registerObject(this, HBolt::_objectList); 40 40 41 this->loadModel("models/projectiles/hbolt.obj"); //!< Model not yet in repo41 this->loadModel("models/projectiles/hbolt.obj"); 42 42 43 43 this->setMinEnergy(10); 44 44 this->setHealthMax(0); 45 45 this->lifeSpan = 5.0; 46 47 this->angle = 0; 48 this->rotationSpeed = 90; 46 49 47 50 this->emitter = new DotEmitter(100, 5, M_2_PI); … … 112 115 } 113 116 117 118 void HBolt::updateAngle () 119 { 120 this->angle = this->angle + this->rotationSpeed; 121 } 122 123 114 124 /** 115 125 * signal tick, time dependent things will be handled here … … 125 135 this->deactivate(); 126 136 137 //this->updateAngle(); 127 138 128 139 } … … 141 152 142 153 143 void HBolt::draw () const154 void HBolt::draw () //const 144 155 { 156 157 glBegin(GL_TRIANGLES); 158 this->getModel(); 159 glEnd(); 160 145 161 glPushAttrib(GL_ENABLE_BIT); 146 162 glDisable(GL_LIGHTING); … … 149 165 //glRotatef(30, 0.0f, 1.0f, 0.0f); 150 166 151 WorldEntity::draw();152 /*glMatrixMode(GL_MODELVIEW);167 //WorldEntity::draw(); 168 glMatrixMode(GL_MODELVIEW); 153 169 glPushMatrix(); 154 170 155 float matrix[4][4];171 /* float matrix[4][4]; 156 172 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 157 173 this->getAbsDir().matrix (matrix); … … 161 177 glPopMatrix();*/ 162 178 163 /* 179 this->updateAngle(); 164 180 165 181 float matrix[4][4]; … … 167 183 this->getAbsDir().matrix (matrix); 168 184 glMultMatrixf((float*)matrix); 169 gl Rotatef(30, 0.0, 1.0, 0.0);170 //glMultMatrixf((float*)matrix);171 this->getModel()->draw(); */172 //glPopMatrix();185 glScalef(4.0, 4.0, 4.0); 186 glRotatef(this->getAngle(), 0.0, 1.0, 0.0); 187 this->getModel()->draw(); 188 glPopMatrix(); 173 189 glPopAttrib(); 174 190 } -
branches/playability/src/world_entities/projectiles/hbolt.h
r9979 r9989 31 31 32 32 virtual void tick (float dt); 33 virtual void draw () 33 virtual void draw (); //const; 34 34 35 virtual void updateAngle(); 36 inline float getAngle() { return this->angle; }; 35 37 36 38 private: … … 41 43 ParticleEmitter* emitter; 42 44 45 float angle; 46 float rotationSpeed; 43 47 44 48 WorldEntity* hitEntity; // FIXME TEMPORARY
Note: See TracChangeset
for help on using the changeset viewer.