#include <gauge3d/3dmath/angles.h>
Public Types | |
typedef float | tAngle |
Public Methods | |
GAngles () | |
Leaves pitch, yaw, and roll unititialized. | |
GAngles (tAngle pitch,tAngle yaw,tAngle roll) | |
Sets pitch, yaw, and roll manually. | |
GAngles (const GQuaternion &quat) | |
Converts a quaternion into Euler angles. | |
void | Rotate (const GVector in[],GVector out[],int num)const |
Rotate a set of vectors by the angles. More... | |
void | MakeVectors (GVector *forward,GVector *up=NULL,GVector *right=NULL)const |
Finds forward, up, and right vectors for the angles. More... | |
void | SetDirection (const GVector &forward) |
Sets the angles to point in the given direction. More... | |
void | SetDirection (const GVector &forward,const GVector &up) |
Sets the angles so that the given forward and up vectors are valid. More... | |
const GAngles& | operator+= (const GAngles &other) |
Component-wise addition (fast). | |
GAngles | operator+ (const GAngles &other) |
Component-wise addition (fast). | |
const GAngles& | operator-= (const GAngles &other) |
Component-wise subtraction (fast). | |
GAngles | operator- (const GAngles &other) |
Component-wise subtraction (fast). | |
GAngles | operator * (GCoordinate a) |
Component-wise multiplication (fast). | |
const GAngles& | operator *= (GCoordinate a) |
Component-wise multiplication (fast). | |
GAngles | operator * (const GAngles &other) |
Combines the angles "correctly" (slow). More... | |
const GAngles& | operator *= (const GAngles &other) |
Combines the angles "correctly" (slow). More... | |
bool | operator== (const GAngles &other)const |
Checks for equality with error tolerance. | |
operator GQuaternion ()const | |
Converts to a GQuaternion. | |
Public Attributes | |
Angle Values | |
All angles are in radians. | |
tAngle | mPitch |
tAngle | mYaw |
tAngle | mRoll |
Static Public Methods | |
tAngle | Degrees2Radians (tAngle degrees) |
Convert degrees to radians. | |
tAngle | Radians2Degrees (tAngle radians) |
Convert radians to degrees. | |
Related Functions | |
(Note that these are not member functions.) | |
GAngles | operator * (GCoordinate coord,const GAngles &angles) |
Component-wise subtraction (fast). |
A pitch, yaw, and roll of zero points in the direction of GVECTOR_FORWARD. Pitch rotates clockwise around the X axis, yaw rotates clockwise around the Z axis, and roll rotates clockwise around the Y axis. When rotating a vector, roll is applied first, then pitch, then yaw.
|
Rotate a set of vectors by the angles.
|
|
Finds forward, up, and right vectors for the angles.
|
|
Sets the angles to point in the given direction. SetDirection takes a vector and sets the pitch and yaw such that that vector points forwards. Roll is set to zero. |
|
Sets the angles so that the given forward and up vectors are valid. This version sets pitch, yaw, and roll so that both the given vectors are equal to what you'd get if you called MakeVectors. |
|
Combines the angles "correctly" (slow). Multiplication between GAngles objects is done by converting them to GQuaternion's, multiplying those, and then converting the result back to a GAngles. This results in a more correct combination than simply adding the components does, but it takes longer. |
|
Combines the angles "correctly" (slow). Multiplication between GAngles objects is done by converting them to GQuaternion's, multiplying those, and then converting the result back to a GAngles. This results in a more correct combination than simply adding the components does, but it takes longer. |