MCPcopy Create free account
hub / github.com/demoth/jake2 / PM_AirAccelerate

Method PM_AirAccelerate

qcommon/src/main/java/jake2/qcommon/PMove.java:353–370  ·  view source on GitHub ↗

PM_AirAccelerate.

(float[] wishdir, float wishspeed,
            float accel)

Source from the content-addressed store, hash-verified

351 */
352
353 public static void PM_AirAccelerate(float[] wishdir, float wishspeed,
354 float accel) {
355 int i;
356 float addspeed, accelspeed, currentspeed, wishspd = wishspeed;
357
358 if (wishspd > 30)
359 wishspd = 30;
360 currentspeed = Math3D.DotProduct(pml.velocity, wishdir);
361 addspeed = wishspd - currentspeed;
362 if (addspeed <= 0)
363 return;
364 accelspeed = accel * wishspeed * pml.frametime;
365 if (accelspeed > addspeed)
366 accelspeed = addspeed;
367
368 for (i = 0; i < 3; i++)
369 pml.velocity[i] += accelspeed * wishdir[i];
370 }
371
372 /**
373 * PM_AddCurrents.

Callers 1

PM_AirMoveMethod · 0.95

Calls 1

DotProductMethod · 0.95

Tested by

no test coverage detected