CauldronGPU.Quat (CauldronGPU v0.3.3)

Copy Markdown View Source

Rotations as unit quaternions {x, y, z, w}, in the renderer's frame: right-handed, +Y up, the camera looking down -Z.

CauldronGPU.Quat.yaw_pitch(:math.pi() / 2, -0.2)

Summary

Functions

A rotation of angle radians about axis (any length but zero).

No rotation.

The rotation a applied after b.

vector turned by rotation.

Turn yaw radians about +Y, then tilt pitch radians about the turned +X.

Types

t()

@type t() :: {float(), float(), float(), float()}

vec3()

@type vec3() :: {number(), number(), number()}

Functions

axis_angle(arg, angle)

@spec axis_angle(vec3(), number()) :: t()

A rotation of angle radians about axis (any length but zero).

identity()

@spec identity() :: t()

No rotation.

multiply(arg1, arg2)

@spec multiply(t(), t()) :: t()

The rotation a applied after b.

rotate(arg1, arg2)

@spec rotate(t(), vec3()) :: {float(), float(), float()}

vector turned by rotation.

yaw_pitch(yaw, pitch)

@spec yaw_pitch(number(), number()) :: t()

Turn yaw radians about +Y, then tilt pitch radians about the turned +X.