diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2020-04-16 18:32:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 18:32:07 +0200 |
commit | 45999b74e610b13e8cda20c0c420e152b9837ea6 (patch) | |
tree | 5c82a99433496ce5cf15c24da30beb66bf7ff100 /src/client/localplayer.h | |
parent | 5cbe8437a8f7efc9c76baf23de700e96ad96b385 (diff) | |
download | minetest-45999b74e610b13e8cda20c0c420e152b9837ea6.tar.gz minetest-45999b74e610b13e8cda20c0c420e152b9837ea6.tar.bz2 minetest-45999b74e610b13e8cda20c0c420e152b9837ea6.zip |
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.
Diffstat (limited to 'src/client/localplayer.h')
-rw-r--r-- | src/client/localplayer.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client/localplayer.h b/src/client/localplayer.h index d88ae17ac..345aec9d9 100644 --- a/src/client/localplayer.h +++ b/src/client/localplayer.h @@ -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; } |