Class Euler
- All Implemented Interfaces:
Proxy
The contents of the graphene_euler_t structure are private
and should never be accessed directly.
- Since:
- 1.2
-
Constructor Summary
ConstructorsConstructorDescriptionEuler()Allocate a new Euler.Allocate a new Euler.Euler(MemorySegment address) 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 TypeMethodDescriptionstatic Euleralloc()Allocates a newgraphene_euler_t.booleanChecks if twographene_euler_tare equal.voidfree()Frees the resources allocated by graphene_euler_alloc().floatgetAlpha()Retrieves the first component of the Euler angle vector, depending on the order of rotation.floatgetBeta()Retrieves the second component of the Euler angle vector, depending on the order of rotation.floatgetGamma()Retrieves the third component of the Euler angle vector, depending on the order of rotation.static MemoryLayoutThe memory layout of the native struct.getOrder()Retrieves the order used to apply the rotations described in thegraphene_euler_tstructure, when converting to and from other structures, likegraphene_quaternion_tandgraphene_matrix_t.static @Nullable TypegetType()Get the GType of the Euler classfloatgetX()Retrieves the rotation angle on the X axis, in degrees.floatgetY()Retrieves the rotation angle on the Y axis, in degrees.floatgetZ()Retrieves the rotation angle on the Z axis, in degrees.init(float x, float y, float z) Initializes agraphene_euler_tusing the given angles.initFromEuler(@Nullable Euler src) Initializes agraphene_euler_tusing the angles and order of anothergraphene_euler_t.initFromMatrix(@Nullable Matrix m, EulerOrder order) Initializes agraphene_euler_tusing the given rotation matrix.initFromQuaternion(@Nullable Quaternion q, EulerOrder order) Initializes agraphene_euler_tusing the given normalized quaternion.initFromRadians(float x, float y, float z, EulerOrder order) Initializes agraphene_euler_tusing the given angles and order of rotation.initFromVec3(@Nullable Vec3 v, EulerOrder order) Initializes agraphene_euler_tusing the angles contained in agraphene_vec3_t.initWithOrder(float x, float y, float z, EulerOrder order) Initializes agraphene_euler_twith the given angles andorder.@Nullable Vec3Read the value of the fieldangles.Read the value of the fieldorder.voidreorder(EulerOrder order, Euler res) Reorders agraphene_euler_tusingorder.voidConverts agraphene_euler_tinto a transformation matrix expressing the extrinsic composition of rotations described by the Euler angles.voidtoQuaternion(Quaternion res) Converts agraphene_euler_tinto agraphene_quaternion_t.voidRetrieves the angles of agraphene_euler_tand initializes agraphene_vec3_twith them.voidwriteAngles(@Nullable Vec3 angles) Write a value in the fieldangles.voidwriteOrder(EulerOrder order) Write a value in the fieldorder.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Euler
Create a Euler proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Euler
Allocate a new Euler.- Parameters:
arena- to control the memory allocation scope
-
Euler
public Euler()Allocate a new Euler. The memory is allocated withArena.ofAuto(). -
Euler
Allocate a new Euler with the fields set to the provided values.- Parameters:
angles- value for the fieldanglesorder- value for the fieldorderarena- to control the memory allocation scope
-
Euler
Allocate a new Euler with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
angles- value for the fieldanglesorder- value for the fieldorder
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readAngles
Read the value of the fieldangles.- Returns:
- The value of the field
angles
-
writeAngles
Write a value in the fieldangles.- Parameters:
angles- The new value for the fieldangles
-
readOrder
Read the value of the fieldorder.- Returns:
- The value of the field
order
-
writeOrder
Write a value in the fieldorder.- Parameters:
order- The new value for the fieldorder
-
alloc
Allocates a newgraphene_euler_t.The contents of the returned structure are undefined.
- Returns:
- the newly allocated
graphene_euler_t - Since:
- 1.2
-
equal
Checks if twographene_euler_tare equal.- Parameters:
b- agraphene_euler_t- Returns:
trueif the twographene_euler_tare 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
Retrieves the order used to apply the rotations described in thegraphene_euler_tstructure, when converting to and from other structures, likegraphene_quaternion_tandgraphene_matrix_t.This function does not return the
EulerOrder.DEFAULTenumeration 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
Initializes agraphene_euler_tusing the given angles.The order of the rotations is
EulerOrder.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 - Since:
- 1.2
-
initFromEuler
Initializes agraphene_euler_tusing the angles and order of anothergraphene_euler_t.If the
graphene_euler_tsrcisnull, this function is equivalent to calling graphene_euler_init() with all angles set to 0.- Parameters:
src- agraphene_euler_t- Returns:
- the initialized
graphene_euler_t - Since:
- 1.2
-
initFromMatrix
Initializes agraphene_euler_tusing the given rotation matrix.If the
graphene_matrix_tmisnull, thegraphene_euler_twill 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 - Since:
- 1.2
-
initFromQuaternion
Initializes agraphene_euler_tusing the given normalized quaternion.If the
graphene_quaternion_tqisnull, thegraphene_euler_twill be initialized with all angles set to 0.- Parameters:
q- a normalizedgraphene_quaternion_torder- the order used to apply the rotations- Returns:
- the initialized
graphene_euler_t - Since:
- 1.2
-
initFromRadians
Initializes agraphene_euler_tusing 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 - Since:
- 1.10
-
initFromVec3
Initializes agraphene_euler_tusing the angles contained in agraphene_vec3_t.If the
graphene_vec3_tvisnull, thegraphene_euler_twill be initialized with all angles set to 0.- Parameters:
v- agraphene_vec3_tcontaining the rotation angles in degreesorder- the order used to apply the rotations- Returns:
- the initialized
graphene_euler_t - Since:
- 1.2
-
initWithOrder
Initializes agraphene_euler_twith the given angles andorder.- 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 - Since:
- 1.2
-
reorder
Reorders agraphene_euler_tusingorder.This function is equivalent to creating a
graphene_quaternion_tfrom the givengraphene_euler_t, and then converting the quaternion into anothergraphene_euler_t.- Parameters:
order- the new orderres- return location for the reorderedgraphene_euler_t- Since:
- 1.2
-
toMatrix
Converts agraphene_euler_tinto 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 isEulerOrder.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 agraphene_matrix_t- Since:
- 1.2
-
toQuaternion
Converts agraphene_euler_tinto agraphene_quaternion_t.- Parameters:
res- return location for agraphene_quaternion_t- Since:
- 1.10
-
toVec3
Retrieves the angles of agraphene_euler_tand initializes agraphene_vec3_twith them.- Parameters:
res- return location for agraphene_vec3_t- Since:
- 1.2
-