|
cangine
|
Three-component floating-point vector. More...
#include <vector3.hpp>
Public Member Functions | |
| constexpr | Vector3 () noexcept=default |
| Constructs a zero vector (x = y = z = 0). | |
| constexpr | Vector3 (float _x, float _y, float _z) noexcept |
| Constructs a vector from explicit components. | |
| constexpr | Vector3 (const Vector2 &xy, float _z) noexcept |
| Constructs a vector from a 2D vector and an explicit z. | |
| constexpr | Vector3 (const Vector2 &xy) noexcept |
| Constructs a vector from a 2D vector with z defaulting to 0. | |
| constexpr Vector3 & | operator+= (const Vector3 &rhs) noexcept |
| Adds another vector component-wise. | |
| constexpr Vector3 & | operator-= (const Vector3 &rhs) noexcept |
| Subtracts another vector component-wise. | |
| constexpr Vector3 & | operator*= (const Vector3 &rhs) noexcept |
| Multiplies by another vector component-wise. | |
| constexpr Vector3 & | operator/= (const Vector3 &rhs) noexcept |
| Divides by another vector component-wise. | |
| constexpr Vector3 & | operator+= (float rhs) noexcept |
| Adds a scalar to all components. | |
| constexpr Vector3 & | operator-= (float rhs) noexcept |
| Subtracts a scalar from all components. | |
| constexpr Vector3 & | operator*= (float rhs) noexcept |
| Multiplies all components by a scalar. | |
| constexpr Vector3 & | operator/= (float rhs) noexcept |
| Divides all components by a scalar. | |
Public Attributes | |
| float | x {} |
| float | y {} |
| float | z {} |
| Vector components. | |
Three-component floating-point vector.
Provides component-wise arithmetic against both other vectors and scalars, plus implicit construction from a Vector2. All operations are constexpr and noexcept.
|
constexprdefaultnoexcept |
Constructs a zero vector (x = y = z = 0).
|
inlineconstexprnoexcept |
Constructs a vector from explicit components.
| _x | Value for the x component. |
| _y | Value for the y component. |
| _z | Value for the z component. |
|
inlineconstexprnoexcept |
Constructs a vector from a 2D vector and an explicit z.
| xy | Source for the x and y components. |
| _z | Value for the z component. |
|
inlineconstexprnoexcept |
Constructs a vector from a 2D vector with z defaulting to 0.
| xy | Source for the x and y components. |
Multiplies by another vector component-wise.
| rhs | Vector to multiply by. |
|
inlineconstexprnoexcept |
Multiplies all components by a scalar.
| rhs | Scalar to multiply by. |
Adds another vector component-wise.
| rhs | Vector to add. |
|
inlineconstexprnoexcept |
Adds a scalar to all components.
| rhs | Scalar to add. |
Subtracts another vector component-wise.
| rhs | Vector to subtract. |
|
inlineconstexprnoexcept |
Subtracts a scalar from all components.
| rhs | Scalar to subtract. |
Divides by another vector component-wise.
| rhs | Vector to divide by. |
|
inlineconstexprnoexcept |
Divides all components by a scalar.
| rhs | Scalar to divide by. |
| float cangine::Vector3::x {} |
| float cangine::Vector3::y {} |
| float cangine::Vector3::z {} |
Vector components.