OSDN Git Service

fix mqo_import smoothing, mirroring.
[meshio/meshio.git] / include / la.h
index bc6b322..0ef6ee8 100644 (file)
@@ -47,6 +47,16 @@ struct Vector3
        {
                return x==rhs.x && y==rhs.y && z==rhs.z;
        }
+
+       Vector3 operator+(const Vector3 &rhs)
+       {
+               return Vector3(x+rhs.x, y+rhs.y, z+rhs.z);
+       }
+
+       Vector3 operator-(const Vector3 &rhs)
+       {
+               return Vector3(x-rhs.x, y-rhs.y, z-rhs.z);
+       }
 };
 #ifndef SWIG
 inline std::ostream &operator<<(std::ostream &os, const Vector3 &rhs)
@@ -93,6 +103,11 @@ struct Quaternion
        Quaternion(float _x, float _y, float _z, float _w)
                : x(_x), y(_y), z(_z), w(_w)
                {}
+
+       float dot(const Quaternion &rhs)
+       {
+               return x*rhs.x + y*rhs.y + z*rhs.z + w*rhs.w;
+       }
 };
 #ifndef SWIG
 inline std::ostream &operator<<(std::ostream &os, const Quaternion &rhs)