26 #include <boost/operators.hpp>
41 private boost::equality_comparable<Vec3>,
42 private boost::additive<Vec3>,
43 private boost::additive<Vec3, Real>,
44 private boost::multiplicative<Vec3, Real>
48 Vec3(): x(0), y(0), z(0) {}
54 Vec3(
const Vec3& v): x(v.x), y(v.y), z(v.z) { }
69 explicit Vec3(
const double v[3]): x(v[0]), y(v[1]), z(v[2]) { }
72 explicit Vec3(
const float v[3]): x(v[0]), y(v[1]), z(v[2]) { }
86 return x==rhs.
x && y==rhs.
y && z==rhs.
z;
90 Real& operator[](std::size_t indx)
93 throw std::out_of_range(
"Index must be in the range [0-2]");
99 const Real& operator[](std::size_t indx)
const
102 throw std::out_of_range(
"Index must be in the range [0-2]");
150 return Vec3(-x, -y, -z);
182 Vec3 nrvo(d/v[0],d/v[1],d/v[2]);
188 os <<
"[" << v.
x <<
", " << v.
y <<
", " << v.
z <<
"]";
211 base_type::operator=(rhs);
214 Mat3 GetInertia()
const;
216 Vec3 GetCenter()
const;
218 Mat3 GetPrincipalAxes()
const;