mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-27 23:21:20 -04:00
[Client] Use a 10 times higher maximum distance for linear interpolation
This commit is contained in:
parent
ea2a060c67
commit
b0c1aafc5a
@ -71,9 +71,10 @@ void DedicatedActor::move(float dt)
|
||||
{
|
||||
ESM::Position refPos = ptr.getRefData().getPosition();
|
||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||
const int maxInterpolationDistance = 40;
|
||||
|
||||
// Apply interpolation only if the position hasn't changed too much from last time
|
||||
bool shouldInterpolate = abs(position.pos[0] - refPos.pos[0]) < 4 && abs(position.pos[1] - refPos.pos[1]) < 4 && abs(position.pos[2] - refPos.pos[2]) < 4;
|
||||
bool shouldInterpolate = abs(position.pos[0] - refPos.pos[0]) < maxInterpolationDistance && abs(position.pos[1] - refPos.pos[1]) < maxInterpolationDistance && abs(position.pos[2] - refPos.pos[2]) < maxInterpolationDistance;
|
||||
|
||||
// Don't apply linear interpolation if the DedicatedActor has just gone through a cell change, because
|
||||
// the interpolated position will be invalid, causing a slight hopping glitch
|
||||
|
@ -97,9 +97,10 @@ void DedicatedPlayer::move(float dt)
|
||||
|
||||
ESM::Position refPos = ptr.getRefData().getPosition();
|
||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||
const int maxInterpolationDistance = 40;
|
||||
|
||||
// Apply interpolation only if the position hasn't changed too much from last time
|
||||
bool shouldInterpolate = abs(position.pos[0] - refPos.pos[0]) < 4 && abs(position.pos[1] - refPos.pos[1]) < 4 && abs(position.pos[2] - refPos.pos[2]) < 4;
|
||||
bool shouldInterpolate = abs(position.pos[0] - refPos.pos[0]) < maxInterpolationDistance && abs(position.pos[1] - refPos.pos[1]) < maxInterpolationDistance && abs(position.pos[2] - refPos.pos[2]) < maxInterpolationDistance;
|
||||
|
||||
if (shouldInterpolate)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user