Good morning! I have a question about Quaternions (spooky spooky)
I’m working on a research project using a motion simulator that has two 360 degree axes of rotation: it can pitch all the way around, and roll all the way around.
Here’s a bad diagram, showing both motors as the pitch (which rolls the arm all the way around), and roll, which rotates the cockpit:

Essentially, we need to break down a player transform into pitch and roll angles that will smoothly simulate the movement of the player. The problem is that every single approach we’ve taken so far has caused different problems at different angles, usually having a series of movements that cause the angles to move quickly or unexpectedly.
To make the roll feel accurate, we only want it to move when the player actually rolls, and we want the pitch to only move when the player pitches. The motion should roughly approximate the tracked Transform’s motion as it rotates freely throughout space.
Here are some approaches we’ve tried so far and had troubles with:
-
Taking the Euler Angles directly: causes many issues when doing a full pitch rotation with little to no roll, including the roll flipping all the way around during the loop.
-
Locking the rigidbody of the player’s movement axis: we’re using a third-party combat kit that rotates the rigidbody and the transform unpredictably, so we can only track the transform’s change in rotation, not the rigidbody’s torque, to mimic the movement on a test rig.
-
Tracking the change in rotations using quaternions and breaking them down into EulerAngles, which are recorded as separate pitch and roll values: this causes the player to eventually become off-sync with the test rig, meaning that the player can be upside-down while the actual simulator is not.
I have also checked a dozen threads both in these forums and stackoverflow for different approaches that break down the quaternion using some odd math, but unfortunately they usually present the same problems as above, where the movements aren’t accurate to what we expect.
We have full freedom of movement in the game, because the player is in a spaceship dogfighting. If anyone has any ideas for approaches that “feel” correct (rolls and pitches when the player rolls and pitches, does not get off sync) please let me know!
tl;dr: break down a transform’s rotation into pitch and roll values without having those values change suddenly, and have them seem accurate to the movement of the transform for a player in a motion simulator
Thank you!!