LinearAlgebra
|
A direction using angles in various representations.
T | The implementation type used for the representation of the angles A direction is represented using two angles:
|
#include <Direction.h>
Public Member Functions | |
DirectionOf () | |
Create a new direction with zero angles. | |
DirectionOf (AngleOf< T > horizontal, AngleOf< T > vertical) | |
Create a new direction. | |
Vector3 | ToVector3 () const |
Convert the direction into a carthesian vector. | |
bool | operator== (const DirectionOf< T > direction) const |
Test whether this direction is equal to another direction. | |
DirectionOf< T > | operator- () const |
Negate/reverse the direction. | |
Static Public Member Functions | |
static DirectionOf< T > | FromVector3 (Vector3 vector) |
Convert a carthesian vector into a direction. | |
static DirectionOf< T > | Degrees (float horizontal, float vertical) |
Create a direction using angle values in degrees. | |
static DirectionOf< T > | Radians (float horizontal, float vertical) |
Create a direction using angle values in radians. | |
Public Attributes | |
AngleOf< T > | horizontal |
horizontal angle, range= (-180..180] | |
AngleOf< T > | vertical |
vertical angle, range in degrees = (-90..90] | |
Static Public Attributes | |
static const DirectionOf | forward |
A forward direction with zero for both angles. | |
static const DirectionOf | back |
A backward direction with horizontal angle -180 and zero vertical angle. | |
static const DirectionOf | up |
A upward direction with zero horizontal angle and vertical angle 90. | |
static const DirectionOf | down |
A downward direction with zero horizontal angle and vertical angle -90. | |
static const DirectionOf | left |
A left-pointing direction with horizontal angle -90 and zero vertical angle. | |
static const DirectionOf | right |
A right-pointing direction with horizontal angle 90 and zero vertical angle. | |
Protected Member Functions | |
void | Normalize () |
Normalize this vector to the specified ranges. | |
Create a new direction.
horizontal | The horizontal angle |
vertical | The vertical angle. |
Vector3 Passer::LinearAlgebra::DirectionOf< T >::ToVector3 | ( | ) | const |
Convert the direction into a carthesian vector.
|
static |
Convert a carthesian vector into a direction.
v | The carthesian vector |
|
static |
Create a direction using angle values in degrees.
horizontal | The horizontal angle in degrees |
vertical | The vertical angle in degrees |
|
static |
Create a direction using angle values in radians.
horizontal | The horizontal angle in radians |
vertical | The vertical angle in radians |
bool Passer::LinearAlgebra::DirectionOf< T >::operator== | ( | const DirectionOf< T > | direction | ) | const |
Test whether this direction is equal to another direction.
direction | The direction to compare to |
DirectionOf< T > Passer::LinearAlgebra::DirectionOf< T >::operator- | ( | ) | const |
Negate/reverse the direction.
|
static |
A forward direction with zero for both angles.
|
static |
A backward direction with horizontal angle -180 and zero vertical angle.
|
static |
A upward direction with zero horizontal angle and vertical angle 90.
|
static |
A downward direction with zero horizontal angle and vertical angle -90.
|
static |
A left-pointing direction with horizontal angle -90 and zero vertical angle.
|
static |
A right-pointing direction with horizontal angle 90 and zero vertical angle.