Matrix4x4d
Unity equivalent documentation: https://docs.unity3d.com/ScriptReference/Matrix4x4.html
Unimplemented Methods
None.
Known Differences Between Implemented Methods
TRS()
andSetTRS()
- When given a non-unit quaternion as input, the Unity implementations of these methods log an error, before some matrix is constructed. My implementation in this case does not log an error, but normalises the input quaternion before constructing a valid TRS matrix. In the standard case when the input quaternion has unit magnitude, the methods behave identically.rotation
- There is a special case for matrices which sometimes results in different output between this library and the Unityrotation
property. When a matrix contains a net reflection in itsscale
vector, the axis of reflection is ambiguous. A reflection along any one axis is equivalent to a reflection along a different axis, combined with a rotation. If you change which axis you consider the reflection to have occurred along, then you can get the same transformation by changing the rotation. Myrotation
property always considers a net reflection to have occurred along the x-axis. The Unityrotation
property appears to change which axis it considers the reflection along. The combinedscale
androtation
properties taken together as a transformation should still be consistent with the Unity implementation.Equals()
and== (Operator)
- There is no Unity documentation on these operations, but they do exist for the built inMatrix4x4
. I believe that the==
operator uses theMathf.Approximately()
method in order to test for approximate equality, while theEquals()
method tests for exact equality. This is the behaviour implemented in this library.