Three-dimensional float vector with arithmetic, dot, and cross-product helpers. More...
#include <mxvk/include/mxvk/mxvk_math.h>
Public Member Functions | |
| float | Cos (const vec3D &v) const |
| Compute the cosine of the angle between this vector and another vector. | |
| float | Cos (const vec3D &v) const |
| Compute the cosine of the angle between this vector and another vector. | |
| constexpr vec3D | CrossProduct (const vec3D &v) const |
| Compute the right-handed cross product with another vector. | |
| vec3D | CrossProduct (const vec3D &v) const |
| Compute the right-handed cross product with another vector. | |
| constexpr float | DotProduct (const vec3D &v) const |
| Compute the dot product with another vector. | |
| float | DotProduct (const vec3D &v) const |
| Compute the dot product with another vector. | |
| float | Length () const |
| Compute the Euclidean length of this vector. | |
| float | Length () const |
| Compute the Euclidean length of this vector. | |
| void | Normalize () |
| Normalize this vector in place, or reset it to zero if it is too short. | |
| void | Normalize () |
| Normalize this vector in place, or reset it to zero if it is too short. | |
| void | Normalize (vec3D &v) const |
Write a normalized copy of this vector to v. | |
| void | Normalize (vec3D &v) const |
Write a normalized copy of this vector to v. | |
| constexpr vec3D | operator* (float k) const |
| Scale this vector by a scalar. | |
| vec3D | operator* (float k) const |
| Scale this vector by a scalar. | |
| constexpr vec3D | operator+ (const vec3D &v) const |
| Add two vectors component-wise. | |
| vec3D | operator+ (const vec3D &v) const |
| Add two vectors component-wise. | |
| vec3D & | operator+= (const vec3D &v) |
| Add another vector to this vector. | |
| vec3D & | operator+= (const vec3D &v) |
| Add another vector to this vector. | |
| constexpr vec3D | operator- (const vec3D &v) const |
| Subtract two vectors component-wise. | |
| vec3D | operator- (const vec3D &v) const |
| Subtract two vectors component-wise. | |
| vec3D & | operator-= (const vec3D &v) |
| Subtract another vector from this vector. | |
| vec3D & | operator-= (const vec3D &v) |
| Subtract another vector from this vector. | |
| vec3D & | operator= (const vec3D &)=default |
| vec3D & | operator= (const vec3D &)=default |
| std::string | Print (const std::string &name="v") const |
| Format this vector as a named angle-bracket tuple. | |
| std::string | Print (const std::string &name="v") const |
| Format this vector as a named angle-bracket tuple. | |
| vec3D | Scale (float k) const |
| Return a scaled copy of this vector. | |
| vec3D | Scale (float k) const |
| Return a scaled copy of this vector. | |
| void | ScaleThis (float k) |
| Scale this vector in place. | |
| void | ScaleThis (float k) |
| Scale this vector in place. | |
| void | Set (float x_value, float y_value, float z_value) |
| Set all vector coordinates. | |
| void | Set (float x_value, float y_value, float z_value) |
| Set all vector coordinates. | |
| constexpr | vec3D () |
| Construct the zero vector. | |
| constexpr | vec3D () |
| Construct the zero vector. | |
| constexpr | vec3D (float x_value, float y_value, float z_value) |
| Construct a vector from explicit coordinates. | |
| constexpr | vec3D (float x_value, float y_value, float z_value) |
| Construct a vector from explicit coordinates. | |
Public Attributes | |
| float | x = 0.0f |
| X coordinate. | |
| float | y = 0.0f |
| Y coordinate. | |
| float | z = 0.0f |
| Z coordinate. | |
Three-dimensional float vector with arithmetic, dot, and cross-product helpers.
Definition at line 291 of file mxvk_math.h.
|
inlineconstexpr |
|
inlineconstexpr |
Construct a vector from explicit coordinates.
Definition at line 306 of file mxvk_math.h.
|
inlineconstexpr |
Construct the zero vector.
Definition at line 328 of file mxvk_math_eigen.hpp.
|
inlineconstexpr |
Construct a vector from explicit coordinates.
Definition at line 331 of file mxvk_math_eigen.hpp.
|
inlinenodiscard |
Compute the cosine of the angle between this vector and another vector.
Definition at line 392 of file mxvk_math.h.
|
inlinenodiscard |
Compute the cosine of the angle between this vector and another vector.
Definition at line 411 of file mxvk_math_eigen.hpp.
Compute the right-handed cross product with another vector.
Definition at line 385 of file mxvk_math_eigen.hpp.
|
inlinenodiscardconstexpr |
Compute the dot product with another vector.
Definition at line 361 of file mxvk_math.h.
|
inlinenodiscard |
Compute the dot product with another vector.
Definition at line 380 of file mxvk_math_eigen.hpp.
|
inlinenodiscard |
Compute the Euclidean length of this vector.
Definition at line 371 of file mxvk_math.h.
|
inlinenodiscard |
Compute the Euclidean length of this vector.
Definition at line 390 of file mxvk_math_eigen.hpp.
|
inline |
Normalize this vector in place, or reset it to zero if it is too short.
Definition at line 376 of file mxvk_math.h.
|
inline |
Normalize this vector in place, or reset it to zero if it is too short.
Definition at line 395 of file mxvk_math_eigen.hpp.
|
inline |
Write a normalized copy of this vector to v.
Definition at line 386 of file mxvk_math.h.
|
inline |
Write a normalized copy of this vector to v.
Definition at line 405 of file mxvk_math_eigen.hpp.
|
inlinenodiscardconstexpr |
Scale this vector by a scalar.
Definition at line 344 of file mxvk_math.h.
|
inlinenodiscard |
Scale this vector by a scalar.
Definition at line 365 of file mxvk_math_eigen.hpp.
Add two vectors component-wise.
Definition at line 318 of file mxvk_math.h.
Add two vectors component-wise.
Definition at line 343 of file mxvk_math_eigen.hpp.
Add another vector to this vector.
Definition at line 323 of file mxvk_math.h.
Add another vector to this vector.
Definition at line 348 of file mxvk_math_eigen.hpp.
Subtract two vectors component-wise.
Definition at line 331 of file mxvk_math.h.
Subtract two vectors component-wise.
Definition at line 354 of file mxvk_math_eigen.hpp.
Subtract another vector from this vector.
Definition at line 336 of file mxvk_math.h.
Subtract another vector from this vector.
Definition at line 359 of file mxvk_math_eigen.hpp.
|
inlinenodiscard |
Format this vector as a named angle-bracket tuple.
Definition at line 398 of file mxvk_math.h.
|
inlinenodiscard |
Format this vector as a named angle-bracket tuple.
Definition at line 417 of file mxvk_math_eigen.hpp.
|
inlinenodiscard |
Return a scaled copy of this vector.
Definition at line 349 of file mxvk_math.h.
|
inlinenodiscard |
Return a scaled copy of this vector.
Definition at line 370 of file mxvk_math_eigen.hpp.
|
inline |
Scale this vector in place.
Definition at line 354 of file mxvk_math.h.
|
inline |
Scale this vector in place.
Definition at line 375 of file mxvk_math_eigen.hpp.
|
inline |
Set all vector coordinates.
Definition at line 309 of file mxvk_math.h.
|
inline |
Set all vector coordinates.
Definition at line 334 of file mxvk_math_eigen.hpp.
| float mxvk::vec3D::x = 0.0f |
X coordinate.
Definition at line 294 of file mxvk_math.h.
| float mxvk::vec3D::y = 0.0f |
Y coordinate.
Definition at line 297 of file mxvk_math.h.
| float mxvk::vec3D::z = 0.0f |
Z coordinate.
Definition at line 300 of file mxvk_math.h.