diff options
Diffstat (limited to 'src/client/content_cao.h')
-rw-r--r-- | src/client/content_cao.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client/content_cao.h b/src/client/content_cao.h index 98932137e..4627800ee 100644 --- a/src/client/content_cao.h +++ b/src/client/content_cao.h @@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "object_properties.h" #include "itemgroup.h" #include "constants.h" +#include <cassert> class Camera; class Client; @@ -81,6 +82,7 @@ private: scene::IAnimatedMeshSceneNode *m_animated_meshnode = nullptr; WieldMeshSceneNode *m_wield_meshnode = nullptr; scene::IBillboardSceneNode *m_spritenode = nullptr; + scene::IDummyTransformationSceneNode *m_matrixnode = nullptr; Nametag *m_nametag = nullptr; v3f m_position = v3f(0.0f, 10.0f * BS, 0); v3f m_velocity; @@ -163,6 +165,19 @@ public: scene::IAnimatedMeshSceneNode *getAnimatedMeshSceneNode(); + // m_matrixnode controls the position and rotation of the child node + // for all scene nodes, as a workaround for an Irrlicht problem with + // rotations. The child node's position can't be used because it's + // rotated, and must remain as 0. + // Note that m_matrixnode.setPosition() shouldn't be called. Use + // m_matrixnode->getRelativeTransformationMatrix().setTranslation() + // instead (aka getPosRotMatrix().setTranslation()). + inline core::matrix4 &getPosRotMatrix() + { + assert(m_matrixnode); + return m_matrixnode->getRelativeTransformationMatrix(); + } + inline f32 getStepHeight() const { return m_prop.stepheight; |