- Timestamp:
- Dec 3, 2006, 5:07:55 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 4 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 -
branches/playability/src/world_entities/test_entity2.cc
r9987 r9989 84 84 this->material->setAmbient(1.0, 0.0, 1.0); 85 85 86 this->angle = 0; 87 this->rotationSpeed = 10; 88 86 89 //this->material->setDiffuseMap("maps/torp2.png"); 87 90 } … … 95 98 { 96 99 WorldEntity::loadParams(root); 100 } 101 102 103 void TestEntity2::updateAngle() 104 { 105 this->angle = this->angle + this->rotationSpeed; 97 106 } 98 107 … … 231 240 glEnd(); 232 241 242 //this->angle += this->rotationSpeed; 243 glRotatef(this->angle, 0.0, 1.0, 0.0); 244 233 245 glPopMatrix(); 234 246 glPopAttrib(); … … 245 257 this->setParent(pl); 246 258 247 } 248 249 250 251 252 253 259 this->updateAngle(); 260 } 261 262 263 264 265 266 -
branches/playability/src/world_entities/test_entity2.h
r9974 r9989 24 24 25 25 private: 26 virtual void updateAngle(); 27 26 28 Material* material; 29 float angle; 30 float rotationSpeed; 27 31 }; 28 32
Note: See TracChangeset
for help on using the changeset viewer.