-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SceneKit] Make SCNMatrix4 column-major in .NET. Fixes #4652. #13695
[SceneKit] Make SCNMatrix4 column-major in .NET. Fixes #4652. #13695
Conversation
* Implement a column-major version of SCNMatrix4 in .NET to match native code. * This was done by copying the existing SCMatrix4 implementation, and modify it as required (doing it with conditional compilation in the same file turned out to be quite messy, so I opted for using different files for legacy Xamarin and .NET). * There was one major change: the matrix inversion algorithm is new (copied from .NET instead), because the legacy Xamarin version showed strange results with some test values. * Add setters for SCNMatrix4.Column[0-3] for legacy Xamarin to match the .NET API. * Add CreateFromColumns methods for legacy Xamarin to match the .NET API. * Add tests for all the new API. Fixes xamarin#4652.
This comment has been minimized.
This comment has been minimized.
src/SceneKit/SCNMatrix4_dotnet.cs
Outdated
pfloat d = -(2.0f * zFar * zNear) / (zFar - zNear); | ||
|
||
result = new SCNMatrix4 (x, 0, 0, 0, | ||
0, y, 0, 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing looks maybe different than desired
src/SceneKit/SCNMatrix4_dotnet.cs
Outdated
SCNVector3 y = SCNVector3.Normalize (SCNVector3.Cross (z, x)); | ||
|
||
SCNMatrix4 rot = new SCNMatrix4 (new SCNVector4 (x.X, y.X, z.X, 0.0f), | ||
new SCNVector4 (x.Y, y.Y, z.Y, 0.0f), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small possible spacing issues, but else good with me!
CC @mattleibow in case this affects MAUI |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator diffℹ️ Generator Diff (please review changes) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results3 tests failed, 145 tests passed.Failed tests
Pipeline on Agent XAMBOT-1096.BigSur' |
Test failures are unrelated:
|
as required (doing it with conditional compilation in the same file turned out
to be quite messy, so I opted for using different files for legacy Xamarin and
.NET).
.NET instead), because the legacy Xamarin version showed strange results with
some test values.
Fixes #4652.