Converting core::quaternion to and from hkQuaternion

Discussion about everything. New games, 3d math, development tips...
Post Reply
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Converting core::quaternion to and from hkQuaternion

Post by 3DModelerMan »

How do you convert a core::quaternion to a Havok hkQuaternion? Is it safe to assume you can just copy the members like you can with vectors (I've already converted those.)? I'm working on a Havok physics animator, and I need to convert between the two types of quaternions.
Thanks.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

I'm pretty sure it is just that, try and see if it works :P

Sometimes the ordering is changed. There is w,x,y,z. Sometimes they are stored WXYZ other times XYZW.
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

It`s exactly the same- just copy the members:

Code: Select all

irr::core::quaternion irrQuat = // your definition here
hkQuaternion hkQuat.set(irrQuat.X, irrQuat.Y, irrQuat.Z, irrQuat.W);
Works for sure. I was using Havok some time ago.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Post Reply