-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
After editing an emitter’s rotation values, deselecting and reselecting the emitter may cause the Transform Properties UI to display different rotation values than those originally entered. This occurs even though the underlying transform has not changed.
This behavior is caused by Euler angle non-uniqueness. When the editor reconstructs Euler angles from a matrix, it may choose a different but equivalent representation, resulting in value changes in the UI.
Current Behavior
- Rotation, translation, and scale edits immediately rebuild the RT and SRT matrices.
- Euler angles are repeatedly extracted from the matrix for UI display.
- Due to Euler ambiguity, the extracted values may differ from the originally entered angles.
Proposed Improvement
Store each emitter’s transform internally as:
- Translation (Vector3)
- Scale (Vector3)
- Rotation (Quaternion)
The RT/SRT matrices would then be rebuilt only when serializing or exporting, rather than being treated as the primary representation. Euler angles would be derived from the quaternion for UI display, eliminating value changes while editing.
Limitations
This issue cannot be fully avoided across file reloads. The binary format stores rotation exclusively within a matrix, which causes the original Euler angle to be lost. As a result, reloading a file may still cause the UI to display different, but equivalent, Euler values.