|
Ocean
|
This class implements a axis-angle rotation using floating point values. More...
#include <Rotation.h>
Public Types | |
| typedef T | Type |
| Definition of the used data type. | |
Public Member Functions | |
| RotationT ()=default | |
| Creates a rotation object with default values so that the rotation represents the identity rotation. | |
| RotationT (const T x, const T y, const T z, const T angle) | |
| Creates a rotation object by four given values. | |
| RotationT (const VectorT3< T > &axis, const T angle) | |
| Creates a rotation object by an axis and the angle. | |
| RotationT (const VectorT3< T > &reference, const VectorT3< T > &offset) | |
| Creates a rotation object based on two given unit vectors. | |
| RotationT (const QuaternionT< T > &quaternion) | |
| Creates a rotation object by a given quaternion rotation. | |
| RotationT (const EulerT< T > &euler) | |
| Creates an angle-axis rotation by a given euler rotation. | |
| RotationT (const SquareMatrixT3< T > &matrix) | |
| Creates a rotation object by a given 3x3 rotation matrix. | |
| RotationT (const HomogenousMatrixT4< T > &transformation) | |
| Creates a rotation object by a given 4x4 transformation matrix. | |
| RotationT (const T *valueArray) | |
| Creates a rotation object by an array with four elements. | |
| void | setAxis (const VectorT3< T > &axis) |
| Sets the axis of the rotation. | |
| void | setAngle (const T angle) |
| Sets the angle of the rotation. | |
| const T * | data () const |
| Returns a pointer to the internal values. | |
| T * | data () |
| Returns a pointer to the internal values. | |
| VectorT3< T > | axis () const |
| Returns the axis of the rotation. | |
| T | angle () const |
| Returns the angle of the rotation. | |
| RotationT | inverted () const |
| Returns the inverted rotation, this rotation must be valid. | |
| void | invert () |
| Inverts this rotation, this rotation must be valid. | |
| bool | isValid () const |
| Returns whether this rotation has valid parameters. | |
| bool | operator== (const RotationT< T > &right) const |
| Returns whether two rotations are identical up to a small epsilon. | |
| bool | operator!= (const RotationT< T > &right) const |
| Returns whether two rotations are not identical up to a small epsilon. | |
| RotationT | operator- () const |
| Returns the inverse rotation, this rotation must be valid. | |
| RotationT | operator* (const QuaternionT< T > &quaternion) const |
| Multiplies two rotations, this rotation must be valid. | |
| RotationT & | operator*= (const QuaternionT< T > &quaternion) |
| Multiplies and assign two rotations, this rotation must be valid. | |
| RotationT | operator* (const RotationT< T > &right) const |
| Multiplies two rotations, this rotation must be valid. | |
| RotationT & | operator*= (const RotationT< T > &right) |
| Multiplies and assign two rotations, this rotation must be valid. | |
| VectorT3< T > | operator* (const VectorT3< T > &vector) const |
| Rotates a 3D vector with this rotation, this rotation must be valid. | |
| T | operator() (unsigned int index) const |
| Element access operator. | |
| T & | operator() (unsigned int index) |
| Element access operator. | |
| T | operator[] (unsigned int index) const |
| Element access operator. | |
| T & | operator[] (unsigned int index) |
| Element access operator. | |
| const T * | operator() () const |
| Access operator. | |
| T * | operator() () |
| Access operator. | |
Protected Attributes | |
| T | values_ [4] = {T(0), T(1), T(0), T(0)} |
| The four values of the angle-axis rotation. | |
This class implements a axis-angle rotation using floating point values.
The angle is defined in radian [0, 2*PI).
The four elements are stored with order: (x, y, z, angle).
| T | Data type used to represent axis and angle |
| typedef T Ocean::RotationT< T >::Type |
Definition of the used data type.
|
default |
Creates a rotation object with default values so that the rotation represents the identity rotation.
The axis will be set to (0, 1, 0) and the angle to 0.
| Ocean::RotationT< T >::RotationT | ( | const T | x, |
| const T | y, | ||
| const T | z, | ||
| const T | angle | ||
| ) |
Creates a rotation object by four given values.
The axis must have length 1.
| x | X value of the rotation axis |
| y | Y value of the rotation axis |
| z | Z value of the rotation axis |
| angle | The angle of the rotation in radian, with range (-infinity, infinity), however will be converted to the range [0.0, 2 * PI) |
| Ocean::RotationT< T >::RotationT | ( | const VectorT3< T > & | axis, |
| const T | angle | ||
| ) |
Creates a rotation object by an axis and the angle.
| axis | The axis of the rotation with length 1 |
| angle | The angle of the rotation in radian, with range (-infinity, infinity), however will be converted to the range [0.0, 2 * PI) |
| Ocean::RotationT< T >::RotationT | ( | const VectorT3< T > & | reference, |
| const VectorT3< T > & | offset | ||
| ) |
Creates a rotation object based on two given unit vectors.
The resulting rotation defines a transformation that rotates that reference vector into the offset vector: Rotation(reference, offset) = offset_R_reference.
The following equation holds:
offset = Rotation(reference, offset) * reference.
| reference | The reference vector, with length 1 |
| offset | The offset vector, with length 1 |
|
explicit |
Creates a rotation object by a given quaternion rotation.
| quaternion | the quaternion rotation to create an axis-angle rotation from, must be valid |
|
explicit |
Creates an angle-axis rotation by a given euler rotation.
| euler | Euler rotation to create a angle-axis rotation from, must be valid |
|
explicit |
Creates a rotation object by a given 3x3 rotation matrix.
Beware: Ensure that the provided matrix does not contain any scale.
| matrix | Rotation matrix to create a axis-angle rotation from, with determinant 1 |
|
explicit |
Creates a rotation object by a given 4x4 transformation matrix.
| transformation | The transformation matrix to create a axis-angle rotation from, must be valid |
|
explicit |
Creates a rotation object by an array with four elements.
The element order in the array has to be: (x, y, z, angle).
The axis must have length 1, the angle is provided as radian with range (-infinity, infinity), however will be converted to the range [0.0, 2 * PI)
| valueArray | Array with four elements |
|
inline |
Returns the angle of the rotation.
|
inline |
Returns the axis of the rotation.
|
inline |
Returns a pointer to the internal values.
|
inline |
Returns a pointer to the internal values.
| void Ocean::RotationT< T >::invert | ( | ) |
Inverts this rotation, this rotation must be valid.
| RotationT< T > Ocean::RotationT< T >::inverted | ( | ) | const |
| bool Ocean::RotationT< T >::isValid | ( | ) | const |
Returns whether this rotation has valid parameters.
|
inline |
Returns whether two rotations are not identical up to a small epsilon.
| right | The right operand |
|
inline |
Access operator.
|
inline |
Access operator.
|
inline |
Element access operator.
| index | The index of the element to return, with range [0, 3] |
|
inline |
Element access operator.
| index | The index of the element to return, with range [0, 3] |
| RotationT< T > Ocean::RotationT< T >::operator* | ( | const QuaternionT< T > & | quaternion | ) | const |
Multiplies two rotations, this rotation must be valid.
| quaternion | The right rotation as unit quaternion, must be valid |
| RotationT< T > Ocean::RotationT< T >::operator* | ( | const RotationT< T > & | right | ) | const |
Multiplies two rotations, this rotation must be valid.
| right | The right rotation to multiply, must be valid |
| VectorT3< T > Ocean::RotationT< T >::operator* | ( | const VectorT3< T > & | vector | ) | const |
Rotates a 3D vector with this rotation, this rotation must be valid.
| vector | The vector to rotate |
| RotationT< T > & Ocean::RotationT< T >::operator*= | ( | const QuaternionT< T > & | quaternion | ) |
Multiplies and assign two rotations, this rotation must be valid.
| quaternion | The right rotation as unit quaternion, must be valid |
| RotationT< T > & Ocean::RotationT< T >::operator*= | ( | const RotationT< T > & | right | ) |
Multiplies and assign two rotations, this rotation must be valid.
| right | The right rotation to multiply, must be valid |
| RotationT< T > Ocean::RotationT< T >::operator- | ( | ) | const |
Returns the inverse rotation, this rotation must be valid.
| bool Ocean::RotationT< T >::operator== | ( | const RotationT< T > & | right | ) | const |
Returns whether two rotations are identical up to a small epsilon.
| right | The right operand |
|
inline |
Element access operator.
| index | The index of the element to return, with range [0, 3] |
|
inline |
Element access operator.
| index | The index of the element to return, with range [0, 3] |
| void Ocean::RotationT< T >::setAngle | ( | const T | angle | ) |
Sets the angle of the rotation.
| angle | The angle of rotation in radian, with range (-infinity, infinity), however will be converted to the range [0.0, 2 * PI) |
| void Ocean::RotationT< T >::setAxis | ( | const VectorT3< T > & | axis | ) |
Sets the axis of the rotation.
| axis | The axis with length 1 |
|
protected |
The four values of the angle-axis rotation.