Quat quat = mNode->getOrint();
I have rotation store in a quaternion "quat" and want to apply it to a Irrlicht Animated node, But i found no function that support quaternion.
How can i rotate my irrlicht scene nodes using quaternions???
Thanks.
Setting Orientation of a node using quaternion, How?
-
- Posts: 8
- Joined: Fri Aug 27, 2010 3:41 pm
- Location: Multan, Pakistan
Setting Orientation of a node using quaternion, How?
Can't Be Tamed
and then don't forget to convert to degrees. bc i think the toEuler outputs radians and the scenenode expects degrees.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
-
- Posts: 8
- Joined: Fri Aug 27, 2010 3:41 pm
- Location: Multan, Pakistan
I wrote this code..
It is working properly,
Thanks.
Code: Select all
inline static irr::core::vector3df RotationVecPhysXtoIrr(const NxQuat &kQuat) {
irr::core::vector3df vec;
irr::core::quaternion quat(kQuat.x, kQuat.y, kQuat.z, kQuat.w);
//
quat.toEuler(vec);
// convert radin to degree
vec.X *= 57.2957795f;
vec.Y *= 57.2957795f;
vec.Z *= 57.2957795f;
return vec;
}
Thanks.
Can't Be Tamed