Posted September 24, 20205 yr Hi, I am creating a custom Entity (not a LivingEntity) and for starters I gave it a constant movement in one direction. But for some reason, the Entity jitters the whole time, unlike normal entities like the minecart and I don't really understand where this is coming from. Here is a video where you can see (some of) the jittering: https://cdn.discordapp.com/attachments/454376090362970122/756140763338899616/movement2.mp4 Entity code: https://pastebin.com/ZAmp224b Renderer: https://pastebin.com/gu34g7Ft The interpolation in the renderer is done by this method: public static <T extends Entity> Vec3d getMoveLerp(double partialTicks, T entity) { double x = MathHelper.lerp(partialTicks, entity.prevPosX, entity.getPosX()); double y = MathHelper.lerp(partialTicks, entity.prevPosY, entity.getPosY()); double z = MathHelper.lerp(partialTicks, entity.prevPosZ, entity.getPosZ()); return new Vec3d(x - entity.prevPosX, y - entity.prevPosY, z - entity.prevPosZ); } I've tried using the default update and tracking range as well as 20 and 80 respectively without visible changes. Thanks Edited September 26, 20205 yr by SuperManitu
September 24, 20205 yr The tracking range shouldn't really have an effect on it. A question for you is why do you need to lerp movement? The place the entity is positioned in the world should be synced to the renderer if I'm not mistaken. Lerping the position would just cause the calculations to lag slightly behind and repeat the same motion. This is my understanding of the renderer system anyways.
September 26, 20205 yr Author The tick only happens with 20 FPS, you need to lerp in the renderer for the frames in between (3 for 60FPS)
September 26, 20205 yr I know how linear interpolation works, but you seem to have not read my entire post. If the movement of the entity is global, then the lerping should will happen already from the entity movement. However, if it's happening relative to the model, then that's where you would need to do you own manual interpolation. Else, you are just interpolating what's already has been interpolated. You can view this within BoatRenderer. There is no interpolation for the movement, just the rotation of the model pieces.
September 26, 20205 yr Author Ok, yeah, just commenting out the interpolation in the renderer works. Which is really weird, because I am pretty sure that I tried that initially and got only jumping movement (probably every tick). Probably had something else wrong back then and fixed that in the meantime. Thanks
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.