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


Public Member Functions | |
| vec4 ()=default | |
| vec4 (shz_vec4_t other) noexcept | |
| vec4 (float v) noexcept | |
| vec4 (float x, float y, float z, float w) noexcept | |
| vec4 (shz::vec2 xy, float z, float w) noexcept | |
| vec4 (float x, shz::vec2 yz, float w) noexcept | |
| vec4 (float x, float y, shz::vec2 zw) noexcept | |
| vec4 (shz::vec2 xy, shz::vec2 zw) noexcept | |
| vec4 (shz::vec3 xyz, float w) noexcept | |
| vec4 (float x, shz::vec3 yzw) noexcept | |
| vec2 | xy () const noexcept |
| vec2 | zw () const noexcept |
| vec3 | xyz () const noexcept |
| vecN ()=default | |
| vecN (CType other) noexcept | |
| float | dot (CppType other) const noexcept |
| vec2 | dot (CppType v1, CppType v2) const noexcept |
| vec3 | dot (CppType v1, CppType v2, CppType v3) const noexcept |
Public Member Functions inherited from shz::vecN< vec4, shz_vec4_t, 4 > | |
| vecN ()=default | |
| vecN (CType other) noexcept | |
| T | to () const noexcept |
| CppType & | deref (const auto *raw) noexcept |
| CppType & | operator+= (CppType other) noexcept |
| CppType & | operator-= (CppType other) noexcept |
| CppType & | operator*= (CppType other) noexcept |
| CppType & | operator*= (float other) noexcept |
| CppType & | operator/= (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 (CppType other) const noexcept |
| CppType | maxv (CppType other) const noexcept |
| float | dot (CppType other) const noexcept |
| vec2 | dot (CppType v1, CppType v2) const noexcept |
| vec3 | dot (CppType v1, CppType v2, CppType v3) const noexcept |
| float | magnitude () const noexcept |
| float | magnitude_sqr () const noexcept |
| float | magnitude_inv () const noexcept |
| CppType | direction () const noexcept |
| void | normalize () noexcept |
| CppType | direction_safe () const noexcept |
| void | normalize_safe () noexcept |
| float | distance (const CppType &other) const noexcept |
| float | distance_sqr (const CppType &other) const noexcept |
| CppType | move (CppType target, float maxdist) const noexcept |
| CppType | reflect (CppType normal) const noexcept |
| CppType | refract (CppType normal, float eta) const noexcept |
| CppType | project (CppType onto) const noexcept |
| CppType | project_safe (CppType onto) const noexcept |
| float | angle_between (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 (CppType start, CppType end, float t) noexcept | |
| static CppType | step (CppType vec, T edge) noexcept | |
| static CppType | smoothstep (CppType vec, T edge0, T edge1) noexcept | |
| static CppType | smoothstep_safe (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 544 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 555 of file shz_vector.hpp.
|
inlinenoexcept |
Single-value constructor: initializes each element to the given value.
Definition at line 559 of file shz_vector.hpp.
|
inlinenoexcept |
Value constructor: initializes each element to its corresponding parameter value.
Definition at line 563 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 567 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 571 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 575 of file shz_vector.hpp.
Constructs a 4D vector from the components provided by the given pair of 2D vectors.
Definition at line 579 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 583 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 587 of file shz_vector.hpp.
|
inlinenoexcept |
Definition at line 591 of file shz_vector.hpp.
|
inlinenoexcept |
Definition at line 596 of file shz_vector.hpp.
|
inlinenoexcept |
Definition at line 601 of file shz_vector.hpp.
|
default |
Default constructor, does nothing.
Converting constructor from existing C instance.
Definition at line 54 of file shz_vector.hpp.
Returns the dot product of the given vector and another.
Definition at line 246 of file shz_vector.hpp.
Returns the dot product of the given vector against two others.
Definition at line 251 of file shz_vector.hpp.
Returns the dot product of the given vector against three others.
Definition at line 254 of file shz_vector.hpp.