예제 #1
0
 /// <summary>
 /// Clamps the given index value according to Max(Min(clamp, max), min).
 /// </summary>
 /// <param name="value">The value to clamp.</param>
 /// <param name="min">The first argument.</param>
 /// <param name="max">The second argument.</param>
 /// <returns>The clamped value in the interval [min, max].</returns>
 public static Index3 Clamp(Index3 value, Index3 min, Index3 max)
 {
     return(new Index3(
                XMath.Clamp(value.X, min.X, max.X),
                XMath.Clamp(value.Y, min.Y, max.Y),
                XMath.Clamp(value.Z, min.Z, max.Z)));
 }
예제 #2
0
 /// <summary>
 /// Clamps the given index value according to Max(Min(clamp, max), min).
 /// </summary>
 /// <param name="value">The value to clamp.</param>
 /// <param name="min">The first argument.</param>
 /// <param name="max">The second argument.</param>
 /// <returns>The clamped value in the interval [min, max].</returns>
 public static Index2 Clamp(Index2 value, Index2 min, Index2 max)
 {
     return(new Index2(
                XMath.Clamp(value.X, min.X, max.X),
                XMath.Clamp(value.Y, min.Y, max.Y)));
 }
예제 #3
0
 /// <summary>
 /// Clamps the given index value according to Max(Min(clamp, max), min).
 /// </summary>
 /// <param name="value">The value to clamp.</param>
 /// <param name="min">The first argument.</param>
 /// <param name="max">The second argument.</param>
 /// <returns>The clamped value in the interval [min, max].</returns>
 public static Index Clamp(Index value, Index min, Index max)
 {
     return(new Index(XMath.Clamp(value.X, min.X, max.X)));
 }