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


Public Member Functions | |
| vec3 ()=default | |
| vec3 (shz_vec3_t other) noexcept | |
| vec3 (float v) noexcept | |
| vec3 (float x, float y, float z) noexcept | |
| vec3 (shz::vec2 xy, float z) noexcept | |
| vec3 (float x, shz::vec2 yz) noexcept | |
| vec3 (sincos azimuth, sincos elevation) noexcept | |
| vec2 | xy () const noexcept |
| vec3 | cross (vec3 other) const noexcept |
| float | triple (vec3 b, vec3 c) const noexcept |
| vec3 | perp () const noexcept |
| vec3 | reject (vec3 onto) const noexcept |
| vec3 | barycenter (vec3 a, vec3 b, vec3 c) 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< vec3, shz_vec3_t, 3 > | |
| 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 auto | orthonormalize (vec3 in1, vec3 in2) noexcept |
| static void | orthonormalize (vec3 in1, vec3 in2, vec3 *out1, vec3 *out2) noexcept |
| static vec3 | cubic_hermite (vec3 v1, vec3 tangent1, vec3 v2, vec3 tangent2, float amount) noexcept |
| static vec3 | from_angles (float azimuth_rads, float elevation_rads) noexcept |
| static vec3 | from_angles_deg (float azimuth_deg, float elevation_deg) noexcept |
Static Public Member Functions inherited from shz::vecN< vec3, shz_vec3_t, 3 > | |
| 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< vec3, shz_vec3_t, 3 > | ||
| using | CppType | |
| using | CType | |
Data Fields inherited from shz_vec3_t | ||
| union { | ||
| float e [3] | ||
| struct { | ||
| union { | ||
| struct { | ||
| float x | ||
| float y | ||
| } | ||
| shz_vec2_t xy | ||
| } | ||
| float z | ||
| } | ||
| }; | ||
Static Public Attributes inherited from shz::vecN< vec3, shz_vec3_t, 3 > | ||
| static constexpr size_t | Rows | |
| static constexpr size_t | Cols | |
3D Vector type
C++ structure for representing a 3-dimensional vector.
Definition at line 443 of file shz_vector.hpp.
|
default |
Default constructor: does nothing.
|
inlinenoexcept |
C constructor: constructs a C++ vec3 from a C shz_vec3_t.
Definition at line 454 of file shz_vector.hpp.
|
inlinenoexcept |
Single-value constructor: initializes all components to v.
Definition at line 458 of file shz_vector.hpp.
|
inlinenoexcept |
Value constructor: initializes each component to its given value.
Definition at line 462 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a vec3 from a shz::vec2 and a scalar value for its z component.
Definition at line 466 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a vec3 from a scalar as its x component and a shz::vec2 as its Y and Z components.
Definition at line 470 of file shz_vector.hpp.
Returns a 3D vector which forms the given angles with the +X axis.
Definition at line 474 of file shz_vector.hpp.
Returns 2 3D vectors which are normalized and orthogonal to the two input vectors as a std::pair<>.
Definition at line 478 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Returns 2 3D vectors which are normalized and orthogonal to the two input vectors via output pointers.
Definition at line 485 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Calculates the cubic hermite interpolation between two vectors and their tangents.
Definition at line 490 of file shz_vector.hpp.
|
inlinenoexcept |
Definition at line 495 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Returns a 3D vector which forms the given angles with the +X axis, in radians.
Definition at line 500 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Returns a 3D vector which forms the given angles with the +X axis, in degrees.
Definition at line 505 of file shz_vector.hpp.
Returns a 3D vector which forms the given angles with the +X axis.
Definition at line 510 of file shz_vector.hpp.
Returns the 3D vector "triple product" between the given vector and vectors a and b.
Definition at line 515 of file shz_vector.hpp.
|
inlinenoexcept |
Returns a 3D vector which is perpendicular to this vector.
Definition at line 520 of file shz_vector.hpp.
Returns the 3D reject vector of the given vector and another.
Definition at line 525 of file shz_vector.hpp.
Computes the barycentric coordinates <u, v, w> for the given 3D vector, within the plane of the triangle formed by the given vertices, a, b, and c.
Definition at line 530 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.