mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Create a separate scene manager for the wielded tool. This fixes the glitchyness in large map coordinates and some depth buffer problems. (The tool doesn't bob anymore when walking, this will be fixed later.) Fix MSVC build (thanks to dannydark).
This commit is contained in:
parent
6599002149
commit
36af9bb027
3 changed files with 49 additions and 13 deletions
13
src/camera.h
13
src/camera.h
|
@ -63,12 +63,6 @@ public:
|
|||
return m_cameranode;
|
||||
}
|
||||
|
||||
// Get wielded item scene node.
|
||||
inline ExtrudedSpriteSceneNode* getWieldNode() const
|
||||
{
|
||||
return m_wieldnode;
|
||||
}
|
||||
|
||||
// Get the camera position (in absolute scene coordinates).
|
||||
// This has view bobbing applied.
|
||||
inline v3f getPosition() const
|
||||
|
@ -124,12 +118,19 @@ public:
|
|||
// Pass 0 for left click, 1 for right click
|
||||
void setDigging(s32 button);
|
||||
|
||||
// Draw the wielded tool.
|
||||
// This has to happen *after* the main scene is drawn.
|
||||
// Warning: This clears the Z buffer.
|
||||
void drawWieldedTool();
|
||||
|
||||
private:
|
||||
// Scene manager and nodes
|
||||
scene::ISceneManager* m_smgr;
|
||||
scene::ISceneNode* m_playernode;
|
||||
scene::ISceneNode* m_headnode;
|
||||
scene::ICameraSceneNode* m_cameranode;
|
||||
|
||||
scene::ISceneManager* m_wieldmgr;
|
||||
ExtrudedSpriteSceneNode* m_wieldnode;
|
||||
|
||||
// draw control
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue