|
@@ -200,6 +200,19 @@ namespace CommonLang.Geometry
|
|
|
|
|
|
#region Public Methods
|
|
|
|
|
|
+ public void Set(float x, float y, float z)
|
|
|
+ {
|
|
|
+ this.X = x;
|
|
|
+ this.Y = y;
|
|
|
+ this.Z = z;
|
|
|
+ }
|
|
|
+ public void Set(Vector3 vec)
|
|
|
+ {
|
|
|
+ this.X = vec.X;
|
|
|
+ this.Y = vec.Y;
|
|
|
+ this.Z = vec.Z;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Performs vector addition on <paramref name="value1"/> and <paramref name="value2"/>.
|
|
|
/// </summary>
|
|
@@ -509,6 +522,11 @@ namespace CommonLang.Geometry
|
|
|
Z == other.Z;
|
|
|
}
|
|
|
|
|
|
+ public bool Equal(Vector3 other, float precision)
|
|
|
+ {
|
|
|
+ return Math.Abs(X - other.X) < precision && Math.Abs(Y - other.Y) < precision && Math.Abs(Z - other.Z) < precision;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Gets the hash code of this <see cref="Vector3"/>.
|
|
|
/// </summary>
|