Add note on the reasoning for the visual position interpolation rate value in voxygen

This commit is contained in:
Imbris 2021-06-15 23:18:25 -04:00
parent dd6b5ffa38
commit 8f429d532a

View File

@ -43,7 +43,11 @@ impl<'a> System<'a> for Sys {
{
// Update interpolation values, but don't interpolate far things or objects
if i.pos.distance_squared(pos.0) < 64.0 * 64.0 && !matches!(body, Body::Object(_)) {
i.pos = Lerp::lerp(i.pos, pos.0 + vel.0 * 0.03, 10.0 * dt.0);
// Note, these values are specifically tuned for smoother motion with high
// network latency or low network sampling rate and for smooth
// block hopping (which is instantaneous)
const POS_LERP_RATE_FACTOR: f32 = 10.0;
i.pos = Lerp::lerp(i.pos, pos.0 + vel.0 * 0.03, POS_LERP_RATE_FACTOR * dt.0);
i.ori = Ori::slerp(i.ori, *ori, base_ori_interp(body) * dt.0);
} else {
i.pos = pos.0;