Exemplo n.º 1
0
 /// <summary>
 /// The maximum value between each component in vectors.
 /// </summary>
 public void Max(Vector3i v)
 {
     x = Math.Max(x, v.x);
     y = Math.Max(y, v.y);
     z = Math.Max(z, v.z);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Clamp the each component to specified min and max.
 /// </summary>
 public void Clamp(Vector3i min, Vector3i max)
 {
     x = Math.Max(Math.Min(x, max.x), min.x);
     y = Math.Max(Math.Min(y, max.y), min.y);
     z = Math.Max(Math.Min(z, max.z), min.z);
 }
Exemplo n.º 3
0
 /// <summary>
 /// The minimum value between each component in vectors.
 /// </summary>
 public void Min(Vector3i v)
 {
     x = Math.Min(x, v.x);
     y = Math.Min(y, v.y);
     z = Math.Min(z, v.z);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Distance between two vectors.
 /// </summary>
 public static double Distance(Vector3i v0, Vector3i v1)
 {
     return(Math.Sqrt(SqrDistance(v0, v1)));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Cross two vectors.
 /// </summary>
 public static Vector3i Cross(Vector3i v0, Vector3i v1)
 {
     return(new Vector3i(v0.y * v1.z - v0.z * v1.y, v0.z * v1.x - v0.x * v1.z, v0.x * v1.y - v0.y * v1.x));
 }
Exemplo n.º 6
0
 /// <summary>
 /// The dot product of two vectors.
 /// </summary>
 public static int Dot(Vector3i v0, Vector3i v1)
 {
     return(v0.x * v1.x + v0.y * v1.y + v0.z * v1.z);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Are these vectors equal.
 /// </summary>
 public bool Equals(Vector3i v)
 {
     return(this == v);
 }