Cogl.Euler¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
heading |
r/w |
Angle to rotate around an object’s y axis |
|
padding0 |
r |
||
padding1 |
r |
||
padding2 |
r |
||
padding3 |
r |
||
padding4 |
r |
||
pitch |
r/w |
Angle to rotate around an object’s x axis |
|
roll |
r/w |
Angle to rotate around an object’s z axis |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
Details¶
- class Cogl.Euler¶
Represents an ordered rotation first of heading degrees around an object’s y axis, then pitch degrees around an object’s x axis and finally roll degrees around an object’s z axis.
It’s important to understand the that axis are associated with the object being rotated, so the axis also rotate in sequence with the rotations being applied. The members of a
Cogl.Euler
can be initialized, for example, withCogl.Euler.init
() andCogl.Euler.init_from_quaternion
().You may also want to look at
Cogl.Quaternion.init_from_euler
() if you want to do interpolation between 3d rotations.New in version 2.0.
- classmethod equal(v1, v2)¶
- Parameters:
- Returns:
- Return type:
Compares the two given euler angles v1 and v1 and it they are equal returns
True
elseFalse
.This function only checks that all three components rotations are numerically equal, it does not consider that some rotations can be represented with different component rotations
New in version 2.0.
- copy()¶
- Returns:
A newly allocated
Cogl.Euler
- Return type:
Allocates a new
Cogl.Euler
and initilizes it with the component angles of self. The newly allocated euler should be freed usingCogl.Euler.free
().New in version 2.0.
- free()¶
Frees a
Cogl.Euler
that was previously allocated usingCogl.Euler.copy
().New in version 2.0.
- init(heading, pitch, roll)¶
- Parameters:
Initializes self to represent a rotation of x_angle degrees around the x axis, then y_angle degrees around the y_axis and z_angle degrees around the z axis.
New in version 2.0.
- init_from_matrix(matrix)¶
- Parameters:
matrix (
Cogl.Matrix
) – ACogl.Matrix
containing a rotation, but no scaling, mirroring or skewing.
Extracts a euler rotation from the given matrix and initializses self with the component x, y and z rotation angles.
- init_from_quaternion(quaternion)¶
- Parameters:
quaternion (
Cogl.Quaternion
) – ACogl.Euler
with the rotation to initialize with
Initializes a self rotation with the equivalent rotation represented by the given quaternion.