Package: graphene

Macro graphene:with-quaternion

Lambda List

graphene:with-quaternion ((var &rest args) &body body)

Syntax

(graphene:with-quaternion (q) body) => result
(graphene:with-quaternion (q q1) body) => result
(graphene:with-quaternion (q (v graphene:vec4-t)) body) => result
(graphene:with-quaternion (q (m graphene:matrix-t)) body) => result
(graphene:with-quaternion (q (e graphene:euler-t)) body) => result
(graphene:with-quaternion (q angle axis) body) => result
(graphene:with-quaternion (q xdeg ydeg zdeg) body) => result
(graphene:with-quaternion (q xrad yrad zrad) body) => result
(graphene:with-quaternion (q x y z w) body) => result

Arguments

q -- a graphene:quaternion-t instance to create and initialize
q1 -- a graphene:quaternion-t instance to use for initialization
v -- a graphene:vec4-t instance to use for initialization
e -- a graphene:euler-t instance to use for initialization
axis -- a graphene:vec3-t instance to use for initialization
angle -- a single float for the rotation on a given axis
xdeg, ydeg, zdeg -- a single float for the rotation angle, in degrees
xrad, yrad, zrad -- a single float for the rotation angle, in radians
x, y, z, w -- a single float for the component of a quaternion

Details

The graphene:with-quaternion macro allocates a new graphene:quaternion-t instance, initializes the box with the given values and executes the body that uses the box. After execution of the body the allocated memory for the quaternion is released.

Notes

The memory is allocated with the graphene:quaternion-alloc function and released with the graphene:quaternion-free function.
 

See also

2025-4-7