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


Public Member Functions | |
| vec2 ()=default | |
| vec2 (float v) noexcept | |
| vec2 (float x, float y) noexcept | |
| vec2 (sincos pair) noexcept | |
| float | cross (vec2 other) const noexcept |
| vec2 | rotate (float radians) 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< vec2, shz_vec2_t, 2 > | |
| 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 |
Static Public Member Functions | |
| static vec2 | from_angle (float rads) noexcept |
| static vec2 | from_angle_deg (float deg) noexcept |
Static Public Member Functions inherited from shz::vecN< vec2, shz_vec2_t, 2 > | |
| 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 |
Additional Inherited Members | ||
Public Types inherited from shz::vecN< vec2, shz_vec2_t, 2 > | ||
| using | CppType | |
| using | CType | |
Data Fields inherited from shz_vec2_t | ||
| union { | ||
| float e [2] | ||
| struct { | ||
| float x | ||
| float y | ||
| } | ||
| }; | ||
Static Public Attributes inherited from shz::vecN< vec2, shz_vec2_t, 2 > | ||
| static constexpr size_t | Rows | |
| static constexpr size_t | Cols | |
2D Vector type
C++ structure for representing a 2-dimensional vector.
Definition at line 391 of file shz_vector.hpp.
|
default |
Default constructor: does nothing.
|
inlinenoexcept |
Single-value constructor: sets both components equal to v.
Definition at line 402 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a vec2 with the given values as components.
Definition at line 406 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a vec2 from the given angle of rotation from the +X axis.
Definition at line 410 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Constructs a vec2 from the given angle of rotation from the +X axis, in radians.
Definition at line 414 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Constructs a vec2 from the given angle of rotation from the +X axis, in degrees.
Definition at line 419 of file shz_vector.hpp.
|
inlinenoexcept |
C++ wrapper for shz_vec2_cross().
Definition at line 424 of file shz_vector.hpp.
|
inlinenoexcept |
C++ wrapper for shz_vec2_rotate().
Definition at line 429 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.