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))); }
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))); }
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))); }
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))); }
/// <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)); }
/// <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)); }