About my projects, examples and tutorials
NO_TITLE

NO_TITLE

Gnome::Graphene::N-Euler§

Description§

Describe a rotation using Euler angles.

The contents of the Gnome::Graphene::N-Euler structure are private and should never be accessed directly.

Class initialization§

new§

:native-object§

Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object() :$native-object! )
Code

alloc§

Allocates a new Gnome::Graphene::N-Euler.

The contents of the returned structure are undefined.

method alloc ( --> Gnome::Graphene::Euler \)
Code

Methods§

equal§

Checks if two Gnome::Graphene::N-Euler are equal.

method equal ( N-Object $b --> gboolean )
Code
  • $b; a Gnome::Graphene::N-Euler

Return value; true if the two Gnome::Graphene::N-Euler are equal.

free§

Frees the resources allocated by .alloc().

method free ( )
Code

get-alpha§

Retrieves the first component of the Euler angle vector, depending on the order of rotation.

See also: .get-x()

method get-alpha (--> Num )
Code

Return value; the first component of the Euler angle vector, in radians.

get-beta§

Retrieves the second component of the Euler angle vector, depending on the order of rotation.

See also: .get-y()

method get-beta (--> Num )
Code

Return value; the second component of the Euler angle vector, in radians.

get-gamma§

Retrieves the third component of the Euler angle vector, depending on the order of rotation.

See also: .get-z()

method get-gamma (--> Num )
Code

Return value; the third component of the Euler angle vector, in radians.

get-order§

Retrieves the order used to apply the rotations described in the Gnome::Graphene::N-Euler structure, when converting to and from other structures, like Gnome::Graphene::N-Quaternion and Gnome::Graphene::N-Matrix.

This function does not return the GRAPHENE_EULER_ORDER_DEFAULT enumeration value; it will return the effective order of rotation instead.

method get-order (--> graphene_euler_order_t )
Code

Return value; the order used to apply the rotations.

get-x§

Retrieves the rotation angle on the X axis, in degrees.

method get-x (--> Num )
Code

Return value; the rotation angle.

get-y§

Retrieves the rotation angle on the Y axis, in degrees.

method get-y (--> Num )
Code

Return value; the rotation angle.

get-z§

Retrieves the rotation angle on the Z axis, in degrees.

method get-z (--> Num )
Code

Return value; the rotation angle.

init§

Initializes a Gnome::Graphene::N-Euler using the given angles.

The order of the rotations is GRAPHENE_EULER_ORDER_DEFAULT.

method init ( Num() $x, Num() $y, Num() $z --> N-Object )
Code
  • $x; rotation angle on the X axis, in degrees.
  • $y; rotation angle on the Y axis, in degrees.
  • $z; rotation angle on the Z axis, in degrees.

Return value; the initialized Gnome::Graphene::N-Euler.

init-from-euler§

Initializes a Gnome::Graphene::N-Euler using the angles and order of another Gnome::Graphene::N-Euler.

If the Gnome::Graphene::N-Euler $src is undefined, this function is equivalent to calling .init() with all angles set to 0.

method init-from-euler ( N-Object $src --> N-Object )
Code
  • $src; a Gnome::Graphene::N-Euler

Return value; the initialized Gnome::Graphene::N-Euler.

init-from-matrix§

Initializes a Gnome::Graphene::N-Euler using the given rotation matrix.

If the Gnome::Graphene::N-Matrix $m is undefined, the Gnome::Graphene::N-Euler will be initialized with all angles set to 0.

method init-from-matrix ( N-Object $m, graphene_euler_order_t $order --> N-Object )
Code
  • $m; a rotation matrix
  • $order; the order used to apply the rotations.

Return value; the initialized Gnome::Graphene::N-Euler.

init-from-quaternion§

Initializes a Gnome::Graphene::N-Euler using the given normalized quaternion.

If the Gnome::Graphene::N-Quaternion $q is undefined, the Gnome::Graphene::N-Euler will be initialized with all angles set to 0.

method init-from-quaternion ( N-Object $q, graphene_euler_order_t $order --> N-Object )
Code
  • $q; a normalized Gnome::Graphene::N-Quaternion
  • $order; the order used to apply the rotations.

Return value; the initialized Gnome::Graphene::N-Euler.

init-from-radians§

Initializes a Gnome::Graphene::N-Euler using the given angles and order of rotation.

method init-from-radians ( Num() $x, Num() $y, Num() $z, graphene_euler_order_t $order --> N-Object )
Code
  • $x; rotation angle on the X axis, in radians.
  • $y; rotation angle on the Y axis, in radians.
  • $z; rotation angle on the Z axis, in radians.
  • $order; order of rotations.

Return value; the initialized Gnome::Graphene::N-Euler.

init-from-vec3§

Initializes a Gnome::Graphene::N-Euler using the angles contained in a graphene_vec3_t.

If the graphene_vec3_t $v is undefined, the Gnome::Graphene::N-Euler will be initialized with all angles set to 0.

method init-from-vec3 ( N-Object $v, graphene_euler_order_t $order --> N-Object )
Code
  • $v; a graphene_vec3_t containing the rotation angles in degrees
  • $order; the order used to apply the rotations.

Return value; the initialized Gnome::Graphene::N-Euler.

init-with-order§

Initializes a Gnome::Graphene::N-Euler with the given angles and $order.

method init-with-order ( Num() $x, Num() $y, Num() $z, graphene_euler_order_t $order --> N-Object )
Code
  • $x; rotation angle on the X axis, in degrees.
  • $y; rotation angle on the Y axis, in degrees.
  • $z; rotation angle on the Z axis, in degrees.
  • $order; the order used to apply the rotations.

Return value; the initialized Gnome::Graphene::N-Euler.

reorder§

Reorders a Gnome::Graphene::N-Euler using $order.

This function is equivalent to creating a Gnome::Graphene::N-Quaternion from the given Gnome::Graphene::N-Euler, and then converting the quaternion into another Gnome::Graphene::N-Euler.

method reorder ( graphene_euler_order_t $order, N-Object $res )
Code
  • $order; the new order.
  • $res; return location for the reordered Gnome::Graphene::N-Euler

to-matrix§

Converts a Gnome::Graphene::N-Euler into a transformation matrix expressing the extrinsic composition of rotations described by the Euler angles.

The rotations are applied over the reference frame axes in the order associated with the Gnome::Graphene::N-Euler; for instance, if the order used to initialize $e is GRAPHENE_EULER_ORDER_XYZ:

* the first rotation moves the body around the X axis with
  an angle φ
* the second rotation moves the body around the Y axis with
  an angle of Ï‘
* the third rotation moves the body around the Z axis with
  an angle of ψ
Code

The rotation sign convention is right-handed, to preserve compatibility between Euler-based, quaternion-based, and angle-axis-based rotations.

method to-matrix ( N-Object $res )
Code
  • $res; return location for a Gnome::Graphene::N-Matrix

to-quaternion§

Converts a Gnome::Graphene::N-Euler into a Gnome::Graphene::N-Quaternion.

method to-quaternion ( N-Object $res )
Code
  • $res; return location for a Gnome::Graphene::N-Quaternion

to-vec3§

Retrieves the angles of a Gnome::Graphene::N-Euler and initializes a graphene_vec3_t with them.

method to-vec3 ( N-Object $res )
Code
  • $res; return location for a graphene_vec3_t