Add a probe screen to panel
[clinton/Smoothieware.git] / src / libs / Vector3.cpp
index bc9cda5..3129893 100644 (file)
@@ -17,6 +17,23 @@ Vector3::Vector3(float a, float b, float c)
     elem[2] = c;
 }
 
+Vector3::Vector3(const Vector3 &to_copy)
+{
+    elem[0] = to_copy.elem[0];
+    elem[1] = to_copy.elem[1];
+    elem[2] = to_copy.elem[2];
+}
+
+Vector3& Vector3::operator= (const Vector3 &to_copy)
+{
+    if( this != &to_copy ) {
+        elem[0] = to_copy.elem[0];
+        elem[1] = to_copy.elem[1];
+        elem[2] = to_copy.elem[2];
+    }
+    return *this;
+}
+
 float Vector3::operator[](int i) const
 {
     if (i >= 0 && i <= 2)
@@ -24,6 +41,13 @@ float Vector3::operator[](int i) const
     return nan;
 }
 
+void Vector3::set(float a, float b, float c)
+{
+    elem[0] = a;
+    elem[1] = b;
+    elem[2] = c;
+}
+
 Vector3 Vector3::cross(const Vector3 &vec) const
 {
     Vector3 out;