28 * @param [in] a The Position X.
29 * @param [in] b The Position Y.
30 * @param [in] c The Position Z.
32 public Position(float a, float b, float c)
43 * @param [in] o The Vector Position X, Y, Z.
45 public Position(Vector3 o)
52 ///< name "X", type float (Position X value)
60 ///< name "Y", type float (Position Y value)
68 ///< name "Z", type float (Position Z value)
80 * @param [in] l The Position to add.
81 * @param [in] r The Position to add
82 * @return A reference to this
84 public static Position operator +(Position l, Position r)
86 return new Position(l.X + r.X, l.Y + r.Y, l.Z + r.Z);
93 * @param [in] l The Position to substract.
94 * @param [in] r The Position to substract
95 * @return A reference to this
97 public static Position operator -(Position l, Position r)
99 return new Position(l.X - r.X, l.Y - r.Y, l.Z - r.Z);
106 * @param [in] a The Position to multiply.
107 * @param [in] b The constant to multiply of type double.
108 * @return A reference to this
110 public static Position operator *(Position a, double b)
112 return new Position((int)(a.X * b), (int)(a.Y * b), (int)(a.Z * b));
119 * @param [in] a The Position to divide.
120 * @param [in] b The Position to divide
121 * @return float value of division operation
123 public static float operator /(Position a, Position b)
125 return (float)System.Math.Sqrt((a.X / b.X) * (a.Y / b.Y) * (a.Z / b.Z));
132 * @param [in] a The Position object to compare.
133 * @param [in] b The Position object to compare.
134 * @return bool, whether Position are equal or not
136 public static bool operator == (Position a, Position b)
138 return a.X == b.X && a.Y == b.Y && a.Z == b.Z;
145 * @param [in] a The Position object to compare.
146 * @param [in] b The Position object to compare.
147 * @return bool, whether Position are equal or not
149 public static bool operator != (Position a, Position b)
151 return a.X != b.X || a.Y != b.Y || a.Z == b.Z;
158 * @return int, hascode of position
160 public override int GetHashCode()
162 return base.GetHashCode();
169 * @return Position object
171 public Position Clone()
173 Position copy = new Position(X, Y, Z);
177 // User-defined conversion from Position to Vector3
178 public static implicit operator Vector3(Position pos)
180 return new Vector3(pos.x, pos.y, pos.z);
183 public static implicit operator Position(Vector3 vec)
185 return new Position(vec.X, vec.Y, vec.Z);