Unity-Technologies / Unity.Mathematics

The C# math library used in Unity providing vector types and math functions with a shader like syntax
Other
1.38k stars 156 forks source link

Affine transform #212

Closed oldio closed 2 years ago

oldio commented 2 years ago

Adding affine transform type

unpacklo commented 2 years ago

@oldio is there a .csproj file update for the Unity.Mathematics solution?

When I try to build and run the Burst tests (in their repo), it complains that it can't find AffineTransform and I suspect it's because the solution doesn't know about the new file.

/Users/dale/code/burst/ext/Unity.Mathematics/src/Tests/Tests/Shared/TestAffineTransform.cs(16,13): error CS0246: The type or namespace name 'AffineTransform' could not be found (are you missing a using directive or an assembly reference?) [/Users/dale/code/burst/src/Burst.Compiler.IL.Tests/Burst.Compiler.IL.Tests.csproj]
/Users/dale/code/burst/ext/Unity.Mathematics/src/Tests/Tests/Shared/TestAffineTransform.cs(16,34): error CS0103: The name 'AffineTransform' does not exist in the current context [/Users/dale/code/burst/src/Burst.Compiler.IL.Tests/Burst.Compiler.IL.Tests.csproj]
oldio commented 2 years ago

@oldio is there a .csproj file update for the Unity.Mathematics solution?

Fixed in https://github.com/Unity-Technologies/Unity.Mathematics/pull/212/commits/84a8c6aad160980dd26846ed42faa72722769f36

unpacklo commented 2 years ago

@jo-unity could you give this a documentation review?

unpacklo commented 2 years ago

Looks good to me - this seems like a really useful api addition - I wonder if this could be a potential one to add to the list for writing some supporting user manual content for @unpacklo ? might be useful to get some more detailed examples / workflows of where you would want to use this in a real game :)

Yes, for sure! I'm working on making some more types in Unity.Mathematics public so they can actually be used and one thing I'm doing is making small samples to illustrate their use. I'm planning on doing something similar for the recent PRs we've had for the singular value decomposition and the new code in this PR.