Skip to content

Commit 060a550

Browse files
committed
- reset interpolation when car changing position/direction angle
1 parent eb3b467 commit 060a550

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

game/shared/cars.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1996,8 +1996,6 @@ float CCar::GetLerpValue() const
19961996

19971997
VECTOR_NOPAD CCar::GetInterpolatedCogPosition() const
19981998
{
1999-
2000-
20011999
return ToFixedVector(lerp(FromFixedVector(m_prevCogPosition), FromFixedVector(GetCogPosition()), GetLerpValue()));
20022000
}
20032001

@@ -2064,6 +2062,8 @@ void CCar::SetPosition(const VECTOR_NOPAD& value)
20642062
m_hd.where.t[0] = value.vx;
20652063
m_hd.where.t[1] = value.vy;
20662064
m_hd.where.t[2] = value.vz;
2065+
2066+
ResetInterpolation();
20672067
}
20682068

20692069
int CCar::GetDirection() const
@@ -2075,6 +2075,8 @@ void CCar::SetDirection(const int& newDir)
20752075
{
20762076
m_hd.direction = newDir;
20772077
TempBuildHandlingMatrix(0);
2078+
2079+
ResetInterpolation();
20782080
}
20792081

20802082
const VECTOR_NOPAD& CCar::GetLinearVelocity() const

0 commit comments

Comments
 (0)