SyncBase: use smaller values for interp stop check

This commit is contained in:
JohnCorby 2022-02-27 07:31:44 -08:00
parent e6946128ce
commit fc1ff0210a
2 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ namespace QSB.Syncs
{ {
protected override float SendInterval => 0.05f; protected override float SendInterval => 0.05f;
protected const float PositionChangeThreshold = 0.05f; private const float PositionChangeThreshold = 0.05f;
protected const float RotationChangeThreshold = 0.05f; private const float RotationChangeThreshold = 0.05f;
private Vector3 _prevPosition; private Vector3 _prevPosition;
private Quaternion _prevRotation; private Quaternion _prevRotation;

View File

@ -270,7 +270,7 @@ namespace QSB.Syncs
var distance = Vector3.Distance(SmoothPosition, transform.position); var distance = Vector3.Distance(SmoothPosition, transform.position);
var angle = Quaternion.Angle(SmoothRotation, transform.rotation); var angle = Quaternion.Angle(SmoothRotation, transform.rotation);
if (Mathf.Abs(distance - _prevDistance) > DistanceChangeThreshold || if (Mathf.Abs(distance - _prevDistance) > DistanceChangeThreshold ||
distance < PositionChangeThreshold && angle < RotationChangeThreshold) distance < .001f && angle < .001f)
{ {
SmoothPosition = transform.position; SmoothPosition = transform.position;
SmoothRotation = transform.rotation; SmoothRotation = transform.rotation;