Strange rotations?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
dgrafix
Posts: 116
Joined: Sun Nov 18, 2007 2:36 pm

Strange rotations?

Post by dgrafix »

I am yaw turning a cube with the X speed of the mouse. when i monitor the getRotation().Y of the Y axis, it seems to go from 360 down to 270 then start climbing again. If i keep going it goes from 0 to 90 back to 0 again. I am stumped :shock:

Here is my function:

Code: Select all

    void TurnNode(irr::scene::ISceneNode* node,const core::vector3df &rot)
    {
        core::matrix4 m;
        m.setRotationDegrees(node->getRotation());
        core::matrix4 n;
        n.setRotationDegrees(rot);
        m *=n;
        node->setRotation(m.getRotationDegrees());
        node->updateAbsolutePosition();
    }

f32 NodeYaw(irr::scene::ISceneNode* node)
{
    return node->getAbsouteTransformation().getRotationDegrees().Y;
    //return node->getRotation().Y; //<-tried this too
}


Strange thing is the object rotates as expected using this but the rotation returned is wierd.

PS the X/Pitch reading getRotation.X seems to be as expected :/
C++/Irrlicht Noob pl3se B p4t1ent.
Visit www.d-grafix.com :)
Post Reply