Exemple #1
0
 public static void Dot(ReadOnlySpan <Vec3> left, ReadOnlySpan <Vec3> right, Span <float> result)
 {
     if (Avx.IsSupported)
     {
         Vector3Avx.Dot(left, right, result);
     }
     else if (Sse.IsSupported)
     {
         Vector3Sse.Dot(left, right, result);
     }
     else
     {
         Vector3Fallbacks.Dot(left, right, result);
     }
 }
Exemple #2
0
 public static void Reflect(ReadOnlySpan <Vec3> vectors, ReadOnlySpan <Vec3> normals, Span <Vec3> result)
 {
     if (Avx.IsSupported)
     {
         Vector3Avx.Reflect(vectors, normals, result);
     }
     else if (Sse.IsSupported)
     {
         Vector3Sse.Reflect(vectors, normals, result);
     }
     else
     {
         Vector3Fallbacks.Reflect(vectors, normals, result);
     }
 }
Exemple #3
0
 public static void Multiply(ReadOnlySpan <Vec3> left, float right, Span <Vec3> result)
 {
     if (Avx.IsSupported)
     {
         Vector3Avx.MultiplyScalar(left, right, result);
     }
     else if (Sse.IsSupported)
     {
         Vector3Sse.MultiplyScalar(left, right, result);
     }
     else
     {
         Vector3Fallbacks.MultiplyAllScalar(left, right, result);
     }
 }
Exemple #4
0
 public static void Cross(ReadOnlySpan <Vec3> left, ReadOnlySpan <Vec3> right, Span <Vec3> result)
 {
     if (Avx.IsSupported)
     {
         Vector3Avx.Cross(left, right, result);
     }
     else if (Sse.IsSupported)
     {
         Vector3Sse.Cross(left, right, result);
     }
     else
     {
         Vector3Fallbacks.Cross(left, right, result);
     }
 }
Exemple #5
0
 public static void Normalize(ReadOnlySpan <Vec3> vectors, Span <Vec3> result)
 {
     if (Avx2.IsSupported)
     {
         Vector3Avx.NormalizeAvx2(vectors, result);
     }
     else if (Avx.IsSupported)
     {
         Vector3Avx.Normalize(vectors, result);
     }
     else if (Sse.IsSupported)
     {
         Vector3Sse.Normalize(vectors, result);
     }
     else
     {
         Vector3Fallbacks.Normalize(vectors, result);
     }
 }