btQuaternion issue

pfanne
Posts: 7
Joined: Fri Dec 02, 2011 10:21 am

btQuaternion issue

Post by pfanne »

Hi there,
I've been trying to correct an error from an exporter I'm using by changing the quaternions it creates when importing(not an elegant solution, I know).
I tried changing the Axis of the quaternion but noticed some weird behavior.
So I tried to just do this to confirm I didn't do anything stupid:
rot = btQuaternion(rot.getAxis(), rot.getAngle());
thinking that this shouldn't alter my quaternion rot in any way.
but now all my blocks are tilted in a 45° angle.
Do I have a missunderstanding about how these functions, or is this a bug?
RBD
Posts: 141
Joined: Tue Sep 16, 2008 11:31 am

Re: btQuaternion issue

Post by RBD »

q = btQuaternion(q.getAxis(), q.getAngle());
appears to work without issues here; it doesn't alter the quaternion. That statement would alter q if it was not a valid normalized rotation quaternion. I suspect perhaps something may be wrong with how rot was (created, exported or) imported instead? Check that the (export/) import order is correct (x,y,z,w) and that it is a normalized rotation quaternion.