diff options
author | Kahrl <kahrl@gmx.net> | 2011-09-15 00:32:11 +0200 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2011-09-15 01:53:42 +0200 |
commit | 63266928a5e2b6f4b712695eb56cb1de3899ba21 (patch) | |
tree | 5b641e640643e596d59d9794655ea35671547ced /src/camera.h | |
parent | fc92da432401051a8cc17618941625aec6b12d20 (diff) | |
download | minetest-63266928a5e2b6f4b712695eb56cb1de3899ba21.tar.gz minetest-63266928a5e2b6f4b712695eb56cb1de3899ba21.tar.bz2 minetest-63266928a5e2b6f4b712695eb56cb1de3899ba21.zip |
Made wielded tool move slightly (and smoothly) during view bobbing. Making the tool be a child node of an empty scene node instead of the camera scene node seemingly fixed the uncontrollable tool jitter, too.
Diffstat (limited to 'src/camera.h')
-rw-r--r-- | src/camera.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/camera.h b/src/camera.h index ba5d72bf4..a6dd7476f 100644 --- a/src/camera.h +++ b/src/camera.h @@ -39,14 +39,21 @@ public: // Get player scene node. // This node is positioned at the player's torso (without any view bobbing), // as given by Player::m_position. Yaw is applied but not pitch. - // Things like wielded tools should be positioned relative to this node. inline scene::ISceneNode* getPlayerNode() const { return m_playernode; } + // Get head scene node. + // It has the eye transformation and pitch applied, + // but no view bobbing. + inline scene::ISceneNode* getHeadNode() const + { + return m_headnode; + } + // Get camera scene node. - // It has the eye transformation and view bobbing applied. + // It has the eye transformation, pitch and view bobbing applied. inline scene::ICameraSceneNode* getCameraNode() const { return m_cameranode; @@ -84,6 +91,9 @@ public: return MYMAX(m_fov_x, m_fov_y); } + // Checks if the constructor was able to create the scene nodes + bool successfullyCreated(std::wstring& error_message); + // Step the camera: updates the viewing range and view bobbing. void step(f32 dtime); @@ -101,6 +111,7 @@ private: // Scene manager and nodes scene::ISceneManager* m_smgr; scene::ISceneNode* m_playernode; + scene::ISceneNode* m_headnode; scene::ICameraSceneNode* m_cameranode; // draw control |