Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GrapheneQuaternionLayout

[12:14] static extends: object

Generated struct layout helper for GIR record Quaternion.

Methods

  • layout ()

    Returns the Panama struct layout for Quaternion.

class: GrapheneQuaternion

[31:7] extends: object

A quaternion. The contents of the #graphene_quaternion_t structure are private and should never be accessed directly.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GrapheneQuaternion (Handle = null)

    Allocates a new #graphene_quaternion_t. The contents of the returned value are undefined.

    • @p 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 exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • add (object b)

    Adds two #graphene_quaternion_t @a and @b.

    • @p b is a #graphene_quaternion_t.
    • @p res is the result of the operation.
    • @r None.
  • dot (object b)

    Computes the dot product of two #graphene_quaternion_t.

    • @p b is a #graphene_quaternion_t.
    • @r the value of the dot products.
  • equal (object b)

    Checks whether the given quaternions are equal.

    • @p b is a #graphene_quaternion_t.
    • @r true if the quaternions are equal.
  • free ()

    Releases the resources allocated by graphene_quaternion_alloc().

    • @r None.
  • init (double x, double y, double z, double w)

    Initializes a #graphene_quaternion_t using the given four values.

    • @p x is the first component of the quaternion.
    • @p y is the second component of the quaternion.
    • @p z is the third component of the quaternion.
    • @p w is the fourth component of the quaternion.
    • @r the initialized quaternion.
  • init_from_angle_vec3 (double angle, object axis)

    Initializes a #graphene_quaternion_t using an @angle on a specific @axis.

    • @p angle is the rotation on a given axis, in degrees.
    • @p axis is the axis of rotation, expressed as a vector.
    • @r 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()

    • @p deg_x is rotation angle on the X axis (yaw), in degrees.
    • @p deg_y is rotation angle on the Y axis (pitch), in degrees.
    • @p deg_z is rotation angle on the Z axis (roll), in degrees.
    • @r the initialized quaternion.
  • init_from_euler (object e)

    Initializes a #graphene_quaternion_t using the given #graphene_euler_t.

    • @p e is a #graphene_euler_t.
    • @r the initialized #graphene_quaternion_t.
  • init_from_matrix (object m)

    Initializes a #graphene_quaternion_t using the rotation components of a transformation matrix.

    • @p m is a #graphene_matrix_t.
    • @r the initialized quaternion.
  • init_from_quaternion (object src)

    Initializes a #graphene_quaternion_t with the values from @src.

    • @p src is a #graphene_quaternion_t.
    • @r 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()

    • @p rad_x is rotation angle on the X axis (yaw), in radians.
    • @p rad_y is rotation angle on the Y axis (pitch), in radians.
    • @p rad_z is rotation angle on the Z axis (roll), in radians.
    • @r the initialized quaternion.
  • init_from_vec4 (object src)

    Initializes a #graphene_quaternion_t with the values from @src.

    • @p src is a #graphene_vec4_t.
    • @r the initialized quaternion.
  • init_identity ()

    Initializes a #graphene_quaternion_t using the identity transformation.

    • @r the initialized quaternion.
  • invert ()

    Inverts a #graphene_quaternion_t, and returns the conjugate quaternion of

    • @q. ``
    • @p res is return location for the inverted quaternion.
    • @r None.
  • multiply (object b)

    Multiplies two #graphene_quaternion_t @a and @b.

    • @p b is a #graphene_quaternion_t.
    • @p res is the result of the operation.
    • @r None.
  • normalize ()

    Normalizes a #graphene_quaternion_t.

    • @p res is return location for the normalized quaternion.
    • @r None.
  • scale (double factor)

    Scales all the elements of a #graphene_quaternion_t @q using the given scalar factor.

    • @p factor is a scaling factor.
    • @p res is the result of the operation.
    • @r None.
  • slerp (object b, double factor)

    Interpolates between the two given quaternions using a spherical linear interpolation, or SLERP, using the given interpolation @factor.

    • @p b is a #graphene_quaternion_t.
    • @p factor is the linear interpolation factor.
    • @p res is return location for the interpolated quaternion.
    • @r None.
  • to_angle_vec3 ()

    Converts a quaternion into an @angle, @axis pair.

    • @p angle is return location for the angle, in degrees.
    • @p axis is return location for the rotation axis.
    • @r None.
  • to_angles ()

    Converts a #graphene_quaternion_t to its corresponding rotations on the Euler angles on each axis.

    • @p deg_x is return location for the rotation angle on the X axis (yaw), in degrees.
    • @p deg_y is return location for the rotation angle on the Y axis (pitch), in degrees.
    • @p deg_z is return location for the rotation angle on the Z axis (roll), in degrees.
    • @r None.
  • to_matrix ()

    Converts a quaternion into a transformation matrix expressing the rotation defined by the #graphene_quaternion_t.

    • @p m is a #graphene_matrix_t.
    • @r None.
  • to_radians ()

    Converts a #graphene_quaternion_t to its corresponding rotations on the Euler angles on each axis.

    • @p rad_x is return location for the rotation angle on the X axis (yaw), in radians.
    • @p rad_y is return location for the rotation angle on the Y axis (pitch), in radians.
    • @p rad_z is return location for the rotation angle on the Z axis (roll), in radians.
    • @r None.
  • to_vec4 ()

    Copies the components of a #graphene_quaternion_t into a #graphene_vec4_t.

    • @p res is return location for a #graphene_vec4_t.
    • @r None.