Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

christmas: cleaned up the model package

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.