stackotter / delta-client

An open source Minecraft Java Edition client built for speed.
https://deltaclient.app
GNU General Public License v3.0
331 stars 32 forks source link

View bobbing #130

Open stackotter opened 2 years ago

stackotter commented 2 years ago

At the moment the camera is attached directly to the player's position. View bobbing would be implemented by adding some offset calculated from (presumably) the player's velocity and the current time using sine and cosine functions. To confirm this it would be best to look at the decompiled vanilla sources for the specifics.

The best place to implement this would be in getCameraUniforms at the bottom of RenderCoordinator.swift. Eventually more of the camera based calculations should be refactored out of RenderCoordinator for neatness, but it's fine to just add it on to the end for now.