I was wondering how to calculate thrust and its ratio in c++ using bullet physics for each thruster and save it in a array with the cardinal direction and amount of thrust..
A diagram is here
https://imgur.com/a/VIIpy . There is a parent rigid body with child rigid bodies with the direction as forward. The parent rigid body is a ship. I can get the rotation of each thruster by simple quaternion multiplication but the issue is with the cardinal direction. The other thing I can think of as to thurst multiply the cardinal direction to the child rigid body. Then somehow using the result either it would be atan.
For example, if a thurster is north, west, and up attached to the parent rigid body but the thurster forward direction is pointing east and south 45 degrees forward. It's main thrust is 120. So thrust would actually be east and south, possible 50% going east and 50% going south.
Steps 1
Get the rotation of thruster rigid body in relation to the cardinal direction
If I have to assume the math to get the difference rotation
Thruster1 q1 = rotation(q) * Vector3::RIGHT * Vector3::UP;
Step 2
Convert the quaternion to degrees
Step 3
Using tangent using something like
tangent(angle*Math.PI/180)
It would give me the tangent angle.
Step 4
Use the tangent angle information multiply by the thrust
Any ideas or help to pdf or docs. I'm not a calculus or algebra major. I welcome any comments or advice.