|
RSTools 3.1.0
Versatile C++20 utility library
|
3D vector; arithmetic operators work component-wise, with a vector or a scalar. More...
#include <RST/maths/Vector.hpp>
Public Member Functions | |
| constexpr | Vector3D () noexcept=default |
| constexpr | Vector3D (T xValue, T yValue, T zValue) noexcept |
| constexpr void | set (const T &newX, const T &newY, const T &newZ) noexcept |
| constexpr T | getX () const noexcept |
| constexpr T | getY () const noexcept |
| constexpr T | getZ () const noexcept |
| constexpr T & | operator[] (std::size_t n) noexcept |
| constexpr const T & | operator[] (std::size_t n) const noexcept |
| constexpr T * | data () noexcept |
| constexpr const T * | data () const noexcept |
| constexpr Vector3D | operator+ () const noexcept |
| constexpr Vector3D | operator- () const noexcept |
| constexpr Vector3D & | operator+= (const Vector3D &v) noexcept |
| constexpr Vector3D & | operator-= (const Vector3D &v) noexcept |
| constexpr Vector3D & | operator*= (const Vector3D &v) noexcept |
| constexpr Vector3D & | operator/= (const Vector3D &v) noexcept |
| constexpr Vector3D & | operator*= (T s) noexcept |
| constexpr Vector3D & | operator/= (T s) noexcept |
| constexpr Vector3D & | operator+= (T s) noexcept |
| constexpr Vector3D & | operator-= (T s) noexcept |
| constexpr bool | operator== (const Vector3D &) const noexcept=default |
| constexpr T | dot (const Vector3D &v) const noexcept |
| constexpr Vector3D | cross (const Vector3D &v) const noexcept |
| constexpr auto | lengthSquared () const noexcept |
| constexpr auto | length () const noexcept |
| constexpr auto | distanceSquared (const Vector3D &v) const noexcept |
| constexpr auto | distance (const Vector3D &v) const noexcept |
| constexpr Vector3D & | normalize () noexcept |
| Scales this vector to length 1; a zero vector is left unchanged. | |
| constexpr Vector3D | normalized () const noexcept |
| template<typename U > | |
| constexpr Vector3D< U > | to () const noexcept |
Converts the components, such as v.to<int>(). | |
| constexpr Vector3D | min (const Vector3D &v) const noexcept |
| Component-wise minimum. | |
| constexpr Vector3D | max (const Vector3D &v) const noexcept |
| Component-wise maximum. | |
Public Attributes | |
| T | x {} |
| T | y {} |
| T | z {} |
3D vector; arithmetic operators work component-wise, with a vector or a scalar.
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Scales this vector to length 1; a zero vector is left unchanged.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Converts the components, such as v.to<int>().
|
inlineconstexprnoexcept |
Component-wise minimum.
|
inlineconstexprnoexcept |
Component-wise maximum.
| T RST::Maths::Vector3D< T >::x {} |
| T RST::Maths::Vector3D< T >::y {} |
| T RST::Maths::Vector3D< T >::z {} |