Package: graphene

Macro graphene:with-euler

Lambda List

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

Syntax

(graphene:with-euler (euler) body) => result
(graphene:with-euler (euler euler1) body) => result
(graphene:with-euler (euler (mat graphene:matrix-t)) body) => result
(graphene:with-euler (euler (mat graphene:matrix-t) order) body) => result
(graphene:with-euler (euler (quat graphene:quaternion-t)) body) => result
(graphene:with-euler (euler (quat graphene:quaternion-t) order) body) => result
(graphene:with-euler (euler (vec graphene:vec3-t)) body) => result
(graphene:with-euler (euler (vec graphene:vec3-t) order) body) => result
(graphene:with-euler (euler x y z) body) => result
(graphene:with-euler (euler x y z order) body) => result
(graphene:with-euler (euler (x :rad) y z) body) => result
(graphene:with-euler (euler (x :rad) y z order) body) => result

Arguments

euler -- a graphene:euler-t instance to create and initialize
euler1 -- a graphene:euler-t instance to use for initialization
mat -- a graphene:matrix-t instance to use for initialization
quat -- a graphene:quaternion-t instance to use for initialization
vec -- a graphene:vec3-t instance to use for initialization
x, y, z -- a number coerced to a single float
order -- a graphene:euler-order-t value

Details

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

When no argument is given the components of the instance are initialized with zeros. The initialization from another instance is done with the graphene:euler-init-from-euler function. The initialization from other Graphene types is done with the graphene:euler-init-from-matrix, graphene:euler-init-from-quaternion and graphene:euler-init-from-vec3 functions.

The graphene:euler-init function initializes an instance with the rotation angles in degrees and the graphene:euler-init-from-radians function initializes an instance with the rotation angles in radians. In addition it is possible to initalize the order of the rotations.

Note

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

See also

2024-9-9