Quat

Quat

  • x : f32
  • y : f32
  • z : f32
  • w : f32

Description

No Documentation 🚧

Functions

FunctionSummary
abs_diff_eq(_self, rhs, max_abs_diff) Returns true if the absolute difference of all elements between `self` and `rhs` is less than or e
add(_self, rhs) Adds two quaternions. The sum is not guaranteed to be normalized. Note that addition is not the s
angle_between(_self, rhs) Returns the angle (in radians) for the minimal rotation for transforming this quaternion into anot
as_dquat(_self)No Documentation 🚧
clone(_self)No Documentation 🚧
conjugate(_self) Returns the quaternion conjugate of `self`. For a unit quaternion the conjugate is also the invers
div(_self, rhs) Divides a quaternion by a scalar value. The quotient is not guaranteed to be normalized.
dot(_self, rhs) Computes the dot product of `self` and `rhs`. The dot product is equal to the cosine of the angle
eq(_self, rhs)No Documentation 🚧
from_affine3(a) Creates a quaternion from a 3x3 rotation matrix inside a 3D affine transform. Note if the input af
from_array(a) Creates a rotation quaternion from an array. # Preconditions This function does not check if the
from_axis_angle(axis, angle) Create a quaternion for a normalized rotation `axis` and `angle` (in radians). The axis must be a
from_euler(euler, a, b, c) Creates a quaternion from the given Euler rotation sequence and the angles (in radians).
from_mat3(mat) Creates a quaternion from a 3x3 rotation matrix. Note if the input matrix contain scales, shears,
from_mat3a(mat) Creates a quaternion from a 3x3 SIMD aligned rotation matrix. Note if the input matrix contain sca
from_mat4(mat) Creates a quaternion from the upper 3x3 rotation matrix inside a homogeneous 4x4 matrix. Note if t
from_rotation_arc(from, to) Gets the minimal rotation for transforming `from` to `to`. The rotation is in the plane spanned b
from_rotation_arc_2d(from, to) Gets the minimal rotation for transforming `from` to `to`. The resulting rotation is around the z
from_rotation_arc_colinear(from, to) Gets the minimal rotation for transforming `from` to either `to` or `-to`. This means that the re
from_rotation_x(angle) Creates a quaternion from the `angle` (in radians) around the x axis.
from_rotation_y(angle) Creates a quaternion from the `angle` (in radians) around the y axis.
from_rotation_z(angle) Creates a quaternion from the `angle` (in radians) around the z axis.
from_scaled_axis(v) Create a quaternion that rotates `v.length()` radians around `v.normalize()`. `from_scaled_axis(Vec3::ZERO)`
from_vec4(v) Creates a new rotation quaternion from a 4D vector. # Preconditions This function does not check
from_xyzw(x, y, z, w) Creates a new rotation quaternion. This should generally not be called manually unless you know wh
inverse(_self) Returns the inverse of a normalized quaternion. Typically quaternion inverse returns the conjugate
is_finite(_self) Returns `true` if, and only if, all elements are finite. If any element is either `NaN`, positive
is_nan(_self) Returns `true` if any elements are `NAN`.
is_near_identity(_self)No Documentation 🚧
is_normalized(_self) Returns whether `self` of length `1.0` or not. Uses a precision threshold of `1e-6`.
length(_self) Computes the length of `self`.
length_recip(_self) Computes `1.0 / length()`. For valid results, `self` must _not_ be of length zero.
length_squared(_self) Computes the squared length of `self`. This is generally faster than `length()` as it avoids a squ
lerp(_self, end, s) Performs a linear interpolation between `self` and `rhs` based on the value `s`. When `s` is `0.0
mul(_self, rhs) Multiplies two quaternions. If they each represent a rotation, the result will represent the combi
mul-1(arg0, arg1)No Documentation 🚧
mul-2(arg0, arg1)No Documentation 🚧
mul-3(arg0, arg1)No Documentation 🚧
mul_quat(_self, rhs) Multiplies two quaternions. If they each represent a rotation, the result will represent the combi
mul_vec3(_self, rhs) Multiplies a quaternion and a 3D vector, returning the rotated vector. # Panics Will panic if `self`
mul_vec3a(_self, rhs) Multiplies a quaternion and a 3D vector, returning the rotated vector.
neg(_self)No Documentation 🚧
normalize(_self) Returns `self` normalized to length 1.0. For valid results, `self` must _not_ be of length zero.
rotate_towards(_self, rhs, max_angle) Rotates towards `rhs` up to `max_angle` (in radians). When `max_angle` is `0.0`, the result will b
slerp(_self, end, s) Performs a spherical linear interpolation between `self` and `end` based on the value `s`. When `s`
sub(_self, rhs) Subtracts the `rhs` quaternion from `self`. The difference is not guaranteed to be normalized.
to_array(_self) `[x, y, z, w]`
to_euler(_self, order) Returns the rotation angles for the given euler rotation sequence.
to_scaled_axis(_self) Returns the rotation axis scaled by the rotation in radians.
xyz(_self) Returns the vector part of the quaternion.