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 float with the rotation on a given axis
xdeg, ydeg, zdeg -- a float with the rotation angle, in degrees
xrad, yrad, zrad -- a float with the rotation angle, in radians
x, y, z, w -- a float with 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.

Note

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

See also

2024-1-20