Skip to content

Search

Belgeler

quat

Rotations as quaternions { x, y, z, w }: from an axis and an angle, from one direction to another or from a rotation_euler, composed, inverted and…

Bu sayfada

Rotations as quaternions { x, y, z, w }: from an axis and an angle, from one direction to another or from a rotation_euler, composed, inverted and applied to a vector. Through glamx on libm, so every platform turns alike.

8 functions, 0 constants. Scripts reach it as quat::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

function acts on what it does
from_arc(Vec3, Vec3) -> quat::Quat — The shortest turn that takes the direction from onto to.
from_axis_angle(Vec3, float) -> quat::Quat — A turn of angle radians about axis, which need not be unit length.
from_euler(Vec3) -> quat::Quat — A transform's rotation_euler, in radians, as a quaternion.
identity() -> quat::Quat — The rotation that turns nothing.
inverse(quat::Quat) -> quat::Quat — The turn that undoes q.
mul(quat::Quat, quat::Quat) -> quat::Quat — b, then a: the composed rotation, as a child's turn under its parent's is mul(parent, child).
rotate(quat::Quat, Vec3) -> Vec3 — v turned by q.
to_euler(quat::Quat) -> Vec3 — A quaternion as the rotation_euler a transform takes, in radians.

Emin misin?