/// <summary>
 /// Initialization from Vector2i instance.
 /// </summary>
 public Vector4i(Vector2i v)
 {
     x = v.x;
     y = v.y;
     z = 0;
     w = 0;
 }
 /// <summary>
 /// Initialization from Vector2i instance.
 /// </summary>
 public Vector3i(Vector2i v)
 {
     x = v.x;
     y = v.y;
     z = 0;
 }
 /// <summary>
 /// Initialization from Vector2i instance.
 /// </summary>
 public Vector2i(Vector2i v)
 {
     x = v.x;
     y = v.y;
 }
 /// <summary>
 /// Return clamped version of specified vector with min/max range.
 /// </summary>
 /// <param name="value">Source vector.</param>
 /// <param name="min">Min value.</param>
 /// <param name="max">Max value.</param>
 public static Vector2i Clamp(Vector2i value, Vector2i min, Vector2i max)
 {
     return(new Vector2i(Mathf.Clamp(value.x, min.x, max.x), Mathf.Clamp(value.y, min.y, max.y)));
 }
 /// <summary>
 /// Combine new Vector2i from max values of two vectors.
 /// </summary>
 /// <param name="lhs">First vector.</param>
 /// <param name="rhs">Second vector.</param>
 public static Vector2i Max(Vector2i lhs, Vector2i rhs)
 {
     return(new Vector2i(lhs.x > rhs.x ? lhs.x : rhs.x, lhs.y > rhs.y ? lhs.y : rhs.y));
 }
 /// <summary>
 /// Combine new Vector2i from min values of two vectors.
 /// </summary>
 /// <param name="lhs">First vector.</param>
 /// <param name="rhs">Second vector.</param>
 public static Vector2i Min(Vector2i lhs, Vector2i rhs)
 {
     return(new Vector2i(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y));
 }
 /// <summary>
 /// Initialization from Vector2i instance.
 /// </summary>
 public Vector2i(Vector2i v)
 {
     x = v.x;
     y = v.y;
 }
 /// <summary>
 /// Combine new Vector2i from min values of two vectors.
 /// </summary>
 /// <param name="lhs">First vector.</param>
 /// <param name="rhs">Second vector.</param>
 public static Vector2i Min(Vector2i lhs, Vector2i rhs)
 {
     return new Vector2i (lhs.x < rhs.x ? lhs.x : rhs.x, lhs.y < rhs.y ? lhs.y : rhs.y);
 }
 /// <summary>
 /// Combine new Vector2i from max values of two vectors.
 /// </summary>
 /// <param name="lhs">First vector.</param>
 /// <param name="rhs">Second vector.</param>
 public static Vector2i Max(Vector2i lhs, Vector2i rhs)
 {
     return new Vector2i (lhs.x > rhs.x ? lhs.x : rhs.x, lhs.y > rhs.y ? lhs.y : rhs.y);
 }
 /// <summary>
 /// Return clamped version of specified vector with min/max range.
 /// </summary>
 /// <param name="value">Source vector.</param>
 /// <param name="min">Min value.</param>
 /// <param name="max">Max value.</param>
 public static Vector2i Clamp(Vector2i value, Vector2i min, Vector2i max)
 {
     return new Vector2i (Mathf.Clamp (value.x, min.x, max.x), Mathf.Clamp (value.y, min.y, max.y));
 }
Esempio n. 11
0
 /// <summary>
 /// Is specified point contains in bounds.
 /// </summary>
 /// <param name="point">Point</param>
 public bool Contains(Vector2i point)
 {
     return(point.x >= Min.x && point.x <= Max.x && point.y >= Min.y && point.y <= Max.y);
 }
Esempio n. 12
0
 public Bounds2i(Vector2i min, Vector2i max)
 {
     Min = min;
     Max = max;
     Validate();
 }
 /// <summary>
 /// Initialization from Vector2i instance.
 /// </summary>
 public Vector3i(Vector2i v)
 {
     x = v.x;
     y = v.y;
     z = 0;
 }