#include <core_math.h>
Public Member Functions | |
| vector3 () | |
| Create uninitialized vector. | |
| vector3 (scalar_t a, scalar_t b, scalar_t c) | |
| Create vector initialized with 3 scalar values. | |
| const scalar_t & | operator[] (int i) const |
| operator [] is used to read, () is to write (to preserve const correctness) | |
| scalar_t & | operator() (int i) |
| () is used to write, [] is to read (to preserve const correctness) | |
| scalar_t & | x () |
| Shortcut to vector[0]. | |
| scalar_t & | y () |
| Shortcut to vector[1]. | |
| scalar_t & | z () |
| Shortcut to vector[2]. | |
| scalar_t | length3 () const |
| Euclidean length of the vector. | |
| scalar_t | length3squared () const |
| Euclidean length of the vector, squared. | |
| vector3 & | normalize3 () |
| Normalize vector in place. | |
| vector3 | operator+ (const vector3 &other) |
| operator + between two 3-dimentional vectors | |
| vector3 & | operator+= (const vector3 &other) |
| operator += between two 3-dimentional vectors | |
| vector3 | operator- (const vector3 &other) |
| operator - between two 3-dimentional vectors | |
| vector3 & | operator-= (const vector3 &other) |
| operator -= between two 3-dimentional vectors | |
|
|
Create uninitialized vector.
|
|
||||||||||||||||
|
Create vector initialized with 3 scalar values.
|
|
|
operator [] is used to read, () is to write (to preserve const correctness)
|
|
|
() is used to write, [] is to read (to preserve const correctness)
|
|
|
Shortcut to vector[0]. Included for convenience only. |
|
|
Shortcut to vector[1]. Included for convenience only. |
|
|
Shortcut to vector[2]. Included for convenience only. |
|
|
Euclidean length of the vector.
|
|
|
Euclidean length of the vector, squared. This is faster to compute than length, and is often sufficient for the task. |
|
|
Normalize vector in place. Use first 3 elements of a vector. |
|
|
operator + between two 3-dimentional vectors
|
|
|
operator += between two 3-dimentional vectors
|
|
|
operator - between two 3-dimentional vectors
|
|
|
operator -= between two 3-dimentional vectors
|
1.3.6