7#include <Common/assertion.h>
24 return vA * wA + vB * wB + vC * wC;
30 const T oneMinusT = 1 - parametricT;
31 return TVector3(vA.
x() * oneMinusT + vB.
x() * parametricT,
32 vA.
y() * oneMinusT + vB.
y() * parametricT,
33 vA.
z() * oneMinusT + vB.
z() * parametricT);
38 Base(
std::array<T, 3>{vx, vy, vz})
45 static_cast<T>(other.x()),
46 static_cast<T>(other.y()),
47 static_cast<T>(other.z()))
56 return TVector3(result.
x(), result.
y(), result.
z());
63 PH_ASSERT(out_result);
64 PH_ASSERT(out_result !=
this);
69 out_result->
x() = result.
x();
70 out_result->
y() = result.
y();
71 out_result->
z() = result.
z();
78 z() * rhs.
x() - x() * rhs.
z(),
79 x() * rhs.
y() - y() * rhs.
x());
86 PH_ASSERT(out_result);
87 PH_ASSERT(out_result !=
this);
89 out_result->
x() = y() * rhs.
z() - z() * rhs.
y();
90 out_result->
y() = z() * rhs.
x() - x() * rhs.
z();
91 out_result->
z() = x() * rhs.
y() - y() * rhs.
x();
98 x() = x() * multiplier + adder.
x();
99 y() = y() * multiplier + adder.
y();
100 z() = x() * multiplier + adder.
z();
109 return this->sub(result);
115 const T factor = 2 * normal.
dot(*
this);
117 x() -= factor * normal.
x();
118 y() -= factor * normal.
y();
119 z() -= factor * normal.
z();
127 PH_ASSERT(out_result);
128 PH_ASSERT(out_result !=
this);
136 out_result->
z() = x();
140 out_result->
x() = y();
141 out_result->
y() = z();
145 out_result->
x() = z();
146 out_result->
y() = y();
151 out_result->
z() = z();
152 out_result->
y() = x();
153 out_result->
x() = y();
160 out_result->
x() = x();
164 out_result->
z() = y();
165 out_result->
y() = z();
169 out_result->
z() = z();
170 out_result->
y() = y();
175 out_result->
x() = z();
176 out_result->
y() = x();
177 out_result->
z() = y();
Represents a quaternion.
Definition TQuaternion.h:17
TQuaternion conjugate() const
Definition TQuaternion.ipp:173
T & x()
Definition TQuaternion.ipp:95
TQuaternion & mulLocal(const TQuaternion &rhs)
Definition TQuaternion.ipp:204
T & z()
Definition TQuaternion.ipp:107
TQuaternion mul(const TVector3< T > &xyz) const
Quaternion multiplication (treating the input's w component as 0).
Definition TQuaternion.ipp:143
T & y()
Definition TQuaternion.ipp:101
Represents a 3-D vector.
Definition TVector3.h:17
T & y()
Definition TVector3.ipp:189
TVector3 & maddLocal(T multiplier, const TVector3 &adder)
Definition TVector3.ipp:95
T & z()
Definition TVector3.ipp:195
TVector3 & reflectLocal(const TVector3 &normal)
Definition TVector3.ipp:113
T & x()
Definition TVector3.ipp:183
void sort(TVector3 *out_result) const
Definition TVector3.ipp:125
TVector3 rotate(const TQuaternion< T > &rotation) const
Definition TVector3.ipp:51
TVector3(T vx, T vy, T vz)
Definition TVector3.ipp:37
static TVector3 weightedSum(const TVector3 &vA, T wA, const TVector3 &vB, T wB, const TVector3 &vC, T wC)
Definition TVector3.ipp:19
static TVector3 lerp(const TVector3 &vA, const TVector3 &vB, T parametricT)
Definition TVector3.ipp:28
T & r()
Definition TVector3.ipp:219
TVector3 reflect(const TVector3 &normal) const
Definition TVector3.ipp:106
T & b()
Definition TVector3.ipp:231
T & g()
Definition TVector3.ipp:225
TVector3 cross(const TVector3 &rhs) const
Definition TVector3.ipp:75
Derived mul(const Derived &rhs) const
Definition TArithmeticArrayBase.ipp:98
T dot(const Derived &rhs) const
Definition TVectorNBase.ipp:14
Miscellaneous math utilities.
Math functions and utilities.
Definition TransformInfo.h:10