Untitled


SUBMITTED BY: Guest

DATE: Nov. 12, 2013, 3:55 p.m.

FORMAT: C++

SIZE: 1.2 kB

HITS: 794

  1. void QPM_AirMove( void )
  2. {
  3. int i;
  4. vec3_t wishvel;
  5. float fmove, smove;
  6. vec3_t wishdir;
  7. float wishspeed;
  8. fmove = pm->cmd.forwardmove;
  9. smove = pm->cmd.rightmove;
  10. pml.forward[2] = 0;
  11. pml.right[2] = 0;
  12. VectorNormalize( pml.forward );
  13. VectorNormalize( pml.right );
  14. for( i = 0; i < 2; i++ )
  15. wishvel[i] = pml.forward[i]*fmove + pml.right[i]*smove; //Smooth
  16. wishvel[2] = 0;
  17. VectorCopy( wishvel, wishdir );
  18. wishspeed = VectorNormalize( wishdir);
  19. /* Disabled, but here just in case I need it.
  20. if(wishspeed > 2000)
  21. {
  22. VectorScale( wishvel, 2000/wishspeed, wishvel );
  23. wishspeed = 2000;
  24. }*/
  25. if(pm->ps->groundEntityNum != ENTITYNUM_NONE)
  26. {
  27. pm->ps->velocity[2] = 0;
  28. PM_Accelerate( wishdir, wishspeed, pm_accelerate );
  29. pm->ps->velocity[2] -= pm->ps->gravity * 800 * pml.frametime; //Gravity
  30. PM_WalkMove();
  31. }
  32. else
  33. {
  34. QPM_AirAccelerate( wishdir, wishspeed, pm_accelerate );
  35. pm->ps->velocity[2] -= pm->ps->gravity * 800 * pml.frametime; //Gravity
  36. //PM_FlyMove(); add Quake version later
  37. }
  38. }

comments powered by Disqus