Reduced jittery interpolation

This commit is contained in:
Anuken
2021-06-26 00:19:23 -04:00
parent 331cf2e269
commit 3817b159cf
2 changed files with 4 additions and 3 deletions

View File

@@ -143,7 +143,8 @@ public class EntityIO{
if(sl) cont("if(!islocal)"); if(sl) cont("if(!islocal)");
if(sf){ if(sf){
st(field.name + lastSuf + " = this." + field.name + targetSuf); //TODO adding + targetSuf to the assignment fixes units being interpolated incorrectly during physics, but makes interpolation snap instead.
st(field.name + lastSuf + " = this." + field.name);
} }
io(field.type, "this." + (sf ? field.name + targetSuf : field.name) + " = "); io(field.type, "this." + (sf ? field.name + targetSuf : field.name) + " = ");

View File

@@ -60,8 +60,8 @@ public class PhysicsProcess implements AsyncProcess{
ref.body.layer = ref.body.layer =
entity.type.allowLegStep ? layerLegs : entity.type.allowLegStep ? layerLegs :
entity.isGrounded() ? layerGround : layerFlying; entity.isGrounded() ? layerGround : layerFlying;
ref.x = entity.x(); ref.x = entity.x;
ref.y = entity.y(); ref.y = entity.y;
} }
} }