Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by SuperManitu

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.

  • Author

The tick only happens with 20 FPS, you need to lerp in the renderer for the frames in between (3 for 60FPS)

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.

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.