Go to the documentation of this file.
7 #ifndef _VECTOR3DEFAULT_MAL_DEFAULT_
8 #define _VECTOR3DEFAULT_MAL_DEFAULT_
16 template<
typename T,
bool normOptimization>
68 template<
typename T,
bool normOptimization>
69 struct Vector3T :
protected Norm<T, normOptimization>
77 template<
class Archive>
95 void Set(
const T & x,
const T & y,
const T & z)
104 void Set(
const T *
const p)
141 return ((i == 0) ?
m_x : (i == 1) ?
m_y :
m_z);
147 return ((i == 0) ?
m_x : (i == 1) ?
m_y :
m_z);
154 return ((i == 0) ?
m_x : (i == 1) ?
m_y :
m_z);
161 return ((v.m_x ==
m_x) && (v.m_y ==
m_y) && (v.m_z ==
m_z));
169 vr.m_x =
m_x + v.m_x;
170 vr.m_y =
m_y + v.m_y;
171 vr.m_z =
m_z + v.m_z;
180 vr.m_x =
m_x - v.m_x;
181 vr.m_y =
m_y - v.m_y;
182 vr.m_z =
m_z - v.m_z;
222 return m_x * v.m_x +
m_y * v.m_y +
m_z * v.m_z;
315 return ((
m_x == 0) && (
m_y == 0) && (
m_z == 0));
323 vr.m_x =
m_y * v2.m_z - v2.m_y *
m_z;
324 vr.m_y =
m_z * v2.m_x - v2.m_z *
m_x;
325 vr.m_z =
m_x * v2.m_y - v2.m_x *
m_y;
331 os << v.m_x <<
" " << v.m_y <<
" " << v.m_z <<
" ";
bool normOutdated() const
Definition: SmallVector3T.h:61
Vector3T< T, normOptimization > Vector
Definition: SmallVector3T.h:74
Vector3T operator/(const T &t) const
Definition: SmallVector3T.h:244
bool IsZero() const
Definition: SmallVector3T.h:313
Vector3T(const T *const p)
Definition: SmallVector3T.h:93
void operator+=(const struct Vector3T< T, b > &v)
Definition: SmallVector3T.h:188
T m_z
Definition: SmallVector3T.h:72
void Set(const T *const p)
Definition: SmallVector3T.h:104
Vector3T(const T &x, const T &y, const T &z)
Definition: SmallVector3T.h:91
void outdateNorm()
Definition: SmallVector3T.h:32
friend std::ostream & operator<<(std::ostream &os, Vector3T< T, normOptimization > const &v)
Definition: SmallVector3T.h:329
const T & operator[](unsigned i) const
Definition: SmallVector3T.h:145
Vector3T operator*(const T &t) const
Definition: SmallVector3T.h:209
T normsquared() const
Definition: SmallVector3T.h:308
T m_x
Definition: SmallVector3T.h:72
T norm() const
Definition: SmallVector3T.h:290
Vector3T & operator=(const struct Vector3T< T, b > &v)
Definition: SmallVector3T.h:121
bool normOutdated() const
Definition: SmallVector3T.h:37
bool operator==(const struct Vector3T< T, b > &v) const
Definition: SmallVector3T.h:159
Vector3T operator^(const Vector3T< T, b > &v2) const
Definition: SmallVector3T.h:320
Vector3T operator-(const struct Vector3T< T, b > &v) const
Definition: SmallVector3T.h:177
T getNorm() const
Definition: SmallVector3T.h:42
T operator*(const Vector3T< T, b > &v) const
Definition: SmallVector3T.h:220
void setNorm(const T &n)
Definition: SmallVector3T.h:52
void Set(const T &x, const T &y, const T &z)
Definition: SmallVector3T.h:95
void operator-=(const struct Vector3T< T, b > &v)
Definition: SmallVector3T.h:199
Vector3T operator*(const Matrix3x3T< T > &m) const
Definition: SmallVector3T.h:226
void normalize()
Definition: SmallVector3T.h:272
T norm_
Definition: SmallVector3T.h:20
T m_y
Definition: SmallVector3T.h:72
void setNorm(const T &n)
Definition: SmallVector3T.h:26
Vector3T normalized() const
Definition: SmallVector3T.h:282
void outdateNorm()
Definition: SmallVector3T.h:59
T & operator[](unsigned i)
Definition: SmallVector3T.h:138
Definition: QuaternionT.h:6
T getNorm() const
Definition: SmallVector3T.h:54
Vector3T operator+(const struct Vector3T< T, b > &v) const
Definition: SmallVector3T.h:166
T & operator()(unsigned i)
Definition: SmallVector3T.h:151
Vector3T()
Definition: SmallVector3T.h:89
void operator/=(const T &t)
Definition: SmallVector3T.h:263
Definition: SmallMatrix3x3T.h:14
Vector3T operator-() const
Definition: SmallVector3T.h:132
Norm()
Definition: SmallVector3T.h:24
T optimizedNorm()
Definition: SmallVector3T.h:296
bool normOutdated_
Definition: SmallVector3T.h:21
void operator*=(const Matrix3x3T< T > m)
Definition: SmallVector3T.h:234
Definition: SmallMatrix3x3T.h:20
void operator*=(const T &t)
Definition: SmallVector3T.h:254
Definition: SmallVector3T.h:17
void serialize(Archive &ar, const unsigned int)
Definition: SmallVector3T.h:78
Vector3T(const struct Vector3T< T, b > &v)
Definition: SmallVector3T.h:115