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

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

Open stackotter opened 6 months ago

stackotter commented 6 months 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).