Class Euler

All Implemented Interfaces:
PointerInterface

public class Euler extends Record
Describe a rotation using Euler angles.

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

https://ebassi.github.io/graphene/docs/

  • Field Details

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getFieldOrder

      public int getFieldOrder()
    • allocEuler

      public static Euler allocEuler()
      Allocates a new #graphene_euler_t.

      The contents of the returned structure are undefined.
      Returns:
      the newly allocated #graphene_euler_t
    • equal

      public boolean equal(@Nonnull 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
    • free

      public void free()
      Frees the resources allocated by graphene_euler_alloc().
    • 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
    • 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
    • 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
    • getOrder

      public int 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 %GRAPHENE_EULER_ORDER_DEFAULT
      enumeration value; it will return the effective order of rotation
      instead.
      Returns:
      the order used to apply the rotations
    • getX

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

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

      public float getZ()
      Retrieves the rotation angle on the Z axis, in degrees.
      Returns:
      the rotation angle
    • 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 %GRAPHENE_EULER_ORDER_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
    • 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
    • initFromMatrix

      public Euler initFromMatrix(@Nullable Matrix m, int 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
    • initFromQuaternion

      public Euler initFromQuaternion(@Nullable Quaternion q, int 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
    • initFromRadians

      public Euler initFromRadians(float x, float y, float z, int 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
    • initFromVec3

      public Euler initFromVec3(@Nullable Vec3 v, int 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
    • initWithOrder

      public Euler initWithOrder(float x, float y, float z, int 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
    • reorder

      public void reorder(int order, @Nonnull 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
    • toMatrix

      public void toMatrix(@Nonnull 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 @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 ψ

      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
    • toQuaternion

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

      public void toVec3(@Nonnull 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
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()