Changed rotations to use quaternions to prevent gimbal locking