mooege/mooege — pull request #380 by mdz444 (2011-12-06 23:28:41+00:00)
Title: Fixing usage of WorldObject facing angle and quaternion rotations.

We've been abusing WorldObject's rotation values. WorldObject.FacingAngle is used to store a quaternion's W value in some places and in others it's the client side radian "facing" angle.

For example, in Living.cs the constructor generates a random radian angle and stuffs it into the FacingAngle field. This is actually used as the quaternion W when spawning so it is totally a junk value and you can see it when you do something like "!spawn 10", the zombies aren't really facing all random directions, none of them ever face 9 o'clock etc.

This patch separates the usage of rotations, the quaternion W usage of FacingAngle is now RotationW, and FacingAngle is now a complex field accessor, presenting itself as the "facing" angle while internally converting the radian angle to/from the quaternion rotation.