mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-17 18:40:33 +00:00
fix: aim at -buffertime where nt sync starts
This commit is contained in:
parent
6242873774
commit
4c5a63db8c
@ -510,6 +510,12 @@ bool GuessForecastingStartPosition(out Vector3 position, out Quaternion rotation
|
||||
// extrapolate this from latest time to blendingEndTime
|
||||
// TODO validate rotation formula?
|
||||
float timeToBlendingEnd = (float)(blendingEndTime - clientTimeline);
|
||||
|
||||
// right now, we aim exactly at the latest received state @ blendingEndTime.
|
||||
// transform sync is always 'bufferTime' behind though.
|
||||
// so aim for -buffertime behind to be perfectly smooth.
|
||||
timeToBlendingEnd -= (float)bufferTime;
|
||||
|
||||
position = latest.position + velocity * timeToBlendingEnd;
|
||||
rotation = latest.rotation * Quaternion.Slerp(Quaternion.identity, rotationDelta, timeToBlendingEnd / timeDelta);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user