#include <core_math.h>
Public Member Functions | |
| vector4 () | |
| Create uninitialized vector. | |
| vector4 (scalar_t a, scalar_t b, scalar_t c, scalar_t d=1) | |
| Create vector initialized with 3 (or, optionally, 4) 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) |
| operator () 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 & | w () |
| Shortcut to vector[3]. | |
| scalar_t | length3 () const |
| Euclidean length of the vector (only first 3 elements of the vector are used for calculation). | |
| scalar_t | length3squared () const |
| Euclidean length of the vector, squared. | |
| vector4 & | normalize3 () |
| Normalize vector in place. | |
| vector4 | operator+ (const vector4 &other) |
| operator + between two 4-dimentional vectors | |
| vector4 & | operator+= (const vector4 &other) |
| operator += between two 4-dimentional vectors | |
| vector4 | operator- (const vector4 &other) |
| operator - between two 4-dimentional vectors | |
| vector4 & | operator-= (const vector4 &other) |
| operator -= between two 4-dimentional vectors | |
|
|
Create uninitialized vector.
|
|
||||||||||||||||||||
|
Create vector initialized with 3 (or, optionally, 4) scalar values.
|
|
|
operator [] is used to read, () is to write (to preserve const correctness)
|
|
|
operator () 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. |
|
|
Shortcut to vector[3]. Included for convenience only. |
|
|
Euclidean length of the vector (only first 3 elements of the vector are used for calculation).
|
|
|
Euclidean length of the vector, squared. This is faster to compute than length, and is often sufficient for the task. Only 3 first elements of the vector are used for calculation. |
|
|
Normalize vector in place. Use first 3 elements of a vector. In result vector[4] will be set to value 1. |
|
|
operator + between two 4-dimentional vectors
|
|
|
operator += between two 4-dimentional vectors
|
|
|
operator - between two 4-dimentional vectors
|
|
|
operator -= between two 4-dimentional vectors
|
1.3.6