1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 23 deletions

View file

@ -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