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.Euler
structure 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:
true
if the twoGraphene.Euler
are equal- Return type:
Checks if two
Graphene.Euler
are 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.Euler
structure, when converting to and from other structures, likeGraphene.Quaternion
andGraphene.Matrix
.This function does not return the
Graphene.EulerOrder.DEFAULT
enumeration 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.Euler
using the given angles.The order of the rotations is
Graphene.EulerOrder.DEFAULT
.New in version 1.2.
- init_from_euler(src)¶
- Parameters:
src (
Graphene.Euler
orNone
) – aGraphene.Euler
- Returns:
the initialized
Graphene.Euler
- Return type:
Initializes a
Graphene.Euler
using the angles and order of anotherGraphene.Euler
.If the
Graphene.Euler
src 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.Matrix
orNone
) – a rotation matrixorder (
Graphene.EulerOrder
) – the order used to apply the rotations
- Returns:
the initialized
Graphene.Euler
- Return type:
Initializes a
Graphene.Euler
using the given rotation matrix.If the
Graphene.Matrix
m isNone
, theGraphene.Euler
will be initialized with all angles set to 0.New in version 1.2.
- init_from_quaternion(q, order)¶
- Parameters:
q (
Graphene.Quaternion
orNone
) – a normalizedGraphene.Quaternion
order (
Graphene.EulerOrder
) – the order used to apply the rotations
- Returns:
the initialized
Graphene.Euler
- Return type:
Initializes a
Graphene.Euler
using the given normalized quaternion.If the
Graphene.Quaternion
q isNone
, theGraphene.Euler
will 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.Euler
using the given angles and order of rotation.New in version 1.10.
- init_from_vec3(v, order)¶
- Parameters:
v (
Graphene.Vec3
orNone
) – aGraphene.Vec3
containing the rotation angles in degreesorder (
Graphene.EulerOrder
) – the order used to apply the rotations
- Returns:
the initialized
Graphene.Euler
- Return type:
Initializes a
Graphene.Euler
using the angles contained in aGraphene.Vec3
.If the
Graphene.Vec3
v isNone
, theGraphene.Euler
will 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.Euler
with 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.Euler
using order.This function is equivalent to creating a
Graphene.Quaternion
from 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.Euler
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
; 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.Euler
into 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.Euler
and initializes aGraphene.Vec3
with them.New in version 1.2.