Ejemplo n.º 1
0
 /// <summary>Constructs and initializes a Tuple3i from the specified Tuple3i.</summary>
 /// <remarks>Constructs and initializes a Tuple3i from the specified Tuple3i.</remarks>
 /// <param name="t1">
 /// the Tuple3i containing the initialization x, y, and z
 /// data.
 /// </param>
 public Tuple3i(Tuple3i t1)
 {
     this.x = t1.x;
     this.y = t1.y;
     this.z = t1.z;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the value of this tuple to the difference
 /// of tuples t1 and t2 (this = t1 - t2).
 /// </summary>
 /// <remarks>
 /// Sets the value of this tuple to the difference
 /// of tuples t1 and t2 (this = t1 - t2).
 /// </remarks>
 /// <param name="t1">the first tuple</param>
 /// <param name="t2">the second tuple</param>
 public void Sub(Tuple3i t1, Tuple3i t2)
 {
     this.x = t1.x - t2.x;
     this.y = t1.y - t2.y;
     this.z = t1.z - t2.z;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets the value of this tuple to the difference
 /// of itself and t1 (this = this - t1).
 /// </summary>
 /// <remarks>
 /// Sets the value of this tuple to the difference
 /// of itself and t1 (this = this - t1).
 /// </remarks>
 /// <param name="t1">the other tuple</param>
 public void Sub(Tuple3i t1)
 {
     this.x -= t1.x;
     this.y -= t1.y;
     this.z -= t1.z;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets the value of this tuple to the scalar multiplication
 /// of itself and then adds tuple t1 (this = s*this + t1).
 /// </summary>
 /// <remarks>
 /// Sets the value of this tuple to the scalar multiplication
 /// of itself and then adds tuple t1 (this = s*this + t1).
 /// </remarks>
 /// <param name="s">the scalar value</param>
 /// <param name="t1">the tuple to be added</param>
 public void ScaleAdd(int s, Tuple3i t1)
 {
     this.x = s * this.x + t1.x;
     this.y = s * this.y + t1.y;
     this.z = s * this.z + t1.z;
 }
Ejemplo n.º 5
0
 /// <summary>Sets the value of this tuple to the value of tuple t1.</summary>
 /// <remarks>Sets the value of this tuple to the value of tuple t1.</remarks>
 /// <param name="t1">the tuple to be copied</param>
 public void Set(Tuple3i t1)
 {
     this.x = t1.x;
     this.y = t1.y;
     this.z = t1.z;
 }
Ejemplo n.º 6
0
 /// <summary>Sets the value of this tuple to the negation of tuple t1.</summary>
 /// <remarks>Sets the value of this tuple to the negation of tuple t1.</remarks>
 /// <param name="t1">the source tuple</param>
 public void Negate(Tuple3i t1)
 {
     this.x = -t1.x;
     this.y = -t1.y;
     this.z = -t1.z;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Sets the value of this tuple to the scalar multiplication
 /// of tuple t1.
 /// </summary>
 /// <remarks>
 /// Sets the value of this tuple to the scalar multiplication
 /// of tuple t1.
 /// </remarks>
 /// <param name="s">the scalar value</param>
 /// <param name="t1">the source tuple</param>
 public void Scale(int s, Tuple3i t1)
 {
     this.x = s * t1.x;
     this.y = s * t1.y;
     this.z = s * t1.z;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Clamps the minimum value of the tuple parameter to the min
 /// parameter and places the values into this tuple.
 /// </summary>
 /// <remarks>
 /// Clamps the minimum value of the tuple parameter to the min
 /// parameter and places the values into this tuple.
 /// </remarks>
 /// <param name="min">the lowest value in the tuple after clamping</param>
 /// <param name="t">the source tuple, which will not be modified</param>
 public void ClampMin(int min, Tuple3i t)
 {
     if (t.x < min)
     {
         x = min;
     }
     else
     {
         x = t.x;
     }
     if (t.y < min)
     {
         y = min;
     }
     else
     {
         y = t.y;
     }
     if (t.z < min)
     {
         z = min;
     }
     else
     {
         z = t.z;
     }
 }
Ejemplo n.º 9
0
 /// <summary>Copies the values of this tuple into the tuple t.</summary>
 /// <remarks>Copies the values of this tuple into the tuple t.</remarks>
 /// <param name="t">is the target tuple</param>
 public void Get(Tuple3i t)
 {
     t.x = this.x;
     t.y = this.y;
     t.z = this.z;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Clamps the maximum value of the tuple parameter to the max
 /// parameter and places the values into this tuple.
 /// </summary>
 /// <remarks>
 /// Clamps the maximum value of the tuple parameter to the max
 /// parameter and places the values into this tuple.
 /// </remarks>
 /// <param name="max">the highest value in the tuple after clamping</param>
 /// <param name="t">the source tuple, which will not be modified</param>
 public void ClampMax(int max, Tuple3i t)
 {
     if (t.x > max)
     {
         x = max;
     }
     else
     {
         x = t.x;
     }
     if (t.y > max)
     {
         y = max;
     }
     else
     {
         y = t.y;
     }
     if (t.z > max)
     {
         z = max;
     }
     else
     {
         z = t.z;
     }
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Clamps the tuple parameter to the range [low, high] and
 /// places the values into this tuple.
 /// </summary>
 /// <remarks>
 /// Clamps the tuple parameter to the range [low, high] and
 /// places the values into this tuple.
 /// </remarks>
 /// <param name="min">the lowest value in the tuple after clamping</param>
 /// <param name="max">the highest value in the tuple after clamping</param>
 /// <param name="t">the source tuple, which will not be modified</param>
 public void Clamp(int min, int max, Tuple3i t)
 {
     if (t.x > max)
     {
         x = max;
     }
     else
     {
         if (t.x < min)
         {
             x = min;
         }
         else
         {
             x = t.x;
         }
     }
     if (t.y > max)
     {
         y = max;
     }
     else
     {
         if (t.y < min)
         {
             y = min;
         }
         else
         {
             y = t.y;
         }
     }
     if (t.z > max)
     {
         z = max;
     }
     else
     {
         if (t.z < min)
         {
             z = min;
         }
         else
         {
             z = t.z;
         }
     }
 }
Ejemplo n.º 12
0
 /// <summary>Sets the value of this tuple to the sum of itself and t1.</summary>
 /// <remarks>Sets the value of this tuple to the sum of itself and t1.</remarks>
 /// <param name="t1">the other tuple</param>
 public void Add(Tuple3i t1)
 {
     this.x += t1.x;
     this.y += t1.y;
     this.z += t1.z;
 }
Ejemplo n.º 13
0
 /// <summary>Sets the value of this tuple to the sum of tuples t1 and t2.</summary>
 /// <remarks>Sets the value of this tuple to the sum of tuples t1 and t2.</remarks>
 /// <param name="t1">the first tuple</param>
 /// <param name="t2">the second tuple</param>
 public void Add(Tuple3i t1, Tuple3i t2)
 {
     this.x = t1.x + t2.x;
     this.y = t1.y + t2.y;
     this.z = t1.z + t2.z;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Sets each component of the tuple parameter to its absolute
 /// value and places the modified values into this tuple.
 /// </summary>
 /// <remarks>
 /// Sets each component of the tuple parameter to its absolute
 /// value and places the modified values into this tuple.
 /// </remarks>
 /// <param name="t">the source tuple, which will not be modified</param>
 public void Absolute(Tuple3i t)
 {
     x = Math.Abs(t.x);
     y = Math.Abs(t.y);
     z = Math.Abs(t.z);
 }