So I noticed in the mouseOrbit script they do this to rotate the camera:
Quaternion rotation = Quaternion.Euler(y, x, 0);
Vector3 position = rotation * new Vector3(0.0f, 0.0f, -distance) + target.position;
This mathematical function is just drawing a blank on me. So you can just multiply a Quaternion by a Vector3 and it will rotate that vector3 around the quaternion spitting out a new vector3? ? ?
Could someone point me in the direction of something that describes this math a little more? I did not know you could multiply a struct of 4 numbers by a struct of 3 numbers in any instance.
You’ve asked two distinct questions here, I’ll try to address both.
"Could someone point me in the direction of something that describes this math a little more? I did not know you could multiply a struct of 4 numbers by a struct of 3 numbers in any instance. "
Short answer. Yes.
Long answer. You have to define custom operators for the types to use. Custom operators are basically static functions that take two inputs and produce an output. The inputs can be anything and the outputs can be anything. This is broadly called “operator overloading” and you can read about it here.
Onto your second question about multiplying a vector by a quaternion. AFAIK, the * operator implemented by Unity is actually a shorthand for the following mathematical operation: v’ = q * v * invert(q), which is in theory a solution to a system of equations, blah blah blah.