A 4-dimensional vector.
More...
#include <Vec4.hpp>
|
| constexpr | Vec4 (void)=default |
| | Default constructor.
|
| |
| constexpr | Vec4 (T x, T y, T z, T w) noexcept |
| | Parameterized constructor.
|
| |
| constexpr | ~Vec4 ()=default |
| | Default destructor.
|
| |
| constexpr bool | operator== (const Vec4 &) const noexcept=default |
| | Checks if two vectors are exactly equal.
|
| |
| constexpr auto & | operator[] (this auto &self, size_t index) noexcept |
| | Accesses the coordinate at the specified index.
|
| |
| constexpr auto | squaredDistance (this const Self &self, const std::remove_cvref_t< Self > &other) noexcept -> T |
| |
| constexpr auto | distance (this const Self &self, const std::remove_cvref_t< Self > &other) noexcept -> RealT |
| |
| constexpr auto | squaredLength (this const Self &self) noexcept -> T |
| |
| constexpr auto | length (this const Self &self) noexcept -> RealT |
| |
| constexpr auto | normalize (this Self &self) noexcept -> Self & |
| |
| constexpr auto | normalized (this const Self &self) noexcept -> std::remove_cvref_t< Self > |
| |
| constexpr auto | dot (this const Self &self, const std::remove_cvref_t< Self > &other) noexcept -> T |
| |
| constexpr auto | project (this const Self &self, const std::remove_cvref_t< Self > &other) noexcept -> std::remove_cvref_t< Self > |
| |
| constexpr auto & | operator+= (this Self &self, const std::remove_cvref_t< Self > &other) noexcept |
| |
| constexpr auto & | operator+= (this Self &self, T scalar) noexcept |
| |
| constexpr auto & | operator-= (this Self &self, const std::remove_cvref_t< Self > &other) noexcept |
| |
| constexpr auto & | operator-= (this Self &self, T scalar) noexcept |
| |
| constexpr auto & | operator*= (this Self &self, const std::remove_cvref_t< Self > &other) noexcept |
| |
| constexpr auto & | operator*= (this Self &self, T scalar) noexcept |
| |
| constexpr auto & | operator/= (this Self &self, const std::remove_cvref_t< Self > &other) noexcept |
| |
| constexpr auto & | operator/= (this Self &self, T scalar) noexcept |
| |
|
| T | x {} |
| | X coordinate.
|
| |
| T | y {} |
| | Y coordinate.
|
| |
| T | z {} |
| | Z coordinate.
|
| |
| T | w {} |
| | W coordinate.
|
| |
|
| using | RealT = std::conditional_t< std::is_integral_v< T >, double, T > |
| |
template<Numeric T>
struct rtp::Vec4< T >
A 4-dimensional vector.
- Template Parameters
-
| T | Must be an integral or floating-point type. |
Definition at line 53 of file Vec4.hpp.
◆ Vec4() [1/2]
Default constructor.
Initializes to (0, 0, 0, 0).
◆ Vec4() [2/2]
template<Numeric T>
| constexpr rtp::Vec4< T >::Vec4 |
( |
T |
x, |
|
|
T |
y, |
|
|
T |
z, |
|
|
T |
w |
|
) |
| |
|
constexprnoexcept |
Parameterized constructor.
◆ ~Vec4()
◆ operator==()
template<Numeric T>
| constexpr bool rtp::Vec4< T >::operator== |
( |
const Vec4< T > & |
| ) |
const |
|
constexprdefaultnoexcept |
Checks if two vectors are exactly equal.
◆ operator[]()
template<Numeric T>
| constexpr auto & rtp::Vec4< T >::operator[] |
( |
this auto & |
self, |
|
|
size_t |
index |
|
) |
| |
|
constexprnoexcept |
Accesses the coordinate at the specified index.
- Parameters
-
| index | The index (0 for x, 1 for y, 2 for z, 3 for w). |
- Returns
- Reference to the coordinate.
W coordinate.
Definition at line 57 of file Vec4.hpp.
X coordinate.
Definition at line 54 of file Vec4.hpp.
Y coordinate.
Definition at line 55 of file Vec4.hpp.
Z coordinate.
Definition at line 56 of file Vec4.hpp.
The documentation for this struct was generated from the following file: