![]() |
SH4ZAM! 0.7.0
Fast math library for the Sega Dreamcast's SH4 CPU
|
#include <shz_vector.hpp>


Public Member Functions | |
| vec4 ()=default | |
| vec4 (const shz_vec4_t &other) noexcept | |
| vec4 (float v) noexcept | |
| vec4 (float x, float y, float z, float w) noexcept | |
| vec4 (const shz::vec2 &xy, float z, float w) noexcept | |
| vec4 (float x, const shz::vec2 &yz, float w) noexcept | |
| vec4 (float x, float y, const shz::vec2 &zw) noexcept | |
| vec4 (const shz::vec2 &xy, const shz::vec2 &zw) noexcept | |
| vec4 (const shz::vec3 &xyz, float w) noexcept | |
| vec4 (float x, const shz::vec3 &yzw) noexcept | |
| vec2 | xy () const noexcept |
| vec2 | zw () const noexcept |
| vec3 | xyz () const noexcept |
| vecN () noexcept=default | |
| vecN (const vecN &other) noexcept=default | |
| vecN (const CType &other) noexcept | |
| vecN (const volatile CType &other) noexcept | |
| float | dot (const CppType &other) const noexcept |
| vec2 | dot (const CppType &v1, const CppType &v2) const noexcept |
| vec3 | dot (const CppType &v1, const CppType &v2, const CppType &v3) const noexcept |
Public Member Functions inherited from shz::vecN< vec4, shz_vec4_t, 4 > | |
| vecN () noexcept=default | |
| vecN (const vecN &other) noexcept=default | |
| vecN (const CType &other) noexcept | |
| vecN (const volatile CType &other) noexcept | |
| T | to () const noexcept |
| CppType & | deref (const auto *raw) noexcept |
| CppType & | operator+= (const CppType &other) noexcept |
| CppType & | operator-= (const CppType &other) noexcept |
| CppType & | operator*= (const CppType &other) noexcept |
| CppType & | operator*= (float other) noexcept |
| CppType & | operator/= (const CppType &other) noexcept |
| CppType & | operator/= (float other) noexcept |
| CppType | swizzle () const noexcept |
| CppType | abs () const noexcept |
| CppType | neg () const noexcept |
| CppType | inv () const noexcept |
| float | max () const noexcept |
| float | min () const noexcept |
| CppType | clamp (float min, float max) const noexcept |
| CppType | floor () const noexcept |
| CppType | ceil () const noexcept |
| CppType | round () const noexcept |
| CppType | fract () const noexcept |
| CppType | sign () const noexcept |
| CppType | saturate () const noexcept |
| CppType | minv (const CppType &other) const noexcept |
| CppType | maxv (const CppType &other) const noexcept |
| float | dot (const CppType &other) const noexcept |
| vec2 | dot (const CppType &v1, const CppType &v2) const noexcept |
| vec3 | dot (const CppType &v1, const CppType &v2, const CppType &v3) const noexcept |
| float | magnitude () const noexcept |
| float | magnitude_sqr () const noexcept |
| float | magnitude_inv () const noexcept |
| CppType | direction () const noexcept |
| CppType | direction_safe () const noexcept |
| void | normalize () noexcept |
| void | normalize_safe () noexcept |
| CppType | normalized () const noexcept |
| CppType | normalized_safe () const noexcept |
| float | distance (const CppType &other) const noexcept |
| float | distance_sqr (const CppType &other) const noexcept |
| CppType | move (const CppType &target, float maxdist) const noexcept |
| CppType | reflect (const CppType &normal) const noexcept |
| CppType | refract (const CppType &normal, float eta) const noexcept |
| CppType | project (const CppType &onto) const noexcept |
| CppType | project_safe (const CppType &onto) const noexcept |
| float | angle_between (const CppType &other) const noexcept |
| auto | angles () const noexcept |
Additional Inherited Members | ||
Public Types inherited from shz::vecN< vec4, shz_vec4_t, 4 > | ||
| using | CppType | |
| using | CType | |
Static Public Member Functions inherited from shz::vecN< vec4, shz_vec4_t, 4 > | ||
| static CppType | from (const auto &raw) noexcept | |
| static CppType | lerp (const CppType &start, const CppType &end, float t) noexcept | |
| static CppType | step (const CppType &vec, T &&edge) noexcept | |
| static CppType | smoothstep (const CppType &vec, T &&edge0, T &&edge1) noexcept | |
| static CppType | smoothstep_safe (const CppType &vec, T &&edge0, T &&edge1) noexcept | |
Data Fields inherited from shz_vec4_t | ||
| union { | ||
| float e [4] | ||
| struct { | ||
| union { | ||
| struct { | ||
| float x | ||
| float y | ||
| float z | ||
| } | ||
| shz_vec3_t xyz | ||
| } | ||
| float w | ||
| } | ||
| struct { | ||
| shz_vec2_t xy | ||
| shz_vec2_t zw | ||
| } | ||
| }; | ||
Static Public Attributes inherited from shz::vecN< vec4, shz_vec4_t, 4 > | ||
| static constexpr size_t | Rows | |
| static constexpr size_t | Cols | |
4D Vector type
C++ structure for representing a 4-dimensional vector.
Definition at line 569 of file shz_vector.hpp.
|
default |
Default constructor: does nothing.
|
inlinenoexcept |
C Constructor: initializes a C++ shz::vec4 from a C shz_vec4_t.
Definition at line 583 of file shz_vector.hpp.
|
inlinenoexcept |
Single-value constructor: initializes each element to the given value.
Definition at line 587 of file shz_vector.hpp.
|
inlinenoexcept |
Value constructor: initializes each element to its corresponding parameter value.
Definition at line 591 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a 4D vector with a 2D vector providing the X and Y coordinates and scalars providing Z and W.
Definition at line 595 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a 4D vector with scalars providing X and W coordinates and a 2D vector providing Y and Z.
Definition at line 599 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a 4D vector with scalars providing X and Y coordinaets and a 2D vector providing Z and W.
Definition at line 603 of file shz_vector.hpp.
Constructs a 4D vector from the components provided by the given pair of 2D vectors.
Definition at line 607 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a 4D vector with the X, Y, and Z components given by a 3D vector and W given by a scalar.
Definition at line 611 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a 4D vector with the X component given by a scalar and the Y, Z, and W components given by a 3D vector.
Definition at line 615 of file shz_vector.hpp.
|
inlinenoexcept |
Definition at line 619 of file shz_vector.hpp.
|
inlinenoexcept |
Definition at line 624 of file shz_vector.hpp.
|
inlinenoexcept |
Definition at line 629 of file shz_vector.hpp.
|
defaultnoexcept |
Default constructor, does nothing.
Converting constructor from existing C instance.
Definition at line 57 of file shz_vector.hpp.
Converting constructor from existing volatile C instance.
Definition at line 61 of file shz_vector.hpp.
Returns the dot product of the given vector and another.
Definition at line 255 of file shz_vector.hpp.
Returns the dot product of the given vector against two others.
Definition at line 260 of file shz_vector.hpp.
|
noexcept |
Returns the dot product of the given vector against three others.
Definition at line 263 of file shz_vector.hpp.