Esempio n. 1
0
 public static V SmoothStep <V> (float edgeLower, float edgeUpper, V vec)
     where V : struct, IVec <V, float>
 {
     return(vec.Map <V, float> (a => FMath.SmoothStep(edgeLower, edgeUpper, a)));
 }
Esempio n. 2
0
 public static V Step <V> (float edge, V vec)
     where V : struct, IVec <V, float>
 {
     return(vec.Map <V, float> (a => FMath.Step(edge, a)));
 }
Esempio n. 3
0
 public static V Mix <V> (this V vec, V other, float interPos)
     where V : struct, IVec <V, float>
 {
     return(vec.Map2 <V, float> (other, (x, y) => FMath.Mix(x, y, interPos)));
 }
Esempio n. 4
0
 public static V Clamp <V> (this V vec, int min, int max)
     where V : struct, IVec <V, int>
 {
     return(vec.Map <V, int> (a => FMath.Clamp(a, min, max)));
 }
Esempio n. 5
0
 /// <summary>
 /// The angle of the vector in XZ-plane. I.e. the angle of rotation around Y-axis.
 /// </summary>
 public static float YRotation(this Vec3 vec)
 {
     return(FMath.Atan2(vec.X, vec.Z));
 }
Esempio n. 6
0
 /// <summary>
 /// The angle of the vector in YZ-plane. I.e. the angle of rotation around X-axis.
 /// </summary>
 public static float XRotation(this Vec3 vec)
 {
     return(FMath.Atan2(-vec.Y, vec.Z));
 }