Changeset 6175 in orxonox.OLD for branches/christmas_branche/src
- Timestamp:
- Dec 20, 2005, 2:47:35 AM (19 years ago)
- Location:
- branches/christmas_branche/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/christmas_branche/src/lib/graphics/importer/md2Model.cc
r6172 r6175 149 149 150 150 151 static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */ 152 151 153 /** 152 154 \brief sets the time in seconds passed since the last tick … … 160 162 this->animate(); 161 163 162 this->renderFrame(); 164 this->processLighting(); 165 this->interpolate(verticesList); 163 166 } 164 167 … … 169 172 * FIXME 170 173 */ 171 void MD2Model::draw() 172 { 173 174 175 176 // glPushMatrix(); 177 178 //this->renderFrame(); 179 180 // glPopMatrix(); 174 void MD2Model::draw() const 175 { 176 glPushMatrix(); 177 this->renderFrame(); 178 glPopMatrix(); 181 179 } 182 180 … … 185 183 \brief this is an internal function to render this special frame selected by animate() 186 184 */ 187 void MD2Model::renderFrame() 188 { 189 static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */ 185 void MD2Model::renderFrame() const 186 { 190 187 int* pCommands = this->data->pGLCommands; 191 188 … … 196 193 glCullFace(GL_BACK); 197 194 198 this->processLighting();199 this->interpolate(verticesList);200 195 201 196 this->data->material->select(); -
branches/christmas_branche/src/lib/graphics/importer/md2Model.h
r6172 r6175 143 143 virtual ~MD2Model(); 144 144 145 virtual void draw() ;145 virtual void draw() const; 146 146 147 147 void setAnim(int type); … … 160 160 void processLighting(); 161 161 void interpolate(sVec3D* verticesList); 162 void renderFrame() ;162 void renderFrame() const ; 163 163 164 164 -
branches/christmas_branche/src/world_entities/creatures/md2_creature.cc
r6174 r6175 241 241 ((MD2Model*)this->models[0])->draw(); 242 242 243 this->getWeaponManager()->draw(); 244 245 246 //this->debug(0); 243 //this->getWeaponManager()->draw(); 247 244 } 248 245 … … 260 257 261 258 262 // MD2Creature controlled movement263 this->calculateVelocity(time);264 265 Vector move = (velocity)*time;266 267 //orient the velocity in the direction of the MD2Creature.268 travelSpeed = velocity.len();269 velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;270 velocity = (velocity.getNormalized())*travelSpeed;271 272 //orient the MD2Creature in direction of the mouse273 rotQuat = Quaternion::quatSlerp( this->getAbsDir(),mouseDir,fabsf(time)*3);274 if (this->getAbsDir().distance(rotQuat) > 0.001)275 this->setAbsDir( rotQuat);276 //this->setAbsDirSoft(mouseDir,5);277 278 // this is the air friction (necessary for a smooth control)279 if(velocity.len() != 0) velocity -= velocity*0.01;280 281 //hoover effect282 cycle += time;283 this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);284 285 //readjust286 // if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0)));287 //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0)));288 289 //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);290 291 this->shiftCoor (move);292 293 this->getWeaponManager()->tick(time);294 // weapon system manipulation295 this->weaponAction();259 // // MD2Creature controlled movement 260 // this->calculateVelocity(time); 261 // 262 // Vector move = (velocity)*time; 263 // 264 // //orient the velocity in the direction of the MD2Creature. 265 // travelSpeed = velocity.len(); 266 // velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity; 267 // velocity = (velocity.getNormalized())*travelSpeed; 268 // 269 // //orient the MD2Creature in direction of the mouse 270 // rotQuat = Quaternion::quatSlerp( this->getAbsDir(),mouseDir,fabsf(time)*3); 271 // if (this->getAbsDir().distance(rotQuat) > 0.001) 272 // this->setAbsDir( rotQuat); 273 // //this->setAbsDirSoft(mouseDir,5); 274 // 275 // // this is the air friction (necessary for a smooth control) 276 // if(velocity.len() != 0) velocity -= velocity*0.01; 277 // 278 // //hoover effect 279 // cycle += time; 280 // this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02); 281 // 282 // //readjust 283 // // if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0))); 284 // //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0))); 285 // 286 // //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2); 287 // 288 // this->shiftCoor (move); 289 // 290 // this->getWeaponManager()->tick(time); 291 // // weapon system manipulation 292 // this->weaponAction(); 296 293 } 297 294 -
branches/christmas_branche/src/world_entities/world_entity.cc
r6172 r6175 136 136 else if(strstr(fileName, ".md2")) 137 137 { 138 PRINTF( 0)("fetching MD2 file: %s\n", fileName);138 PRINTF(4)("fetching MD2 file: %s\n", fileName); 139 139 // MD2Model* m = (MD2Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN); 140 MD2Model* m = new MD2Model(fileName, "/home/boenzlip/orxonox/data/maps/santa_claus.p cx");140 MD2Model* m = new MD2Model(fileName, "/home/boenzlip/orxonox/data/maps/santa_claus.png"); 141 141 m->debug(); 142 142 this->supportsLOD = false;
Note: See TracChangeset
for help on using the changeset viewer.