summaryrefslogtreecommitdiff
path: root/src/client/camera.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2020-04-16 18:32:07 +0200
committerGitHub <noreply@github.com>2020-04-16 18:32:07 +0200
commit45999b74e610b13e8cda20c0c420e152b9837ea6 (patch)
tree5c82a99433496ce5cf15c24da30beb66bf7ff100 /src/client/camera.h
parent5cbe8437a8f7efc9c76baf23de700e96ad96b385 (diff)
downloadminetest-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/camera.h')
-rw-r--r--src/client/camera.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/camera.h b/src/client/camera.h
index 88de3570a..6ec37fe10 100644
--- a/src/client/camera.h
+++ b/src/client/camera.h
@@ -75,6 +75,12 @@ public:
return m_camera_position;
}
+ // Returns the absolute position of the head SceneNode in the world
+ inline v3f getHeadPosition() const
+ {
+ return m_headnode->getAbsolutePosition();
+ }
+
// Get the camera direction (in absolute camera coordinates).
// This has view bobbing applied.
inline v3f getDirection() const