|
|
constexpr | vector (vector const &) noexcept=default |
| |
|
constexpr | vector (vector &&) noexcept=default |
| |
|
constexpr vector & | operator= (vector const &) noexcept=default |
| |
|
constexpr vector & | operator= (vector &&) noexcept=default |
| |
template<int E>
requires (E < D) |
| constexpr | vector (vector< E > const &other) noexcept |
| | Construct a vector from a lower dimension vector.
|
| |
template<int E>
requires (E > D) |
| constexpr | vector (vector< E > const &other) noexcept |
| | Construct a vector from a higher dimension vector.
|
| |
| constexpr | operator f32x4 () const noexcept |
| | Convert a vector to its f32x4-nummeric_array.
|
| |
| constexpr | vector (f32x4 const &other) noexcept |
| | Construct a vector from a f32x4-numeric_array.
|
| |
| constexpr | vector () noexcept |
| | Construct a empty vector / zero length.
|
| |
| constexpr | vector (float x, float y) noexcept |
| | Construct a 2D vector from x and y elements.
|
| |
| constexpr | vector (float x, float y, float z=0.0f) noexcept |
| | Construct a 3D vector from x, y and z elements.
|
| |
| constexpr float & | x () noexcept |
| | Access the x element from the vector.
|
| |
| constexpr float & | y () noexcept |
| | Access the y element from the vector.
|
| |
| constexpr float & | z () noexcept |
| | Access the z element from the vector.
|
| |
| constexpr float const & | x () const noexcept |
| | Access the x element from the vector.
|
| |
| constexpr float const & | y () const noexcept |
| | Access the y element from the vector.
|
| |
| constexpr float const & | z () const noexcept |
| | Access the z element from the vector.
|
| |
| constexpr vector | operator- () const noexcept |
| | Mirror this vector.
|
| |
template<int E>
requires (E <= D) |
| constexpr vector & | operator+= (vector< E > const &rhs) noexcept |
| |
| constexpr bool | is_valid () const noexcept |
| | Check if the vector is valid.
|
| |
|
| constexpr friend vector | operator+ (vector const &lhs, vector const &rhs) noexcept |
| | Add two vectors from each other.
|
| |
| constexpr friend vector | operator- (vector const &lhs, vector const &rhs) noexcept |
| | Subtract two vectors from each other.
|
| |
| constexpr friend vector | operator* (vector const &lhs, float const &rhs) noexcept |
| | Scale the vector by a scaler.
|
| |
| constexpr friend vector | operator* (float const &lhs, vector const &rhs) noexcept |
| | Scale the vector by a scaler.
|
| |
| constexpr friend bool | operator== (vector const &lhs, vector const &rhs) noexcept |
| | Compare if two vectors are equal.
|
| |
| constexpr friend float | squared_hypot (vector const &rhs) noexcept |
| | Get the squared length of the vector.
|
| |
| constexpr friend float | hypot (vector const &rhs) noexcept |
| | Get the length of the vector.
|
| |
| constexpr friend float | rcp_hypot (vector const &rhs) noexcept |
| | Get the length of the vector.
|
| |
| constexpr friend vector | normalize (vector const &rhs) noexcept |
| | Normalize a vector to a unit vector.
|
| |
| constexpr friend float | dot (vector const &lhs, vector const &rhs) noexcept |
| | Get the dot product between two vectors.
|
| |
| template<int E> |
| constexpr auto | min (vector const &lhs, vector< E > const &rhs) noexcept |
| | Mix the two vectors and get the lowest value of each element.
|
| |
| template<int E> |
| constexpr auto | max (vector const &lhs, vector< E > const &rhs) noexcept |
| | Mix the two vectors and get the highest value of each element.
|
| |
| constexpr vector | round (vector const &rhs) noexcept |
| | Round the elements of the vector toward nearest integer.
|
| |
| constexpr vector | ceil (vector const &rhs) noexcept |
| | Round the elements of the vector toward upward and to the right.
|
| |
| constexpr vector | floor (vector const &rhs) noexcept |
| | Round the elements of the vector toward downward and to the left.
|
| |
|
std::string | to_string (vector const &rhs) noexcept |
| |
|
std::ostream & | operator<< (std::ostream &lhs, vector const &rhs) noexcept |
| |
template<int D>
class tt::geo::vector< D >
A high-level geometric vector Part of the high-level vector, point, mat and color types.
A vector, for both 2D or 3D is internally represented as a 4D homogeneous vector. Which can be efficiently implemented as a __m128 SSE register.