No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

091-Matrices.cs 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using NUnit.Framework;
  2. using Unity.Mathematics;
  3. namespace Burst.Compiler.IL.Tests
  4. {
  5. [TestFixture]
  6. internal partial class Matrices
  7. {
  8. [TestCompiler(typeof(ReturnBox))]
  9. public static unsafe void TestIdentityFloat4x4(float4x4* mat)
  10. {
  11. *mat = float4x4.identity;
  12. }
  13. [TestCompiler(typeof(ReturnBox))]
  14. public static unsafe void TestIdentityFloat3x3(float3x3* mat)
  15. {
  16. *mat = float3x3.identity;
  17. }
  18. [TestCompiler(typeof(ReturnBox))]
  19. public static unsafe void TestIdentityFloat2x2(float2x2* mat)
  20. {
  21. *mat = float2x2.identity;
  22. }
  23. [TestCompiler(typeof(ReturnBox))]
  24. public static unsafe void TestLookAt(float4x4* mat)
  25. {
  26. *mat = float4x4.LookAt(new float3(0, 0, 1), new float3(0, 1, 0), new float3(1, 0, 0));
  27. }
  28. private static readonly float4x4 StaticMat = new float4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
  29. [TestCompiler(typeof(ReturnBox))]
  30. public static unsafe void TestStaticLoad(float4x4* mat)
  31. {
  32. *mat = StaticMat;
  33. }
  34. }
  35. }