1 #ifndef MESH_IO_LA_H_INCLUDED
2 #define MESH_IO_LA_H_INCLUDED
9 *
\e$B@~7ABe?t
\e(B(Linear Algebra)
20 Vector2(float _x, float _y)
25 inline std::ostream &operator<<(std::ostream &os, const Vector2 &rhs)
28 << '[' << rhs.x << ',' << rhs.y << ']';
42 Vector3(float _x, float _y, float _z)
46 bool operator==(const Vector3 &rhs)const
48 return x==rhs.x && y==rhs.y && z==rhs.z;
51 Vector3 operator+(const Vector3 &rhs)
53 return Vector3(x+rhs.x, y+rhs.y, z+rhs.z);
57 inline std::ostream &operator<<(std::ostream &os, const Vector3 &rhs)
60 << '[' << rhs.x << ',' << rhs.y << ',' << rhs.z << ']';
75 Vector4(float _x, float _y, float _z, float _w)
76 : x(_x), y(_y), z(_z), w(_w)
80 inline std::ostream &operator<<(std::ostream &os, const Vector4 &rhs)
83 << '[' << rhs.x << ',' << rhs.y << ',' << rhs.z << ',' << rhs.w << ']';
98 Quaternion(float _x, float _y, float _z, float _w)
99 : x(_x), y(_y), z(_z), w(_w)
102 float dot(const Quaternion &rhs)
104 return x*rhs.x + y*rhs.y + z*rhs.z + w*rhs.w;
108 inline std::ostream &operator<<(std::ostream &os, const Quaternion &rhs)
111 << '[' << rhs.x << ',' << rhs.y << ',' << rhs.z << ',' << rhs.w << ']';
119 #endif // MESH_IO_LA_H_INCLUDED