Physx actor control

Taranis88

20-02-2011 00:53:42

First off forgive me if this is in the wrong place, but hopefully you guys can help me wrap my head around this. I've implemented physx candy wrapper into a little app just so that I can learn and get the feel of mogre and the wrappers that I wish to use later. Anyways more to the point, i have a spaceship in game with a bounding sphere setup for simple collision and I base my movement off of a joystick. I then adjust the linear velocity and angular velocity for movement like this:
actorNodeList[0].actor.LinearVelocity = ((mEngine.Camera.DerivedDirection * 2000) * movespeed) * _frameTime;
actorNodeList[0].actor.AngularVelocity = (new Mogre.Vector3(pitchVal * -20, -20 * yawVal, -30 * rollVal)) * _frameTime;

The problem arises once I start to flip over by rolling or pitching too much. The controls for the ship begin to swap and roll becomes yaw and pitch becomes roll etc. My guess is that the mesh is moving but the direction that physx or mogre uses for pitch never actually changes. I hope that any of that makes sense.

Am I attempting to move the ship wrong? Is there a better way? Thanks.

Edit: Upon further analysis, it appears that i'm rotating using a global quaternion, but I want to rotating off of the local quat. Any hints or links as to where I mind find out how to convert form global to local space?