|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
3D vector class inheriting from glm::vec3. More...
#include <headers/utility/math/vector.hpp>


Public Member Functions | |
| Vector (void) | |
| Default constructor initializing vector values to zero. | |
| Vector (const glm::vec< VectorDimension, VectorComponentType > &v) | |
| Construct from a GLM vector. | |
| Vector (std::initializer_list< VectorComponentType > values) | |
| Construct from initializer list of float values. | |
| Vector (VectorComponentType value) | |
| Construct by filling all components with the same float value. | |
| Vector (const Vector &other)=default | |
| Copy constructor. | |
| Vector (Vector &&other) noexcept=default | |
| Move constructor. | |
| ~Vector (void)=default | |
| Default destructor for Vector. | |
| Vector & | operator= (const Vector &other)=default |
| Copy assignment operator. | |
| Vector & | operator= (Vector &&other) noexcept=default |
| Move assignment operator. | |
| Vector | operator+ (const Vector &rhs) const noexcept |
| Vector addition. | |
| Vector & | operator+= (const Vector &rhs) noexcept |
| Vector addition assignment. | |
| Vector | operator- (const Vector &rhs) const noexcept |
| Vector subtraction. | |
| Vector & | operator-= (const Vector &rhs) noexcept |
| Vector subtraction assignment. | |
| Vector | operator* (VectorComponentType scalar) const noexcept |
| Scalar multiplication. | |
| Vector & | operator*= (VectorComponentType scalar) noexcept |
| Scalar multiplication assignment. | |
| Vector | operator/ (VectorComponentType scalar) const |
| Scalar division. | |
| Vector & | operator/= (VectorComponentType scalar) |
| Scalar division assignment. | |
| Vector | operator* (const Vector &rhs) const noexcept |
| Element-wise multiplication. | |
| Vector & | operator*= (const Vector &rhs) noexcept |
| Element-wise multiplication assignment. | |
| Vector | operator/ (const Vector &rhs) const |
| Element-wise division. | |
| Vector & | operator/= (const Vector &rhs) |
| Element-wise division assignment. | |
| bool | operator== (const Vector &rhs) const noexcept |
| Equality comparison. | |
| bool | equalsEpsilon (const Vector &rhs, VectorComponentType epsilon=VectorComponentType { 1e-5 }) const |
| Approximate equality using an epsilon threshold. | |
| bool | operator!= (const Vector &rhs) const noexcept |
| Inequality comparison. | |
| Vector | operator- () const noexcept |
| Unary negation. | |
Friends | |
| Vector | operator* (VectorComponentType scalar, const Vector &vec) |
| Friend function for scalar multiplication with scalar on the left. | |
3D vector class inheriting from glm::vec3.
| Type | Floating-point type for vector components. |
Definition at line 82 of file vector.hpp.
|
inline |
Default constructor initializing vector values to zero.
Definition at line 88 of file vector.hpp.

|
inlineexplicit |
Construct from a GLM vector.
| v | Source GLM vector. |
Definition at line 97 of file vector.hpp.
|
inline |
Construct from initializer list of float values.
| values | The initializer list containing vector components. |
| std::invalid_argument | if the list size does not match the vector dimension. |
Definition at line 108 of file vector.hpp.
|
inlineexplicit |
Construct by filling all components with the same float value.
| value | The float value to fill all components with. |
Definition at line 125 of file vector.hpp.
|
default |
Copy constructor.
| other | The Vector object to copy from. |
|
defaultnoexcept |
Move constructor.
| other | The Vector object to move from. |
|
inline |
Approximate equality using an epsilon threshold.
Returns true if each component is within epsilon of its counterpart in rhs.
| rhs | The vector to compare with. |
| epsilon | The maximum allowed difference per component. |
Definition at line 378 of file vector.hpp.
|
inlinenoexcept |
Inequality comparison.
| rhs | The vector to compare with. |
Definition at line 395 of file vector.hpp.
|
inlinenoexcept |
Element-wise multiplication.
| rhs | The vector to multiply with. |
Definition at line 284 of file vector.hpp.

|
inlinenoexcept |
Scalar multiplication.
| scalar | The scalar value to multiply with. |
Definition at line 226 of file vector.hpp.

|
inlinenoexcept |
Element-wise multiplication assignment.
| rhs | The vector to multiply with. |
Definition at line 299 of file vector.hpp.
|
inlinenoexcept |
Scalar multiplication assignment.
| scalar | The scalar value to multiply with. |
Definition at line 239 of file vector.hpp.
|
inlinenoexcept |
Vector addition.
| rhs | The vector to add. |
Definition at line 166 of file vector.hpp.

|
inlinenoexcept |
Vector addition assignment.
| rhs | The vector to add. |
Definition at line 181 of file vector.hpp.
|
inlinenoexcept |
Unary negation.
Definition at line 404 of file vector.hpp.

|
inlinenoexcept |
Vector subtraction.
| rhs | The vector to subtract. |
Definition at line 196 of file vector.hpp.

|
inlinenoexcept |
Vector subtraction assignment.
| rhs | The vector to subtract. |
Definition at line 211 of file vector.hpp.
|
inline |
Element-wise division.
| rhs | The vector to divide by. |
| std::invalid_argument | if any component of rhs is zero. |
Definition at line 315 of file vector.hpp.

|
inline |
Scalar division.
| scalar | The scalar value to divide by. |
| std::invalid_argument | if scalar is zero. |
Definition at line 252 of file vector.hpp.

|
inline |
Element-wise division assignment.
| rhs | The vector to divide by. |
| std::invalid_argument | if any component of rhs is zero. |
Definition at line 336 of file vector.hpp.
|
inline |
Scalar division assignment.
| scalar | The scalar value to divide by. |
| std::invalid_argument | if scalar is zero. |
Definition at line 269 of file vector.hpp.
|
default |
|
defaultnoexcept |
|
inlinenoexcept |
Equality comparison.
Uses exact component-wise equality. For floating-point types prefer equalsEpsilon to tolerate rounding error.
| rhs | The vector to compare with. |
Definition at line 359 of file vector.hpp.
|
friend |
Friend function for scalar multiplication with scalar on the left.
| scalar | The scalar value to multiply with. |
| vec | The vector to multiply. |
Definition at line 419 of file vector.hpp.