Пример #1
0
 public static Vector3 Clamp(Vector3 v, Vector3 min, Vector3 max) =>
 new Vector3(
     MathHelpers.Clamp(v.X, min.X, max.X),
     MathHelpers.Clamp(v.Y, min.Y, max.Y),
     MathHelpers.Clamp(v.Z, min.Z, max.Z));
Пример #2
0
 public static Vector3 Lerp(Vector3 v, Vector3 w, float a) =>
 new Vector3(
     MathHelpers.Lerp(v.X, w.X, a),
     MathHelpers.Lerp(v.Y, w.Y, a),
     MathHelpers.Lerp(v.Z, w.Z, a));
Пример #3
0
 public static Vector4 Clamp(Vector4 u, Vector4 min, Vector4 max) =>
 new Vector4(
     MathHelpers.Clamp(u.X, min.X, max.X),
     MathHelpers.Clamp(u.Y, min.Y, max.Y),
     MathHelpers.Clamp(u.Z, min.Z, max.Z),
     MathHelpers.Clamp(u.W, min.W, max.W));
Пример #4
0
 public static Vector4 Lerp(Vector4 u, Vector4 v, float a) =>
 new Vector4(
     MathHelpers.Lerp(u.X, v.X, a),
     MathHelpers.Lerp(u.Y, v.Y, a),
     MathHelpers.Lerp(u.Z, v.Z, a),
     MathHelpers.Lerp(u.W, v.W, a));
Пример #5
0
 public static Vector2 Lerp(Vector2 v, Vector2 w, float a) =>
 new Vector2(
     MathHelpers.Lerp(v.X, w.X, a),
     MathHelpers.Lerp(v.Y, w.Y, a));
Пример #6
0
 public static Vector2 Clamp(Vector2 v, Vector2 min, Vector2 max) =>
 new Vector2(
     MathHelpers.Clamp(v.X, min.X, max.X),
     MathHelpers.Clamp(v.Y, min.Y, max.Y));