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

Method SV_AddRotationalFriction

game/src/main/java/jake2/game/SV.java:626–645  ·  view source on GitHub ↗
(SubgameEntity ent)

Source from the content-addressed store, hash-verified

624
625 // FIXME: hacked in for E3 demo
626 private static void SV_AddRotationalFriction(SubgameEntity ent) {
627 int n;
628 float adjustment;
629
630 Math3D.VectorMA(ent.s.angles, Defines.FRAMETIME, ent.avelocity,
631 ent.s.angles);
632 adjustment = Defines.FRAMETIME * Defines.sv_stopspeed
633 * Defines.sv_friction;
634 for (n = 0; n < 3; n++) {
635 if (ent.avelocity[n] > 0) {
636 ent.avelocity[n] -= adjustment;
637 if (ent.avelocity[n] < 0)
638 ent.avelocity[n] = 0;
639 } else {
640 ent.avelocity[n] += adjustment;
641 if (ent.avelocity[n] > 0)
642 ent.avelocity[n] = 0;
643 }
644 }
645 }
646
647 /**
648 * Monsters freefall when they don't have a ground entity, otherwise all

Callers 1

SV_Physics_StepMethod · 0.95

Calls 1

VectorMAMethod · 0.95

Tested by

no test coverage detected