Graphene.Euler¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
angles |
r |
||
order |
r |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Graphene.Euler¶
Describe a rotation using Euler angles.
The contents of the
Graphene.Eulerstructure are private and should never be accessed directly.New in version 1.2.
- classmethod alloc()¶
- Returns:
the newly allocated
Graphene.Euler- Return type:
Allocates a new
Graphene.Euler.The contents of the returned structure are undefined.
New in version 1.2.
- equal(b)¶
- Parameters:
b (
Graphene.Euler) – aGraphene.Euler- Returns:
trueif the twoGraphene.Eulerare equal- Return type:
Checks if two
Graphene.Eulerare equal.New in version 1.2.
- free()¶
Frees the resources allocated by
Graphene.Euler.alloc().New in version 1.2.
- get_alpha()¶
- Returns:
the first component of the Euler angle vector, in radians
- Return type:
Retrieves the first component of the Euler angle vector, depending on the order of rotation.
See also:
Graphene.Euler.get_x()New in version 1.10.
- get_beta()¶
- Returns:
the second component of the Euler angle vector, in radians
- Return type:
Retrieves the second component of the Euler angle vector, depending on the order of rotation.
See also:
Graphene.Euler.get_y()New in version 1.10.
- get_gamma()¶
- Returns:
the third component of the Euler angle vector, in radians
- Return type:
Retrieves the third component of the Euler angle vector, depending on the order of rotation.
See also:
Graphene.Euler.get_z()New in version 1.10.
- get_order()¶
- Returns:
the order used to apply the rotations
- Return type:
Retrieves the order used to apply the rotations described in the
Graphene.Eulerstructure, when converting to and from other structures, likeGraphene.QuaternionandGraphene.Matrix.This function does not return the
Graphene.EulerOrder.DEFAULTenumeration value; it will return the effective order of rotation instead.New in version 1.2.
- get_x()¶
- Returns:
the rotation angle
- Return type:
Retrieves the rotation angle on the X axis, in degrees.
New in version 1.2.
- get_y()¶
- Returns:
the rotation angle
- Return type:
Retrieves the rotation angle on the Y axis, in degrees.
New in version 1.2.
- get_z()¶
- Returns:
the rotation angle
- Return type:
Retrieves the rotation angle on the Z axis, in degrees.
New in version 1.2.
- init(x, y, z)¶
- Parameters:
- Returns:
the initialized
Graphene.Euler- Return type:
Initializes a
Graphene.Eulerusing the given angles.The order of the rotations is
Graphene.EulerOrder.DEFAULT.New in version 1.2.
- init_from_euler(src)¶
- Parameters:
src (
Graphene.EulerorNone) – aGraphene.Euler- Returns:
the initialized
Graphene.Euler- Return type:
Initializes a
Graphene.Eulerusing the angles and order of anotherGraphene.Euler.If the
Graphene.Eulersrc isNone, this function is equivalent to callingGraphene.Euler.init() with all angles set to 0.New in version 1.2.
- init_from_matrix(m, order)¶
- Parameters:
m (
Graphene.MatrixorNone) – a rotation matrixorder (
Graphene.EulerOrder) – the order used to apply the rotations
- Returns:
the initialized
Graphene.Euler- Return type:
Initializes a
Graphene.Eulerusing the given rotation matrix.If the
Graphene.Matrixm isNone, theGraphene.Eulerwill be initialized with all angles set to 0.New in version 1.2.
- init_from_quaternion(q, order)¶
- Parameters:
q (
Graphene.QuaternionorNone) – a normalizedGraphene.Quaternionorder (
Graphene.EulerOrder) – the order used to apply the rotations
- Returns:
the initialized
Graphene.Euler- Return type:
Initializes a
Graphene.Eulerusing the given normalized quaternion.If the
Graphene.Quaternionq isNone, theGraphene.Eulerwill be initialized with all angles set to 0.New in version 1.2.
- init_from_radians(x, y, z, order)¶
- Parameters:
x (
float) – rotation angle on the X axis, in radiansy (
float) – rotation angle on the Y axis, in radiansz (
float) – rotation angle on the Z axis, in radiansorder (
Graphene.EulerOrder) – order of rotations
- Returns:
the initialized
Graphene.Euler- Return type:
Initializes a
Graphene.Eulerusing the given angles and order of rotation.New in version 1.10.
- init_from_vec3(v, order)¶
- Parameters:
v (
Graphene.Vec3orNone) – aGraphene.Vec3containing the rotation angles in degreesorder (
Graphene.EulerOrder) – the order used to apply the rotations
- Returns:
the initialized
Graphene.Euler- Return type:
Initializes a
Graphene.Eulerusing the angles contained in aGraphene.Vec3.If the
Graphene.Vec3v isNone, theGraphene.Eulerwill be initialized with all angles set to 0.New in version 1.2.
- init_with_order(x, y, z, order)¶
- Parameters:
x (
float) – rotation angle on the X axis, in degreesy (
float) – rotation angle on the Y axis, in degreesz (
float) – rotation angle on the Z axis, in degreesorder (
Graphene.EulerOrder) – the order used to apply the rotations
- Returns:
the initialized
Graphene.Euler- Return type:
Initializes a
Graphene.Eulerwith the given angles and order.New in version 1.2.
- reorder(order)¶
- Parameters:
order (
Graphene.EulerOrder) – the new order- Returns:
return location for the reordered
Graphene.Euler- Return type:
res:
Graphene.Euler
Reorders a
Graphene.Eulerusing order.This function is equivalent to creating a
Graphene.Quaternionfrom the givenGraphene.Euler, and then converting the quaternion into anotherGraphene.Euler.New in version 1.2.
- to_matrix()¶
- Returns:
return location for a
Graphene.Matrix- Return type:
res:
Graphene.Matrix
Converts a
Graphene.Eulerinto 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; for instance, if the order used to initialize self isGraphene.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.
New in version 1.2.
- to_quaternion()¶
- Returns:
return location for a
Graphene.Quaternion- Return type:
res:
Graphene.Quaternion
Converts a
Graphene.Eulerinto aGraphene.Quaternion.New in version 1.10.
- to_vec3()¶
- Returns:
return location for a
Graphene.Vec3- Return type:
res:
Graphene.Vec3
Retrieves the angles of a
Graphene.Eulerand initializes aGraphene.Vec3with them.New in version 1.2.