1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-01 23:50:22 +02:00

Camera: Fix shooting line offsets (#9681)

Removes duplicated offset calculations from Game and use whatever the Camera class returns.
This keeps the eye position nicely in sync, and gets rid of duplicated code.
This commit is contained in:
SmallJoker
2020-04-16 18:32:07 +02:00
committed by GitHub
parent 5cbe8437a8
commit 45999b74e6
4 changed files with 30 additions and 23 deletions

View File

@ -135,6 +135,9 @@ public:
}
v3f getPosition() const { return m_position; }
// Non-transformed eye offset getters
// For accurate positions, use the Camera functions
v3f getEyePosition() const { return m_position + getEyeOffset(); }
v3f getEyeOffset() const;
void setEyeHeight(float eye_height) { m_eye_height = eye_height; }