Fix Matrix Transpose#14
Conversation
|
Here's a demonstration: There's a 'parent' and a 'local' ('test') overlay. The local overlay's matrix is multiplied with the parent to make their transformation relative to the parent. The steps in this demo are:
Here's the version with the previous code: And with the new code: Here's the code for the demo, it requires only OVRSharp and .net 6: |
|
Thanks for the fix (and the detailed explanation/demo)! I'll test this out sometime this week and release this, maybe with a major version bump due to the breaking change. |
The ToHmdMatrix34_t and ToMatrix4x4 methods do not properly transpose their matrices.
Dotnet uses row vectors, whereas ovr uses column vectors. This requires the entire Matrix to be transposed, but the current methods only transpose the last row/column (the translation component).
This isn't noticeable as long as scaling is uniform and rotation only happens along one axis, but does not allow for more complex affine transformations.
This pull request fixes this. However, this is a breaking change, since rotations now happen the other (correct) way around.