One way is go over matrices in between.
So first create a rotation matrix for current rotation.
Code: Select all
irr::core::matrix4 currentRotation;
currentRotation.setRotationDegrees(node->getRotation());
Then create a matrix for your local rotation simply around your original forward vector. You seem to have z as forward, so it would be:
Code: Select all
irr::core::matrix4 matLocalRot;
matLocalRot.setRotationDegrees(irr::core::vector3df(0,0,rotationAngle));
Now you combine those - which matrix multiplication does. Multiplication basically does mean - do this matrix first - then the next one (order matters!).
Code: Select all
irr::core::matrix4 combinedRotation = currentRotation*matLocalRot;
And back to euler:
Code: Select all
irr::core::vector3df newRotation = combinedRotation.getRotationDegrees();
There are more ways to solve this. For example you can also directly create the rotation matrix in the already rotated coordinate system.
Then it would be something like:
Code: Select all
irr::core::vector3df axisZ(0,0,1);
currentRotation.rotateVect(axisZ); // find z-axis in rotated coordinate system (or directly use matrix as you do above, but be careful about scaling)
irr::core::matrix4 matRotZ;
matRotZ.setRotationAxisRadians(rotationAngle*irr::core::DEGTORAD, axisZ);
When you add that one to the existing rotation matrix (which you get same way as above), this time the order is other way round:
Code: Select all
irr::core::matrix4 combinedRotation = matRotZ*currentRotation;
Sometimes going over quaternions is also helpful. You can think of quaternions more or less as a rotations around an axis. They tend to be nice when it comes to interpolating between rotations which can be useful for stuff like fading out rotations.
Ok... I hope I didn't mess up anything ^_^