Exiled-Team / EXILED

A high-level plugin framework for SCP: Secret Laboratory servers. It offers an event system for developers to hook in order to manipulate or change game code, or implement their own functions.
https://www.exiled.to/
Other
274 stars 177 forks source link

[Resonance] Quaternion fixes #2750

Closed ITeMbI4 closed 3 months ago

ITeMbI4 commented 3 months ago

Changes

ITeMbI4 commented 3 months ago

A bit of context, why I delete default from Quaternion:

When you create a Quaternion with default value, it will be - new Quaternion(0f, 0f, 0f, 0f). So, myRotation *= Quaternion.AngleAxis(90f, Vector3.up); will fail to rotate an object, because rotation is invalid.

So, I just change all zero Quaternion to a proper one - identity = new Quaternion(0f, 0f, 0f, 1f)

More in https://discussions.unity.com/t/why-are-quaternions-initialized-to-an-invalid-rotation-by-default/816397