8#include <Common/assertion.h>
46 m_pos.addLocal({x, y, z});
72 return scale(amount.
x(), amount.
y(), amount.
z());
77 m_scale.mulLocal({x, y, z});
156 PH_ASSERT(out_result);
165 *out_result = translationMatrix.
mul(rotationMatrix).
mul(scaleMatrix);
171 PH_ASSERT(out_result);
180 inverseScaleMatrix.
initScale(inverted.m_scale);
182 *out_result = inverseScaleMatrix.
mul(inverseRotationMatrix).
mul(inverseTranslationMatrix);
189 result.m_pos = m_pos.mul(-1);
190 result.m_rot = m_rot.conjugate();
191 result.m_scale = m_scale.rcp();
198 return std::abs(m_scale.x() - 1) > margin ||
199 std::abs(m_scale.y() - 1) > margin ||
200 std::abs(m_scale.z() - 1) > margin;
206 const T dSxSy = std::abs(m_scale.x() - m_scale.y());
207 const T dSySz = std::abs(m_scale.y() - m_scale.z());
208 const T dSzSx = std::abs(m_scale.z() - m_scale.x());
210 return dSxSy < margin && dSySz < margin && dSzSx < margin;
222 return m_pos == rhs.m_pos &&
223 m_rot == rhs.m_rot &&
224 m_scale == rhs.m_scale;
230 return !(*
this == rhs);
Represents a 4x4 matrix.
Definition TMatrix4.h:17
TMatrix4 mul(const TMatrix4 &rhs) const
Definition TMatrix4.ipp:150
TMatrix4 & initRotation(const TQuaternion< T > &rot)
Definition TMatrix4.ipp:79
TMatrix4 & initScale(T x, T y, T z)
Definition TMatrix4.ipp:116
TMatrix4 & initTranslation(T x, T y, T z)
Definition TMatrix4.ipp:62
Represents a quaternion.
Definition TQuaternion.h:17
TQuaternion & normalizeLocal()
Definition TQuaternion.ipp:159
static TQuaternion makeNoRotation()
Definition TQuaternion.ipp:14
TQuaternion mul(const TVector3< T > &xyz) const
Quaternion multiplication (treating the input's w component as 0).
Definition TQuaternion.ipp:143
Represents a 3-D vector.
Definition TVector3.h:17
T & y()
Definition TVector3.ipp:189
T & z()
Definition TVector3.ipp:195
T & x()
Definition TVector3.ipp:183
Derived normalize() const
Normalize the vector. Notice that normalizing a integer typed vector will result in 0-vector most of ...
Definition TVectorNBase.ipp:50
Miscellaneous math utilities.
Math functions and utilities.
Definition TransformInfo.h:10
T to_radians(const T degrees)
Convert degrees to radians.
Definition math.h:140