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


Public Member Functions | |
| vec3 ()=default | |
| vec3 (const shz_vec3_t &other) noexcept | |
| vec3 (float v) noexcept | |
| vec3 (float x, float y, float z) noexcept | |
| vec3 (const shz::vec2 &xy, float z) noexcept | |
| vec3 (float x, const shz::vec2 &yz) noexcept | |
| vec3 (const sincos &azimuth, const sincos &elevation) noexcept | |
| vec2 | xy () const noexcept |
| vec3 | cross (const vec3 &other) const noexcept |
| float | triple (const vec3 &b, const vec3 &c) const noexcept |
| vec3 | perp () const noexcept |
| vec3 | reject (const vec3 &onto) const noexcept |
| vec3 | barycenter (const vec3 &a, const vec3 &b, const vec3 &c) 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< vec3, shz_vec3_t, 3 > | |
| 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 |
Static Public Member Functions | |
| static auto | orthonormalize (const vec3 &in1, const vec3 &in2) noexcept |
| static void | orthonormalize (const vec3 &in1, const vec3 &in2, vec3 *out1, vec3 *out2) noexcept |
| static vec3 | cubic_hermite (const vec3 &v1, const vec3 &tangent1, const vec3 &v2, const 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 (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 |
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 465 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 479 of file shz_vector.hpp.
|
inlinenoexcept |
Single-value constructor: initializes all components to v.
Definition at line 483 of file shz_vector.hpp.
|
inlinenoexcept |
Value constructor: initializes each component to its given value.
Definition at line 487 of file shz_vector.hpp.
|
inlinenoexcept |
Constructs a vec3 from a shz::vec2 and a scalar value for its z component.
Definition at line 491 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 495 of file shz_vector.hpp.
Returns a 3D vector which forms the given angles with the +X axis.
Definition at line 499 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 503 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 510 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Calculates the cubic hermite interpolation between two vectors and their tangents.
Definition at line 515 of file shz_vector.hpp.
|
inlinenoexcept |
Definition at line 520 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Returns a 3D vector which forms the given angles with the +X axis, in radians.
Definition at line 525 of file shz_vector.hpp.
|
inlinestaticnoexcept |
Returns a 3D vector which forms the given angles with the +X axis, in degrees.
Definition at line 530 of file shz_vector.hpp.
Returns a 3D vector which forms the given angles with the +X axis.
Definition at line 535 of file shz_vector.hpp.
Returns the 3D vector "triple product" between the given vector and vectors a and b.
Definition at line 540 of file shz_vector.hpp.
|
inlinenoexcept |
Returns a 3D vector which is perpendicular to this vector.
Definition at line 545 of file shz_vector.hpp.
Returns the 3D reject vector of the given vector and another.
Definition at line 550 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 555 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.