Package ch.bailu.gtk.graphene
Class Euler
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Euler
- All Implemented Interfaces:
PointerInterface
Describe a rotation using Euler angles.
The contents of the #graphene_euler_t structure are private
and should never be accessed directly.
The contents of the #graphene_euler_t structure are private
and should never be accessed directly.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Euler
Allocates a new #graphene_euler_t.boolean
Checks if two #graphene_euler_t are equal.void
free()
Frees the resources allocated by graphene_euler_alloc().float
getAlpha()
Retrieves the first component of the Euler angle vector,
depending on the order of rotation.float
getBeta()
Retrieves the second component of the Euler angle vector,
depending on the order of rotation.static ClassHandler
int
float
getGamma()
Retrieves the third component of the Euler angle vector,
depending on the order of rotation.static int
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.static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
float
getX()
Retrieves the rotation angle on the X axis, in degrees.float
getY()
Retrieves the rotation angle on the Y axis, in degrees.float
getZ()
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
(Euler src) Initializes a #graphene_euler_t using the angles and order of
another #graphene_euler_t.initFromMatrix
(Matrix m, int order) Initializes a #graphene_euler_t using the given rotation matrix.initFromQuaternion
(Quaternion q, int order) Initializes a #graphene_euler_t using the given normalized quaternion.initFromRadians
(float x, float y, float z, int order) Initializes a #graphene_euler_t using the given angles
and order of rotation.initFromVec3
(Vec3 v, int order) Initializes a #graphene_euler_t using the angles contained in a
#graphene_vec3_t.initWithOrder
(float x, float y, float z, int order) Initializes a #graphene_euler_t with the given angles and @order.void
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
toQuaternion
(Quaternion res) Converts a #graphene_euler_t into a #graphene_quaternion_t.void
Retrieves the angles of a #graphene_euler_t and initializes a
#graphene_vec3_t with them.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
ANGLES
Private field: direct-type- See Also:
-
ORDER
- See Also:
-
-
Constructor Details
-
Euler
-
Euler
public Euler()
-
-
Method Details
-
getClassHandler
-
getFieldOrder
public int getFieldOrder() -
allocEuler
Allocates a new #graphene_euler_t.
The contents of the returned structure are undefined.- Returns:
- the newly allocated #graphene_euler_t
-
equal
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
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 degreesy
- rotation angle on the Y axis, in degreesz
- rotation angle on the Z axis, in degrees- Returns:
- the initialized #graphene_euler_t
-
initFromEuler
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
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 matrixorder
- the order used to apply the rotations- Returns:
- the initialized #graphene_euler_t
-
initFromQuaternion
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_torder
- the order used to apply the rotations- Returns:
- the initialized #graphene_euler_t
-
initFromRadians
Initializes a #graphene_euler_t using the given angles
and order of rotation.- Parameters:
x
- rotation angle on the X axis, in radiansy
- rotation angle on the Y axis, in radiansz
- rotation angle on the Z axis, in radiansorder
- order of rotations- Returns:
- the initialized #graphene_euler_t
-
initFromVec3
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 degreesorder
- the order used to apply the rotations- Returns:
- the initialized #graphene_euler_t
-
initWithOrder
Initializes a #graphene_euler_t with the given angles and @order.- Parameters:
x
- rotation angle on the X axis, in degreesy
- rotation angle on the Y axis, in degreesz
- rotation angle on the Z axis, in degreesorder
- the order used to apply the rotations- Returns:
- the initialized #graphene_euler_t
-
reorder
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 orderres
- return location for the reordered #graphene_euler_t
-
toMatrix
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
Converts a #graphene_euler_t into a #graphene_quaternion_t.- Parameters:
res
- return location for a #graphene_quaternion_t
-
toVec3
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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-