Right now I have this code to always update the aircraft's systems:
Code: Select all
void CPlayerAircraft::updateAllFactors()
{
body->applyTorque(btVector3(pitch, rudder, roll));
force = btVector3(0.0f, 0.0f, energy);
force = force.rotate(btVector3(0.8f, 0.0f, 0.0f), -body->getOrientation().getAngle());
body->applyForce(force, btVector3(0.0f,0.0f,0.0f));
}
What code would I put in there so it would go in the direction it's pointing?
I tried this code here, that I found in another problem thread:
Code: Select all
btTransform trans;
btQuaternion quat;
trans.setOrigin(btVector3(0.0f, 0.0f, 0.0f)); //translation
quat.setEuler(pitch, rudder, roll);//rotation
trans.setRotation(quat);
Please help, I really want to get the simulator out with a beta soon. I've been working hard on it for a long time. =/