|
| AnglesT () |
| The default constructor. It initializes all angles to zero. More...
|
|
| AnglesT (T x_, T y_, T z_) |
| This constructor initializes the angles from x_, y_ and z_ respectively. More...
|
|
| AnglesT (const Vector3T< T > &v) |
| A constructor for initializing an Angles instance from a Vector3T. More...
|
|
| AnglesT (const Matrix3x3T< T > &M) |
| Constructs a set of angles that describe the same orientation as the given matrix. More...
|
|
| AnglesT (const QuaternionT< T > &Quat) |
| Constructs a set of angles that describe the same orientation as the given quaternion. More...
|
|
T & | pitch () |
| Provides the alias for the angle of rotation around the x-axis. TODO: The impl. should actually use y, not x here! More...
|
|
const T & | pitch () const |
| Provides the alias for the angle of rotation around the x-axis. More...
|
|
T & | roll () |
| Provides the alias for the angle of rotation around the y-axis. TODO: The impl. should actually use x, not y here! More...
|
|
const T & | roll () const |
| Provides the alias for the angle of rotation around the y-axis. More...
|
|
T & | yaw () |
| Provides the alias for the angle of rotation around the z-axis. More...
|
|
const T & | yaw () const |
| Provides the alias for the angle of rotation around the z-axis. More...
|
|
| Vector3T () |
| The default constructor. It initializes all components to zero. More...
|
|
| Vector3T (T x_, T y_, T z_) |
| This constructor initializes the components from x_, y_ and z_ respectively. More...
|
|
template<class C > |
| Vector3T (const C Values[]) |
| This constructor initializes the components from an array of (at least) three Ts. More...
|
|
bool | IsValid () const |
| Returns true if the vector is valid, that is, all components are non-NANs. More...
|
|
T & | operator[] (unsigned int Index) |
| Component access by index number (0 to 2) rather than by name. More...
|
|
const T & | operator[] (unsigned int Index) const |
| Component access by index number (0 to 2) rather than by name. More...
|
|
Vector3T< float > | AsVectorOfFloat () const |
| Gets this Vector3T<T> as a Vector3T<float>, so that the cast is explicitly visible in user code. More...
|
|
Vector3T< double > | AsVectorOfDouble () const |
| Gets this Vector3T<T> as a Vector3T<double>, so that the cast is explicitly visible in user code. More...
|
|
Vector3T< int > | AsVectorOfInt () const |
| Gets this Vector3T<T> as a Vector3T<int>, so that the cast is explicitly visible in user code. More...
|
|
T | GetLengthSqr () const |
| Returns the square of the length of this vector. More...
|
|
bool | IsEqual (const Vector3T< T > &B, const T Epsilon) const |
| Returns whether this vector is equal to B within tolerance Epsilon, that is, whether it is geometrically closer to B than Epsilon. More...
|
|
Vector3T< T > | GetScaled (const T s) const |
| Returns a copy of this vector scaled by s, that is, the scalar product (Skalarmultiplikation) of this vector and s. More...
|
|
Vector3T< T > | GetScaled (const Vector3T< T > &S) const |
| Returns a copy of this vector non-uniformely scaled by S. More...
|
|
Vector3T< T > | GetRotX (const T Angle) const |
| Returns a copy of this vector rotated around the x-axis by Angle degrees. More...
|
|
Vector3T< T > | GetRotY (const T Angle) const |
| Returns a copy of this vector rotated around the y-axis by Angle degrees. More...
|
|
Vector3T< T > | GetRotZ (const T Angle) const |
| Returns a copy of this vector rotated around the z-axis by Angle degrees. More...
|
|
void | CreateOrthoVectors (Vector3T< T > &Left, Vector3T< T > &Down) const |
| Returns two vectors that are orthogonal to this vector and to each other. More...
|
|
bool | operator== (const Vector3T< T > &B) const |
| Returns whether this vector and B are truly (bit-wise) identical. More...
|
|
bool | operator!= (const Vector3T< T > &B) const |
| Returns whether this vector and B are not equal (bit-wise). More...
|
|
Vector3T< T > | operator+ (const Vector3T< T > &B) const |
| Returns the sum of this Vector3T<T> and B. More...
|
|
Vector3T< T > | operator- (const Vector3T< T > &B) const |
| Returns the difference between this Vector3T<T> and B. More...
|
|
Vector3T< T > | operator- () const |
| The unary minus operator. B=-A is quasi identical with B=A.GetScaled(-1). More...
|
|
Vector3T< T > | operator* (const T s) const |
| Returns a copy of this vector scaled by s, that is, the scalar product (Skalarmultiplikation) of this vector and s. More...
|
|
Vector3T< T > | operator/ (const T s) const |
| Returns a copy of this vector divided by s, that is, the scalar product (Skalarmultiplikation) of this vector and 1/s. More...
|
|
T | dot (const Vector3T< T > &B) const |
| Returns the dot product (Skalarprodukt) of this vector and B. More...
|
|
Vector3T< T > | cross (const Vector3T< T > &B) const |
| Returns the cross product (Vektorprodukt) of this vector and B. More...
|
|
Vector3T< T > & | operator+= (const Vector3T< T > &B) |
| Adds B to this vector. More...
|
|
Vector3T< T > & | operator-= (const Vector3T< T > &B) |
| Subtracts B from this vector. More...
|
|
Vector3T< T > & | operator*= (const T s) |
| Scales this vector by s. More...
|
|
Vector3T< T > & | operator/= (const T s) |
| Divides this vector by s. Assumes that s is not 0. More...
|
|
template<class T>
class cf::math::AnglesT< T >
This class represents a triple of angles.
The class keeps the angles in degrees, not in radians.
The angles are typically used to describe an orientation. Generally, the orientation is achieved by composing three elemental rotations about the principal axes by the given angles. For this purpose, all related code in Cafu (e.g. the matrix and quaternion classes) uses the following conventions:
- As everywhere in Cafu, a right-handed coordinate system is used: In world space, the x-axis points right, the y-axis points forward, and the z-axis points up. However, note that our entities and cameras, as detailed below, "look along" their x-axis, so that for them, the x-axis points forward, the y-axis points left, and the z-axis points up. It is this orientation that the following definitions of angles refer to.
- The rotations are done
- first about the z-axis (by the "heading" or "yaw" angle),
- then about the rotated y-axis (by the "pitch" angle),
- then about the rotated x-axis (by the "bank" or "roll" angle). This order is explained in greater detail in the references listed below.
- Positive angles rotate counter-clockwise (the "right-hand rule").
- North is along the x-axis, West is along the y-axis. This does not follow the compase-rose analogy (that we had normally preferred), where North is along the y-axis, East is along the x-axis, and positive rotation is clockwise, but was accepted for conformance with the broader conventions (e.g. DIN 9300) given in the references below.
References (in German, as the English editions don't have the relevant math):
- http://de.wikipedia.org/wiki/Eulersche_Winkel Especially section "z, y', x''-Konvention in der Fahrzeugtechnik" has a very well explained derivation of a rotation matrix from Euler angles. Note, however, that the resulting matrix transforms from world-to-model space, whereas we're more interested in the transpose, in order to transform from model-to-world space.
- http://de.wikipedia.org/wiki/Roll-Nick-Gier-Winkel Section "Z, Y', X'' Konvention" complements the above, where the model-to-world space matrix is readily given, and the math for converting back to Euler angles as well.