Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 5:16:29 AM (18 years ago)
Author:
patrick
Message:

jumping works now too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r9104 r9105  
    9797
    9898  this->fallVelocity = 0.0f;
     99  this->jumpForce = 0.0f;
    99100
    100101  this->cameraNode.setParent(this);
     
    273274  if( this->bJump && likely(this->getModel(0) != NULL))
    274275  {
    275     if( ((InteractiveModel*)this->getModel(0))->getAnimation() != JUMP)
    276       ((InteractiveModel*)this->getModel(0))->setAnimation(JUMP);
     276    if( this->jumpForce < 1.0f)
     277    {
     278      this->jumpForce = 300.0f;
     279
     280      if( ((InteractiveModel*)this->getModel(0))->getAnimation() != JUMP)
     281        ((InteractiveModel*)this->getModel(0))->setAnimation(JUMP);
     282    }
    277283  }
    278284  else if(velocity.len() != 0.0f)
     
    287293  }
    288294
     295
     296  velocity.y += this->jumpForce;
     297  if( this->jumpForce > 1.0f)
     298    this->jumpForce *= 0.9f;
    289299
    290300
Note: See TracChangeset for help on using the changeset viewer.