Basics
Guides
API Reference
Basics
Guides
API Reference
[12:14] static extends: object
Generated struct layout helper for GIR record Quaternion.
layout ()
Returns the Panama struct layout for
Quaternion.
[31:7] extends: object
A quaternion. The contents of the #graphene_quaternion_t structure are private and should never be accessed directly.
GrapheneQuaternion (Handle = null)
Allocates a new #graphene_quaternion_t. The contents of the returned value are undefined.
Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.add (object b)
Adds two #graphene_quaternion_t @a and @b.
b is a #graphene_quaternion_t.res is the result of the operation.None.dot (object b)
Computes the dot product of two #graphene_quaternion_t.
b is a #graphene_quaternion_t.the value of the dot products.equal (object b)
Checks whether the given quaternions are equal.
b is a #graphene_quaternion_t.true if the quaternions are equal.free ()
Releases the resources allocated by graphene_quaternion_alloc().
None.init (double x, double y, double z, double w)
Initializes a #graphene_quaternion_t using the given four values.
x is the first component of the quaternion.y is the second component of the quaternion.z is the third component of the quaternion.w is the fourth component of the quaternion.the initialized quaternion.init_from_angle_vec3 (double angle, object axis)
Initializes a #graphene_quaternion_t using an @angle on a specific @axis.
angle is the rotation on a given axis, in degrees.axis is the axis of rotation, expressed as a vector.the initialized quaternion.init_from_angles (double deg_x, double deg_y, double deg_z)
Initializes a #graphene_quaternion_t using the values of the Euler angles on each axis. See also: graphene_quaternion_init_from_euler()
deg_x is rotation angle on the X axis (yaw), in degrees.deg_y is rotation angle on the Y axis (pitch), in degrees.deg_z is rotation angle on the Z axis (roll), in degrees.the initialized quaternion.init_from_euler (object e)
Initializes a #graphene_quaternion_t using the given #graphene_euler_t.
e is a #graphene_euler_t.the initialized #graphene_quaternion_t.init_from_matrix (object m)
Initializes a #graphene_quaternion_t using the rotation components of a transformation matrix.
m is a #graphene_matrix_t.the initialized quaternion.init_from_quaternion (object src)
Initializes a #graphene_quaternion_t with the values from @src.
src is a #graphene_quaternion_t.the initialized quaternion.init_from_radians (double rad_x, double rad_y, double rad_z)
Initializes a #graphene_quaternion_t using the values of the Euler angles on each axis. See also: graphene_quaternion_init_from_euler()
rad_x is rotation angle on the X axis (yaw), in radians.rad_y is rotation angle on the Y axis (pitch), in radians.rad_z is rotation angle on the Z axis (roll), in radians.the initialized quaternion.init_from_vec4 (object src)
Initializes a #graphene_quaternion_t with the values from @src.
src is a #graphene_vec4_t.the initialized quaternion.init_identity ()
Initializes a #graphene_quaternion_t using the identity transformation.
the initialized quaternion.invert ()
Inverts a #graphene_quaternion_t, and returns the conjugate quaternion of
res is return location for the inverted quaternion.None.multiply (object b)
Multiplies two #graphene_quaternion_t @a and @b.
b is a #graphene_quaternion_t.res is the result of the operation.None.normalize ()
Normalizes a #graphene_quaternion_t.
res is return location for the normalized quaternion.None.scale (double factor)
Scales all the elements of a #graphene_quaternion_t @q using the given scalar factor.
factor is a scaling factor.res is the result of the operation.None.slerp (object b, double factor)
Interpolates between the two given quaternions using a spherical linear interpolation, or SLERP, using the given interpolation @factor.
b is a #graphene_quaternion_t.factor is the linear interpolation factor.res is return location for the interpolated quaternion.None.to_angle_vec3 ()
Converts a quaternion into an @angle, @axis pair.
angle is return location for the angle, in degrees.axis is return location for the rotation axis.None.to_angles ()
Converts a #graphene_quaternion_t to its corresponding rotations on the Euler angles on each axis.
deg_x is return location for the rotation angle on the X axis (yaw), in degrees.deg_y is return location for the rotation angle on the Y axis (pitch), in degrees.deg_z is return location for the rotation angle on the Z axis (roll), in degrees.None.to_matrix ()
Converts a quaternion into a transformation matrix expressing the rotation defined by the #graphene_quaternion_t.
m is a #graphene_matrix_t.None.to_radians ()
Converts a #graphene_quaternion_t to its corresponding rotations on the Euler angles on each axis.
rad_x is return location for the rotation angle on the X axis (yaw), in radians.rad_y is return location for the rotation angle on the Y axis (pitch), in radians.rad_z is return location for the rotation angle on the Z axis (roll), in radians.None.to_vec4 ()
Copies the components of a #graphene_quaternion_t into a #graphene_vec4_t.
res is return location for a #graphene_vec4_t.None.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.