This class represents a 3 dimensional vector.
More...
#include <Math3D.h>
|
| Vector3 (float x=0, float y=0, float z=0) |
| Creates a new 3 dimensional vector.
|
|
const float & | x () const |
| Retrieves the x component of the vector.
|
|
const float & | y () const |
| Retrieves the y component of the vector.
|
|
const float & | z () const |
| Retrieves the z component of the vector.
|
|
void | get (float *destination) const |
| Retrieves the components of the vector.
|
|
float * | get () |
| Retrieves the components of the vector.
|
|
const float * | get () const |
| Retrieves the components of the vector.
|
|
float | length () const |
| Retrieves the length of the vector.
|
|
Vector3 | cross (const Vector3 &op) const |
| Retrieves the cross product.
|
|
float | operator* (const Vector3 &op) const |
| Retrieves the dot product.
|
|
Vector3 | operator* (const float &op) const |
| Retrieves the product with a scalar.
|
|
Vector3 | operator+ (const Vector3 &op) const |
| Adds two vectors.
|
|
Vector3 | operator- (const Vector3 &op) const |
| Subtracts two vectors.
|
|
Vector3 | operator- () const |
| Negates the vector.
|
|
Vector3 & | operator-= (const Vector3 &op) |
| Subtracts the second vector.
|
|
This class represents a 3 dimensional vector.
◆ Vector3()
Vector3::Vector3 |
( |
float | x = 0, |
|
|
float | y = 0, |
|
|
float | z = 0 ) |
|
inline |
Creates a new 3 dimensional vector.
- Parameters
-
x | The x component. |
y | The y component. |
z | The z component. |
◆ cross()
Retrieves the cross product.
- Parameters
-
- Returns
- The cross product of the two vectors.
◆ get() [1/3]
Retrieves the components of the vector.
- Returns
- The components as float[3].
◆ get() [2/3]
const float * Vector3::get |
( |
| ) |
const |
|
inline |
Retrieves the components of the vector.
- Returns
- The components as float[3].
◆ get() [3/3]
void Vector3::get |
( |
float * | destination | ) |
const |
|
inline |
Retrieves the components of the vector.
- Parameters
-
destination | Where the 3 float values should be saved to. |
◆ length()
float Vector3::length |
( |
| ) |
const |
|
inline |
Retrieves the length of the vector.
- Returns
- The length of the vector.
◆ operator*() [1/2]
Vector3 Vector3::operator* |
( |
const float & | op | ) |
const |
|
inline |
Retrieves the product with a scalar.
- Parameters
-
- Returns
- The scaled vector.
◆ operator*() [2/2]
float Vector3::operator* |
( |
const Vector3 & | op | ) |
const |
|
inline |
Retrieves the dot product.
- Parameters
-
- Returns
- The dot product of the two vectors.
◆ operator+()
Adds two vectors.
- Parameters
-
- Returns
- The sum vector.
◆ operator-() [1/2]
Vector3 Vector3::operator- |
( |
| ) |
const |
|
inline |
Negates the vector.
- Returns
- The vector facing in the opposite direction.
◆ operator-() [2/2]
Subtracts two vectors.
- Parameters
-
- Returns
- The difference vector.
◆ operator-=()
Subtracts the second vector.
- Parameters
-
- Returns
- The difference vector.
◆ x()
const float & Vector3::x |
( |
| ) |
const |
|
inline |
Retrieves the x component of the vector.
- Returns
- The x component.
◆ y()
const float & Vector3::y |
( |
| ) |
const |
|
inline |
Retrieves the y component of the vector.
- Returns
- The y component.
◆ z()
const float & Vector3::z |
( |
| ) |
const |
|
inline |
Retrieves the z component of the vector.
- Returns
- The z component.
The documentation for this class was generated from the following file: