stackotter / delta-client

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

Avoid positioning third-person camera code in or behind blocks #199

Open stackotter opened 1 month ago

stackotter commented 1 month ago

At the moment the third-person camera is just a fixed distance away from the player's head. However, this leads to the camera being able to go inside blocks. We should be able to reuse the block ray tracing code in Game.getTargetedBlock to determine a safe distance to place the camera (just by pulling that code out into a more generic function where you can plug in whatever rays and distances you require).