|
DryPhys 1.0.0
...
|
#include <vector3d.hpp>
Public Member Functions | |
| DRYPHYS_CONSTEXPR | Vector3D () noexcept=default |
| Constructors. | |
| DRYPHYS_CONSTEXPR | Vector3D (const real x, const real y, const real z) noexcept |
| DRYPHYS_CONSTEXPR real & | operator[] (unsigned i) |
| Element access. | |
| DRYPHYS_CONSTEXPR const real & | operator[] (unsigned i) const |
| DRYPHYS_CONSTEXPR void | operator+= (const Vector3D &rhs) |
| Arithmetic Operators. | |
| DRYPHYS_CONSTEXPR Vector3D | operator+ (const Vector3D &rhs) const |
| DRYPHYS_CONSTEXPR void | operator-= (const Vector3D &rhs) |
| DRYPHYS_CONSTEXPR Vector3D | operator- (const Vector3D &rhs) const |
| DRYPHYS_CONSTEXPR void | operator*= (real rhs) |
| DRYPHYS_CONSTEXPR Vector3D | operator* (real rhs) const |
| DRYPHYS_CONSTEXPR void | operator/= (real rhs) |
| DRYPHYS_CONSTEXPR Vector3D | operator/ (real rhs) const |
| DRYPHYS_CONSTEXPR void | operator*= (const Vector3D &rhs) |
| We use operator*= for the component product. | |
| DRYPHYS_CONSTEXPR Vector3D | operator* (const Vector3D &rhs) const |
| We use operator* for the component product. | |
| DRYPHYS_CONSTEXPR real | dot (const Vector3D &rhs) const |
| DRYPHYS_CONSTEXPR Vector3D | cross (const Vector3D &rhs) const |
| DRYPHYS_CONSTEXPR void | invert () |
| DRYPHYS_CONSTEXPR real | magnitudeSquared () const |
| real | magnitude () const |
| void | normalize () |
Private Attributes | |
| real | x {} |
| real | y {} |
| real | z {} |
Friends | |
| DRYPHYS_CONSTEXPR friend bool | operator== (const Vector3D &lhs_, const Vector3D &rhs_) |
| Comparison operators - only the equality operator is symmetric. | |
| DRYPHYS_CONSTEXPR friend bool | operator< (const Vector3D &lhs_, const Vector3D &rhs_) |
| DRYPHYS_CONSTEXPR friend bool | operator> (const Vector3D &lhs_, const Vector3D &rhs_) |
| DRYPHYS_CONSTEXPR friend bool | operator<= (const Vector3D &lhs_, const Vector3D &rhs_) |
| DRYPHYS_CONSTEXPR friend bool | operator>= (const Vector3D &lhs_, const Vector3D &rhs_) |
A class representing a mathematical/physical vector with three dimensions: x, y, z. The type is defined using the tuple-like API so it can be used with structured bindings.
phys_four_word_alignment when building adds an additional, unused variable which makes use of four-word alignment. This is off by default.
|
defaultnoexcept |
Referenced by cross(), dot(), operator*(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator<, operator<=, operator==, operator>, operator>=, and Vector3D().
|
inlinenoexcept |
References Vector3D(), x, y, and z.
|
inline |
References x.
|
inline |
References x.
|
inline |
References Vector3D(), x, y, and z.
References Vector3D(), x, y, and z.
|
inline |
References Vector3D(), x, y, and z.
References Vector3D(), x, y, and z.
|
inline |
References Vector3D(), x, y, and z.
|
inline |
References Vector3D(), x, y, and z.
|
inline |
References Vector3D(), x, y, and z.
References Vector3D(), x, y, and z.
|
inline |
Calculates the dot (scalar) product of the two vectors.
References Vector3D(), x, y, and z.
Calculates the cross (vector) product of the two vectors.
References Vector3D(), x, y, and z.
|
inline |
|
inline |
|
inline |
Calculates the magnitude of this vector
Referenced by GTEST_TEST(), and normalize().
|
inline |
Turns a non-zero vector into a vector of unit length
References magnitude().
Referenced by GTEST_TEST().
References Vector3D(), x, y, and z.
References Vector3D(), x, y, and z.
References Vector3D(), x, y, and z.
References Vector3D(), x, y, and z.
References Vector3D(), x, y, and z.
|
private |
Referenced by cross(), dot(), invert(), magnitude(), magnitudeSquared(), operator*(), operator*(), operator*=(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<, operator<=, operator==, operator>, operator>=, operator[](), operator[](), and Vector3D().
|
private |
Referenced by cross(), dot(), invert(), magnitude(), magnitudeSquared(), operator*(), operator*(), operator*=(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<, operator<=, operator==, operator>, operator>=, and Vector3D().
|
private |
Referenced by cross(), dot(), invert(), magnitude(), magnitudeSquared(), operator*(), operator*(), operator*=(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<, operator<=, operator==, operator>, operator>=, and Vector3D().