How to set a Shape's orientation?

kungfoomasta

15-02-2008 18:25:27

I have a shape descriptor and I want to modify its orientation by yawing it 90 degrees. How can I do this?

myHeightfieldShapeDesc.gobalpose...

Do I have to work in Quaternions? If so, how to make a quaternion that represents a 90 degree yaw?

betajaen

15-02-2008 18:31:49

LocalPose/Pose param in the shape, and you'll have to use a 90 degree yaw. According to the wiki it's sqrt(0.5), 0, sqrt(0.5), 0.

kungfoomasta

15-02-2008 18:39:09

Awesome, thanks for pointing that out. So it sounds like..


NxQuat Q;
Q.setXYZW(sqrt(0.5),0,sqrt(0.5),0);
desc.localPose.M.fromQuat(Q);


I'm not able to test this code at the moment, I'm just piecing this together from snippets of code I see..

betajaen

15-02-2008 18:43:05

Almost:

Q.setWXYZ(sqrt(0.5),0,sqrt(0.5),0);