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


Public Member Functions | |
| quat () noexcept=default | |
| quat (float w, float x, float y, float z) noexcept | |
| quat (shz_quat_t q) noexcept | |
| float | angle () const noexcept |
| vec3 | axis () const noexcept |
| float | angle_x () const noexcept |
| float | angle_y () const noexcept |
| float | angle_z () const noexcept |
| vec3 | to_angles_xyz () const noexcept |
| void | to_axis_angle (shz_vec3_t *axis, float *angle) const noexcept |
| auto | to_axis_angle () const noexcept -> std::pair< vec3, float > |
| float | magnitude_sqr () const noexcept |
| float | magnitude () const noexcept |
| float | magnitude_inv () const noexcept |
| void | normalize () noexcept |
| quat | normalized () const noexcept |
| void | normalize_safe () noexcept |
| quat | normalized_safe () const noexcept |
| void | conjugate () noexcept |
| quat | conjugated () const noexcept |
| void | invert () noexcept |
| quat | inverse () const noexcept |
| quat | add (quat rhs) const noexcept |
| quat | scale (float s) const noexcept |
| float | dot (quat other) const noexcept |
| vec2 | dot (quat q1, quat q2) const noexcept |
| vec3 | dot (quat q1, quat q2, quat q3) const noexcept |
| quat | mult (quat rhs) const noexcept |
| vec3 | transform (vec3 in) const noexcept |
Static Public Member Functions | |
| static quat | identity () noexcept |
| static quat | from_angles_xyz (float x, float y, float z) noexcept |
| static quat | from_axis_angle (vec3 axis, float angle) noexcept |
| static quat | from_look_axis (vec3 forward, vec3 up) noexcept |
| static quat | from_rotated_axis (vec3 start, vec3 end) noexcept |
| static quat | lerp (quat q, quat p, float t) noexcept |
| static quat | nlerp (quat q, quat p, float t) noexcept |
| static quat | slerp (quat q, quat p, float t) noexcept |
Static Public Attributes | |
| static constexpr float | slerp_phi_epsilon |
Friends | |
| auto | operator== (quat lhs, quat rhs) noexcept |
Additional Inherited Members | ||
Data Fields inherited from shz_quat_t | ||
| union { | ||
| struct { | ||
| float w | ||
| union { | ||
| struct { | ||
| float x | ||
| float y | ||
| float z | ||
| } | ||
| shz_vec3_t axis | ||
| } | ||
| } | ||
| float e [4] | ||
| }; | ||
C++ structure representing a quaternion.
A quaternion represents a rotation about an arbitrary axis in 3D space.
Definition at line 38 of file shz_quat.hpp.
|
defaultnoexcept |
Default constructor: does nothing.
|
inlinenoexcept |
Value constructor: initializes a quaternion with the given values for each component.
Definition at line 46 of file shz_quat.hpp.
|
inlinenoexcept |
C Converting constructor: constructs a C++ shz::quat from a C shz_quat_t.
Definition at line 50 of file shz_quat.hpp.
|
inlinestaticnoexcept |
Returns an identity quaternion.
Definition at line 54 of file shz_quat.hpp.
|
inlinestaticnoexcept |
C++ convenience wrapper for shz_quat_From_angles_xyz().
Definition at line 59 of file shz_quat.hpp.
initializes a quaternion which is a rotation in angle degrees about the given axis.
Definition at line 64 of file shz_quat.hpp.
Creates a quaternion looking in the given direction with the given reference direction.
Definition at line 69 of file shz_quat.hpp.
Returns the quaternion representing the rotation from the start to the end axes.
Definition at line 74 of file shz_quat.hpp.
Returns the quaternion that is linearly interpolating q to p, by a t factor of 0.0f-1.0f.
Definition at line 79 of file shz_quat.hpp.
Equivalent to lerp(), except that the resulting quaternion is normalized.
Definition at line 84 of file shz_quat.hpp.
Returns the quaternion that is spherically linearly interpolating q to p, by a t factor of 0.0f-1.0f.
Definition at line 93 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the angle of rotation represented by the given quaternion.
Definition at line 130 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the axis of rotation represented by the given quaternion.
Definition at line 135 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the angle of rotation about the X axis represented by the given quaternion.
Definition at line 140 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the angle of rotation about the Y axis represented by the given quaternion.
Definition at line 145 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the angle of rotation about the Z axis represented by the given quaternion.
Definition at line 150 of file shz_quat.hpp.
|
inlinenoexcept |
Definition at line 154 of file shz_quat.hpp.
|
inlinenoexcept |
Returns both the axis and angle of rotation through the pointer arguments.
Definition at line 159 of file shz_quat.hpp.
|
inlinenoexcept |
Returns both the axis and angle of rotation as a std::pair.
Definition at line 164 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the magnitude of the quaternion squared.
Definition at line 171 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the magnitude of the quaternion.
Definition at line 176 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the inverse of the magnitude of the quaternion.
Definition at line 181 of file shz_quat.hpp.
|
inlinenoexcept |
Normalizes the given quaternion.
Definition at line 186 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the given quaternion as a unit quaternion.
Definition at line 191 of file shz_quat.hpp.
|
inlinenoexcept |
Safely normalizes the given quaternion by protecting against division-by-zero.
Definition at line 196 of file shz_quat.hpp.
|
inlinenoexcept |
Returns a safely normalized quaternion from the given quaternion, protecting against division-by-zero.
Definition at line 201 of file shz_quat.hpp.
|
inlinenoexcept |
Conjugates the given quaternion.
Definition at line 206 of file shz_quat.hpp.
|
inlinenoexcept |
Returns a quaternion that is the conjugate of the given quaternion.
Definition at line 211 of file shz_quat.hpp.
|
inlinenoexcept |
Inverts the given quaternion.
Definition at line 216 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the inverse of the given quaternion.
Definition at line 221 of file shz_quat.hpp.
Returns a new quaternion from adding the given quaterion to rhs.
Definition at line 226 of file shz_quat.hpp.
|
inlinenoexcept |
Returns a new quaternion from scaling the given quaterion by s.
Definition at line 231 of file shz_quat.hpp.
|
inlinenoexcept |
Returns the dot product between the given quaternion and another.
Definition at line 236 of file shz_quat.hpp.
Returns the dot product of the given quaternion against two others.
Definition at line 241 of file shz_quat.hpp.
Returns the dot product of the given quaternion against three others.
Definition at line 246 of file shz_quat.hpp.
Returns a new quaterion from multiplying the given quaternion by another.
Definition at line 251 of file shz_quat.hpp.
Returns a new shz::vec3 from transforming in by the given quaternion.
Definition at line 256 of file shz_quat.hpp.
Overloaded comparison operator, checks for quaternion equality.
Definition at line 125 of file shz_quat.hpp.
|
staticconstexpr |
Minimum epsilon for bothering to interpolate in shz::quat::slerp().
Definition at line 40 of file shz_quat.hpp.