so, I’m a bit confused on the docs about System::set3DOrientation. In the parameters for forwards and upwards orientation, it says:
- forward: The forwards orientation of the listener. This vector must be of unit length and perpendicular to the up vector. You can specify 0 or NULL to not update the forwards orientation of the listener.
- up: The upwards orientation of the listener. This vector must be of unit length and perpendicular to the forwards vector. You can specify 0 or NULL to not update the upwards orientation of the listener.
My confusion arises because both vectors must be perpendicular. However, I’m not sure how to calculate a vector that is perpendicular to my forward one. Statically, I know that the perpendicular vector of (0, 0, 1) and (0, 1, 0) is (-1, 0, 0) if (0, 0, 10 is my starting forward orientation and (0, 1, 0) is my starting upward orientation. However, in a context such as a game where I want the player to be able to turn 15 degrees per turn (thereby altering the forward but not upward orientation of the listener), I (currently) set the new x coordinate of the forward orientation to sin(theta pi/180) and the z coordinate of the forward orientation to cos(theta pi/180). I can’t, however, use this same method for the upward orientation, since the Z axis doesn’t apply (I don’t think). If I try setting the x and y coordinates to the same values, the player then cannot turn left or right, but can continue orienting upwards (that is, once the listeners upward orientation is set, orienting on the forwards axis becomes impossible). So, how can I allow the forward orientation to be altered freely while allowing the listeners upward orientation t also be freely altered without FMOD complaining that the vectors are not perpendicular?