Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 20, 2005, 3:21:19 AM (19 years ago)
Author:
patrick
Message:

christmas: cleaned up the model package

Location:
branches/christmas_branche/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/world_entities/creatures/md2_creature.cc

    r6176 r6180  
    254254
    255255
    256 //   // MD2Creature controlled movement
    257 //   this->calculateVelocity(time);
    258 //
    259 //   Vector move = (velocity)*time;
    260 //
    261 //   //orient the velocity in the direction of the MD2Creature.
    262 //   travelSpeed = velocity.len();
    263 //   velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;
    264 //   velocity = (velocity.getNormalized())*travelSpeed;
    265 //
    266 //   //orient the MD2Creature in direction of the mouse
    267 //    rotQuat = Quaternion::quatSlerp( this->getAbsDir(),mouseDir,fabsf(time)*3);
    268 //    if (this->getAbsDir().distance(rotQuat) > 0.001)
    269 //     this->setAbsDir( rotQuat);
    270 //    //this->setAbsDirSoft(mouseDir,5);
    271 //
    272 //   // this is the air friction (necessary for a smooth control)
    273 //   if(velocity.len() != 0) velocity -= velocity*0.01;
    274 //
    275 //   //hoover effect
    276 //   cycle += time;
    277 //   this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);
    278 //
    279 //   //readjust
    280 // // if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0)));
    281 //   //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0)));
    282 //
    283 //   //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
    284 //
    285 //   this->shiftCoor (move);
    286 //
    287 //   this->getWeaponManager()->tick(time);
    288 //   // weapon system manipulation
    289 //   this->weaponAction();
     256  // MD2Creature controlled movement
     257  this->calculateVelocity(time);
     258
     259  Vector move = (velocity)*time;
     260
     261  //orient the velocity in the direction of the MD2Creature.
     262  travelSpeed = velocity.len();
     263  velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity;
     264  velocity = (velocity.getNormalized())*travelSpeed;
     265
     266  //orient the MD2Creature in direction of the mouse
     267   rotQuat = Quaternion::quatSlerp( this->getAbsDir(),mouseDir,fabsf(time)*3);
     268   if (this->getAbsDir().distance(rotQuat) > 0.001)
     269    this->setAbsDir( rotQuat);
     270   //this->setAbsDirSoft(mouseDir,5);
     271
     272  // this is the air friction (necessary for a smooth control)
     273  if(velocity.len() != 0) velocity -= velocity*0.01;
     274
     275  //hoover effect
     276  cycle += time;
     277  this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);
     278
     279  //readjust
     280 // if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0)));
     281  //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0)));
     282
     283  //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
     284
     285  this->shiftCoor (move);
     286
     287  this->getWeaponManager()->tick(time);
     288  // weapon system manipulation
     289  this->weaponAction();
    290290}
    291291
  • branches/christmas_branche/src/world_entities/world_entity.cc

    r6179 r6180  
    136136      PRINTF(4)("fetching MD2 file: %s\n", fileName);
    137137//         MD2Model* m = (MD2Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN);
    138       MD2Model* m = new MD2Model(fileName, "");
    139       m->debug();
     138      Model* m = new MD2Model(fileName, "md2_fake_texture.bad");
    140139        //this->setModel((Model*)ResourceManager::getInstance()->load(fileName, MD2, RP_CAMPAIGN), 0);
    141       this->setModel((Model*)m, 0);
     140      this->setModel(m, 0);
    142141    }
    143142  }
Note: See TracChangeset for help on using the changeset viewer.