Class Euler

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class Euler extends ProxyInstance

Describe a rotation using Euler angles.

The contents of the graphene_euler_t structure are private and should never be accessed directly.

Since:
1.2
  • Constructor Summary

    Constructors
    Constructor
    Description
    Allocate a new Euler.
    Euler(Arena arena)
    Allocate a new Euler.
    Create a Euler proxy instance for the provided memory address.
    Euler(Vec3 angles, EulerOrder order)
    Allocate a new Euler with the fields set to the provided values.
    Euler(Vec3 angles, EulerOrder order, Arena arena)
    Allocate a new Euler with the fields set to the provided values.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Euler
    Allocates a new graphene_euler_t.
    boolean
    Checks if two graphene_euler_t are equal.
    void
    Frees the resources allocated by graphene_euler_alloc().
    float
    Retrieves the first component of the Euler angle vector, depending on the order of rotation.
    float
    Retrieves the second component of the Euler angle vector, depending on the order of rotation.
    float
    Retrieves the third component of the Euler angle vector, depending on the order of rotation.
    The memory layout of the native struct.
    Retrieves the order used to apply the rotations described in the graphene_euler_t structure, when converting to and from other structures, like graphene_quaternion_t and graphene_matrix_t.
    static @Nullable Type
    Get the GType of the Euler class.
    float
    Retrieves the rotation angle on the X axis, in degrees.
    float
    Retrieves the rotation angle on the Y axis, in degrees.
    float
    Retrieves the rotation angle on the Z axis, in degrees.
    init(float x, float y, float z)
    Initializes a graphene_euler_t using the given angles.
    initFromEuler(@Nullable Euler src)
    Initializes a graphene_euler_t using the angles and order of another graphene_euler_t.
    initFromMatrix(@Nullable Matrix m, EulerOrder order)
    Initializes a graphene_euler_t using the given rotation matrix.
    Initializes a graphene_euler_t using the given normalized quaternion.
    initFromRadians(float x, float y, float z, EulerOrder order)
    Initializes a graphene_euler_t using the given angles and order of rotation.
    initFromVec3(@Nullable Vec3 v, EulerOrder order)
    Initializes a graphene_euler_t using the angles contained in a graphene_vec3_t.
    initWithOrder(float x, float y, float z, EulerOrder order)
    Initializes a graphene_euler_t with the given angles and order.
    @Nullable Vec3
    Read the value of the field angles.
    Read the value of the field order.
    void
    reorder(EulerOrder order, Euler res)
    Reorders a graphene_euler_t using order.
    void
    Converts a graphene_euler_t into a transformation matrix expressing the extrinsic composition of rotations described by the Euler angles.
    void
    Converts a graphene_euler_t into a graphene_quaternion_t.
    void
    toVec3(Vec3 res)
    Retrieves the angles of a graphene_euler_t and initializes a graphene_vec3_t with them.
    void
    writeAngles(@Nullable Vec3 angles)
    Write a value in the field angles.
    void
    Write a value in the field order.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Euler

      public Euler(MemorySegment address)
      Create a Euler proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Euler

      public Euler(Arena arena)
      Allocate a new Euler.
      Parameters:
      arena - to control the memory allocation scope
    • Euler

      public Euler()
      Allocate a new Euler. The memory is allocated with Arena.ofAuto().
    • Euler

      public Euler(Vec3 angles, EulerOrder order, Arena arena)
      Allocate a new Euler with the fields set to the provided values.
      Parameters:
      angles - value for the field angles
      order - value for the field order
      arena - to control the memory allocation scope
    • Euler

      public Euler(Vec3 angles, EulerOrder order)
      Allocate a new Euler with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      angles - value for the field angles
      order - value for the field order
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the Euler class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readAngles

      public @Nullable Vec3 readAngles()
      Read the value of the field angles.
      Returns:
      The value of the field angles
    • writeAngles

      public void writeAngles(@Nullable Vec3 angles)
      Write a value in the field angles.
      Parameters:
      angles - The new value for the field angles
    • readOrder

      public EulerOrder readOrder()
      Read the value of the field order.
      Returns:
      The value of the field order
    • writeOrder

      public void writeOrder(EulerOrder order)
      Write a value in the field order.
      Parameters:
      order - The new value for the field order
    • alloc

      public static Euler alloc()

      Allocates a new graphene_euler_t.

      The contents of the returned structure are undefined.

      Returns:
      the newly allocated graphene_euler_t
      Since:
      1.2
    • equal

      public boolean equal(Euler b)
      Checks if two graphene_euler_t are equal.
      Parameters:
      b - a graphene_euler_t
      Returns:
      true if the two graphene_euler_t are equal
      Since:
      1.2
    • free

      public void free()
      Frees the resources allocated by graphene_euler_alloc().
      Since:
      1.2
    • getAlpha

      public float getAlpha()

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

      See also: graphene_euler_get_x()

      Returns:
      the first component of the Euler angle vector, in radians
      Since:
      1.10
    • getBeta

      public float getBeta()

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

      See also: graphene_euler_get_y()

      Returns:
      the second component of the Euler angle vector, in radians
      Since:
      1.10
    • getGamma

      public float getGamma()

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

      See also: graphene_euler_get_z()

      Returns:
      the third component of the Euler angle vector, in radians
      Since:
      1.10
    • getOrder

      public EulerOrder getOrder()

      Retrieves the order used to apply the rotations described in the graphene_euler_t structure, when converting to and from other structures, like graphene_quaternion_t and graphene_matrix_t.

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

      Returns:
      the order used to apply the rotations
      Since:
      1.2
    • getX

      public float getX()
      Retrieves the rotation angle on the X axis, in degrees.
      Returns:
      the rotation angle
      Since:
      1.2
    • getY

      public float getY()
      Retrieves the rotation angle on the Y axis, in degrees.
      Returns:
      the rotation angle
      Since:
      1.2
    • getZ

      public float getZ()
      Retrieves the rotation angle on the Z axis, in degrees.
      Returns:
      the rotation angle
      Since:
      1.2
    • init

      public Euler init(float x, float y, float z)

      Initializes a graphene_euler_t using the given angles.

      The order of the rotations is EulerOrder.DEFAULT.

      Parameters:
      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
      Returns:
      the initialized graphene_euler_t
      Since:
      1.2
    • initFromEuler

      public Euler initFromEuler(@Nullable Euler src)

      Initializes a graphene_euler_t using the angles and order of another graphene_euler_t.

      If the graphene_euler_t src is null, this function is equivalent to calling graphene_euler_init() with all angles set to 0.

      Parameters:
      src - a graphene_euler_t
      Returns:
      the initialized graphene_euler_t
      Since:
      1.2
    • initFromMatrix

      public Euler initFromMatrix(@Nullable Matrix m, EulerOrder order)

      Initializes a graphene_euler_t using the given rotation matrix.

      If the graphene_matrix_t m is null, the graphene_euler_t will be initialized with all angles set to 0.

      Parameters:
      m - a rotation matrix
      order - the order used to apply the rotations
      Returns:
      the initialized graphene_euler_t
      Since:
      1.2
    • initFromQuaternion

      public Euler initFromQuaternion(@Nullable Quaternion q, EulerOrder order)

      Initializes a graphene_euler_t using the given normalized quaternion.

      If the graphene_quaternion_t q is null, the graphene_euler_t will be initialized with all angles set to 0.

      Parameters:
      q - a normalized graphene_quaternion_t
      order - the order used to apply the rotations
      Returns:
      the initialized graphene_euler_t
      Since:
      1.2
    • initFromRadians

      public Euler initFromRadians(float x, float y, float z, EulerOrder order)
      Initializes a graphene_euler_t using the given angles and order of rotation.
      Parameters:
      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
      Returns:
      the initialized graphene_euler_t
      Since:
      1.10
    • initFromVec3

      public Euler initFromVec3(@Nullable Vec3 v, EulerOrder order)

      Initializes a graphene_euler_t using the angles contained in a graphene_vec3_t.

      If the graphene_vec3_t v is null, the graphene_euler_t will be initialized with all angles set to 0.

      Parameters:
      v - a graphene_vec3_t containing the rotation angles in degrees
      order - the order used to apply the rotations
      Returns:
      the initialized graphene_euler_t
      Since:
      1.2
    • initWithOrder

      public Euler initWithOrder(float x, float y, float z, EulerOrder order)
      Initializes a graphene_euler_t with the given angles and order.
      Parameters:
      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
      Returns:
      the initialized graphene_euler_t
      Since:
      1.2
    • reorder

      public void reorder(EulerOrder order, Euler res)

      Reorders a graphene_euler_t using order.

      This function is equivalent to creating a graphene_quaternion_t from the given graphene_euler_t, and then converting the quaternion into another graphene_euler_t.

      Parameters:
      order - the new order
      res - return location for the reordered graphene_euler_t
      Since:
      1.2
    • toMatrix

      public void toMatrix(Matrix res)

      Converts a graphene_euler_t 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 graphene_euler_t; for instance, if the order used to initialize this Euler is EulerOrder.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 ψ

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

      Parameters:
      res - return location for a graphene_matrix_t
      Since:
      1.2
    • toQuaternion

      public void toQuaternion(Quaternion res)
      Converts a graphene_euler_t into a graphene_quaternion_t.
      Parameters:
      res - return location for a graphene_quaternion_t
      Since:
      1.10
    • toVec3

      public void toVec3(Vec3 res)
      Retrieves the angles of a graphene_euler_t and initializes a graphene_vec3_t with them.
      Parameters:
      res - return location for a graphene_vec3_t
      Since:
      1.2