asumagic / kag-staging

Issue tracker for the KAG staging build
6 stars 0 forks source link

CCamera.getInterpolationOffset() is weird #175

Closed bunniewormy closed 1 year ago

bunniewormy commented 1 year ago

I don't know what exactly this function is but it returns different values than on vanilla

Appears to return nearly always Vec2f(0, 0) on vanilla and Vec2f(-710, 96) on staging for me

This causes issues in BlockPlacement.as and BuilderInventory.as

asumagic commented 1 year ago

CCamera::getInterpolationOffset() is supposed to return the difference between the position of the camera on the current frame and the position of the camera on the first frame that followed a tick.

This is useful when there's something you want to render something in worldspace (e.g. with DrawTile) which you know the position of in worldspace, but that is only updated during ticks, such as aim position, and for which there is no convenient interpolated option.

When you render something in worldspace like this that isn't being interpolated, the displayed thing will visually jitter because the camera is still moving between ticks, but the thing you're displaying isn't following along (as it only updates during ticks).

So adding the camera's "interpolation offset" means the thing you're displaying will stay at exactly the same screenspace position for all frames following a tick, effectively visually locking it to 30Hz, and countering the jitter.

asumagic commented 1 year ago

Fixed next staging build