7#pragma option push pack(1)
431 return {c * quat.
w(), c * quat.
x(), c * quat.
y(), c * quat.
z()};
460 constexpr auto delimiter =
')';
461 std::getline(is, s, delimiter);
462 quat.fromString(s.append(1, delimiter));
469#include <math/TQuaternion.hpp>
Generic 4 x 4 matrix template.
Definition TMatrix44.h:38
Generic type Quaternion.
Definition TQuaternion.h:14
const T & operator[](size_t) const
Array access const operator to the elements.
TQuaternion & normalize()
Normalizes this instance.
union sf::TQuaternion::data_type _data
bool operator==(const TQuaternion &) const
operator.
EElement
Enumerate for identifying a matrix axis.
Definition TQuaternion.h:65
@ imagY
Y imaginary part of the quaternion.
Definition TQuaternion.h:71
@ imagX
X imaginary part of the quaternion.
Definition TQuaternion.h:69
@ realW
Translation axis of the matrix.
Definition TQuaternion.h:67
@ imagZ
Z imaginary part of the quaternion.
Definition TQuaternion.h:73
bool isEqual(const TQuaternion &quat, T tol=tolerance) const
Compares the passed quaternion within the set tolerance.
TQuaternion(const TQuaternion &)
Copy Constructor.
TQuaternion conjugate() const
Gets a copy of this instance where the imaginary (vector) part of a quaternion is negated....
TQuaternion(T real_w, T imag_x, T imag_y, T imag_z)
Initializing constructor for 4 element parts.
T y() const
Get the imaginary Y-part of this instance.
TQuaternion & operator^=(const TQuaternion &)
operator.
TVector3D< T > transform(TVector3D< T > v) const
Transforms a 3D-vector not using the quaternion directly instead of a matrix.
TQuaternion & operator*=(const TQuaternion &)
Multiplication assignment operator.
TQuaternion & operator/=(const TQuaternion &)
Division assignment operator.
TQuaternion & fromMatrix(const T[4][4])
Transforms a rotation matrix to this Quaternion. Throws an exception when the passed matrix is not a ...
T x() const
Get the imaginary X-part of this instance.
TMatrix44< T > toMatrix(TMatrix44< T > &) const
Sets the orientation part of the passed TMatrix instance.
TQuaternion()=default
Default Constructor.
TQuaternion exp() const
Gets the exponential of a quaternion which is the inverse of log(). Moves back from the logarithmic f...
TQuaternion interpolateLogarithmic(const TQuaternion &q, T t) const
Implements a logarithmic interpolation function.
TQuaternion(T real, const TVector3D< T > &imag)
Initializing constructor is used in operators and sets the member variables directly.
TQuaternion & assign(T real_w, T imag_x, T imag_y, T imag_z)
Assigns of another instance elements.
std::string toString() const
Gets the string representation of the quaternion formed like '(x,y,z,r)'.
T z() const
Get the imaginary Z-part of this instance.
TQuaternion & operator*=(T c)
Multiplication assignment operator.
T magnitude() const
Gets the magnitude of this quaternion. The magnitude (or norm) of a quaternion q=a+bi+cj+dk,...
TQuaternion log() const
Gets the logarithm form of this instance. The logarithm log(q) of a quaternion is a mathematical oper...
TQuaternion operator/(T) const
operator.
TQuaternion operator-() const
Negation operator.
TQuaternion(const TVector3D< T > &axis, T angle)
Constructor for creating rotations by specifying the angle of rotation and the axis around which to r...
T w() const
Gets the w or real part of this instance. Same as real() method.
T & operator[](size_t)
Array access operator.
T & y()
Get the imaginary Y-part reference of this instance.
T real() const
Gets the real part of this instance.
TQuaternion & fromString(const std::string &s) noexcept(false)
Gets the quaternion values from the string representation formed like '(1,2,3,4)'....
T & real()
Gets the real part reference of this instance.
TQuaternion & invert()
Turns this instance into it inverse.
T value_type
Type declaration of the coordinate storage values.
Definition TQuaternion.h:19
TQuaternion & operator+=(const TQuaternion &)
Addition assignment operator.
TVector3D< T > imaginary() const
Get the imaginary part as a 3D-vector.
T & z()
Get the imaginary Z-part reference of this instance.
T magnitudeSqr() const
Gets the squared magnitude which is used in computations and the magnitude() method for the actual ma...
static constexpr auto tolerance
Tolerance for when comparing in the equal operator.
Definition TQuaternion.h:350
TQuaternion normalized() const
Get a normalizes copy of this instance.
TQuaternion squared() const
Squares this instance. If the quaternion is a unit quaternion (meaning it has magnitude 1),...
TQuaternion & operator=(const TQuaternion &)
Assignment operator.
TQuaternion operator*(T) const
Pointer cast operator.
T & w()
Gets the w or real part reference of this instance. Same as real() method.
bool operator!=(const TQuaternion &) const
operator.
TQuaternion & assign(const TQuaternion &)
Assigns of another instance elements.
TMatrix44< T > toMatrix() const
Get the matrix having only the orientation part set using this instance normalized version....
TQuaternion interpolate(const TQuaternion &q, T t) const
Spherical Linear Interpolation (SLERP) function. Used to smoothly blending or transitioning between t...
TQuaternion inverse() const
Gets the inverse of the current instance. The inverse of a quaternion is a quaternion that "reverses"...
TQuaternion & operator/=(T c)
Division operator.
T & x()
Get the imaginary X-part reference of this instance.
TQuaternion & operator-=(const TQuaternion &)
Subtraction assignment operator.
3-dimensional vector for math operations.
Definition TVector3D.h:17
Definition Application.h:10
_GII_FUNC std::istream & operator>>(std::istream &is, ResultData &)
Stream operator for setting up this instance with a setup std::string.
TMatrix44< T > operator*(const TMatrix44< T > &lm, const TMatrix44< T > &rm)
Multiplies to matrices into a single one.
TQuaternion< T > operator/(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Divides two quaternions.
Definition TQuaternion.h:416
TQuaternion< T > operator+(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Adds two quaternions.
Definition TQuaternion.h:377
_GII_FUNC std::ostream & operator<<(std::ostream &os, const ResultData &)
Stream operator for the setup std::string.
TQuaternion< T > operator-(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Subtracts two quaternions.
Definition TQuaternion.h:390
Definition TQuaternion.h:360
T x
Definition TQuaternion.h:362
T y
Definition TQuaternion.h:363
T z
Definition TQuaternion.h:364
T w
Definition TQuaternion.h:361
Storage union of the 3D coordinate making the x,y,z,w accessible as an array.
Definition TQuaternion.h:357
T array[4]
Definition TQuaternion.h:358
struct sf::TQuaternion::data_type::quat_type q