MLdouble getScalar() const
Returns the scalar part (w).
Rotation(const Matrix4 &m)
Generates a rotation from a rotation matrix. The result is invalid if the matrix is not a rotation ma...
Vector3 rotate(const Vector3 &vec) const
Rotates the given vector and returns the result vector.
Rotation(const Rotation &)
Copy constructor.
ML_LINEAR_ALGEBRA_EXPORT friend Rotation operator*(const Rotation &a, const Rotation &b)
Multiplies two rotations with each other (see multiply).
void setRotation(const Vector3 &axis, MLdouble angle)
Builds a rotation from an axis axis and an angle angle (in radians).
Rotation()
Initializes this rotation to the identity rotation.
Rotation & conjugate()
Negates the rotation.
static Rotation slerp(const Rotation &rot1, const Rotation &rot2, MLdouble t)
Rotation multiply(const Rotation &rotation) const
Multiplies (concatenates) this rotation with rotation and returns the new rotation.
Rotation & operator*=(const Rotation &rotation)
Multiplies two rotations with each other (see multiply).
Rotation(MLdouble x, MLdouble y, MLdouble z, MLdouble w)
const Vector3 & getVector() const
Returns the vector part (x/y/z).
MLdouble _scalar
The w part of the quaternion.
Matrix4 getMatrix() const
Converts the rotation to a rotation matrix and returns the matrix.
Rotation(const Vector3 &axis, MLdouble angle)
Generates a rotation from axis and angle; the angle is given in radians.
Vector3 _vector
The x,y,z part of the quaternion.
Rotation(const Vector3 &fromVec, const Vector3 &toVec)
Generates a rotation from fromVec to toVec.
static Matrix4 slerp(const Matrix4 &m1, const Matrix4 &m2, MLdouble t)
void getRotation(Vector3 &axis, MLdouble &angle) const
Converts the rotation to an axis axis and and angle angle (in radians).
#define ML_LINEAR_ALGEBRA_EXPORT
Defines all system specific settings for all linear algebra classes.
Tmat4< MLdouble > Matrix4
The standard 4x4 matrix of type double.
Tvec3< MLdouble > Vector3
A vector with three components of type double.