@@ -748,7 +748,8 @@ namespace RTE {
748
748
Vector legProgress;
749
749
Vector forceVel;
750
750
Vector returnPush;
751
- Vector trajectory = velocity * travelTime * c_PPM; // Trajectory length in pixels.
751
+ Vector ownerVel = velocity;
752
+ Vector trajectory = ownerVel * travelTime * c_PPM; // Trajectory length in pixels.
752
753
753
754
HitData hitData;
754
755
@@ -793,7 +794,7 @@ namespace RTE {
793
794
intPos[Y] = position.GetFloorIntY ();
794
795
795
796
float prevTrajMag = trajectory.GetMagnitude ();
796
- trajectory = velocity * timeLeft * c_PPM;
797
+ trajectory = ownerVel * timeLeft * c_PPM;
797
798
798
799
const Vector nextPosition = position + trajectory;
799
800
delta[X] = nextPosition.GetFloorIntX () - intPos[X];
@@ -924,7 +925,7 @@ namespace RTE {
924
925
timeLeft *= (trajectory.GetMagnitude () - legProgress.GetMagnitude ()) / prevTrajMag;
925
926
926
927
// The capped velocity used for the push calculations. a = F / m
927
- forceVel = Vector (velocity ).CapMagnitude ((pushForce * timeLeft) / mass);
928
+ forceVel = Vector (ownerVel ).CapMagnitude ((pushForce * timeLeft) / mass);
928
929
929
930
// MOVABLEOBJECT COLLISION RESPONSE /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
930
931
@@ -1149,11 +1150,11 @@ namespace RTE {
1149
1150
for (const std::pair<Vector, Vector> &impulseForcesEntry : impulseForces) {
1150
1151
// Cap the impulse to what the max push force is
1151
1152
// impulseForcesEntry.first.CapMagnitude(pushForce * (travelTime/* - timeLeft*/));
1152
- // velocity += impulseForcesEntry.first / mass;
1153
+ ownerVel += impulseForcesEntry.first / mass;
1153
1154
returnPush += impulseForcesEntry.first ;
1154
1155
}
1155
1156
// Stunt travel time if there is no more velocity
1156
- if (velocity .IsZero ()) { timeLeft = 0 ; }
1157
+ if (ownerVel .IsZero ()) { timeLeft = 0 ; }
1157
1158
}
1158
1159
++stepCount;
1159
1160
}
0 commit comments