Fixed conditional selection logic in quaternion and SVD math functions by swapping select argument order for correctness. Fixed LookRotationSafe and normalizesafe to return valid quaternions. Corrected SVD helper functions for proper value swapping and safe reciprocal. Added unit tests for matrix, reflection, projection, refraction, quaternion normalization, LookRotationSafe, and SVD operations. Incremented project version to 1.3.3. Minor formatting and using directive updates.
14 lines
525 B
C#
14 lines
525 B
C#
using BenchmarkDotNet.Running;
|
|
using Misaki.HighPerformance.Mathematics;
|
|
using Misaki.HighPerformance.Test.Benchmark;
|
|
|
|
//BenchmarkRunner.Run<SPMDBenchmark>();
|
|
|
|
var faceDirection = math.normalize(float3.zero - new float3(0.0f, 0.0f, 5.0f));
|
|
var test = quaternion.LookRotation(faceDirection, math.up());
|
|
var test2 = quaternion.LookRotationSafe(faceDirection, math.up());
|
|
var rotation = quaternion.EulerXYZ(new float3(0, math.radians(180.0f), 0));
|
|
|
|
Console.WriteLine(test);
|
|
Console.WriteLine(test2);
|
|
Console.WriteLine(rotation); |