Permalink
Browse files

mod: fix the formulas in BG_EvaluateTrajectoryDelta() - patch by

zittrig-4/dev/humancontroller
  • Loading branch information...
IR4T4 committed Jan 10, 2019
1 parent d78d562 commit c9046e1a1b88dd3d0c85af05c83551c567a1d155
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/game/bg_misc.c
@@ -3025,7 +3025,7 @@ void BG_EvaluateTrajectory(const trajectory_t *tr, int atTime, vec3_t result, qb
break;
case TR_SINE:
deltaTime = (atTime - tr->trTime) / (float) tr->trDuration;
phase = sin(deltaTime * M_PI * 2);
phase = sin(deltaTime * M_TAU_F);
VectorMA(tr->trBase, phase, tr->trDelta, result);
break;
case TR_LINEAR_STOP:
@@ -3320,12 +3320,12 @@ void BG_EvaluateTrajectoryDelta(const trajectory_t *tr, int atTime, vec3_t resul
break;
case TR_SINE:
deltaTime = (atTime - tr->trTime) / (float) tr->trDuration;
phase = cos(deltaTime * M_PI * 2); // derivative of sin = cos
phase *= 0.5;
phase = cos(deltaTime * M_PI * 2); // derivative of sin = cos
phase *= M_PI * 2 * 1000 / (float)tr->trDuration;
VectorScale(tr->trDelta, phase, result);
break;
case TR_LINEAR_STOP:
if (atTime > tr->trTime + tr->trDuration)
if (atTime > tr->trTime + tr->trDuration || atTime < tr->trTime)
{
VectorClear(result);
return;

0 comments on commit c9046e1

Please sign in to comment.