Ravelin
AAngle.h
1 /****************************************************************************
2  * Copyright 2013 Evan Drumwright
3  * This library is distributed under the terms of the Apache V2.0
4  * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5  ****************************************************************************/
6 
7 #ifndef AANGLE
8 #error This class is not to be included by the user directly. Use AANGLE.h or AAnglef.h instead.
9 #endif
10 
11 class QUAT;
12 class MATRIX3;
13 
15 class AANGLE
16 {
17  public:
18  AANGLE();
19  AANGLE(const AANGLE& source);
20  AANGLE(REAL x, REAL y, REAL z, REAL angle);
21  AANGLE(const VECTOR3& v, REAL angle);
22  AANGLE(const ORIGIN3& v, REAL angle);
23  AANGLE(const MATRIX3& m);
24  AANGLE(const QUAT& q);
25  AANGLE(const MATRIX3& m, const VECTOR3& axis);
26  AANGLE& set(const VECTOR3& v, REAL angle);
27  AANGLE& set(const ORIGIN3& v, REAL angle);
28  AANGLE& operator=(const MATRIX3& m);
29  AANGLE& operator=(const QUAT& q);
30  AANGLE& operator=(const AANGLE& source);
31  void set(const MATRIX3& m, const VECTOR3& axis);
32  AANGLE operator*(const AANGLE& a) const;
33  AANGLE& operator*=(const AANGLE& a);
34 
36  static REAL safe_sqrt(REAL x) { return (x < (REAL) 0.0 && x > -EPS) ? (REAL) 0.0 : std::sqrt(x); }
37 
38  REAL angle;
39  REAL x;
40  REAL y;
41  REAL z;
42 };
43 
44 std::ostream& operator<<(std::ostream& out, const AANGLE& a);
45 
46 
Quaternion class used for orientation.
Definition: Quat.h:21
AANGLE operator*(const AANGLE &a) const
Multiplies two axis-angle representations.
Definition: AAngle.cpp:174
AANGLE()
Default constructor.
Definition: AAngle.cpp:2
static REAL safe_sqrt(REAL x)
Does a "safe" square root - input values sufficiently close to -0 are returned as 0...
Definition: AAngle.h:36
Class for representation of orientation by an angle around an axis.
Definition: AAngle.h:15
AANGLE & set(const VECTOR3 &v, REAL angle)
Sets this object from a three-dimensional vector and a REAL value.
Definition: AAngle.cpp:59
AANGLE & operator=(const MATRIX3 &m)
Sets the object from a rotation matrix.
Definition: AAngle.cpp:235
A three-dimensional floating point vector used for representing points and vectors in 3D with associa...
Definition: Vector3.h:15
A three-dimensional floating point vector used for representing points and vectors in 3D and without ...
Definition: Origin3.h:16
AANGLE & operator*=(const AANGLE &a)
Multiplies this axis-angle representation by another and stores the result in this ...
Definition: AAngle.cpp:187
A 3x3 matrix that may be used for orientation, inertia tensors, etc.
Definition: Matrix3.h:20