Cogl.Euler

Fields

Name

Type

Access

Description

heading

float

r/w

Angle to rotate around an object’s y axis

padding0

float

r

padding1

float

r

padding2

float

r

padding3

float

r

padding4

float

r

pitch

float

r/w

Angle to rotate around an object’s x axis

roll

float

r/w

Angle to rotate around an object’s z axis

Methods

class

equal (v1, v2)

copy ()

free ()

init (heading, pitch, roll)

init_from_matrix (matrix)

init_from_quaternion (quaternion)

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, with Cogl.Euler.init() and Cogl.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:
  • v1 (object or None) – The first euler angle to compare

  • v2 (object or None) – The second euler angle to compare

Returns:

True if v1 and v2 are equal else False.

Return type:

int

Compares the two given euler angles v1 and v1 and it they are equal returns True else False.

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:

Cogl.Euler

Allocates a new Cogl.Euler and initilizes it with the component angles of self. The newly allocated euler should be freed using Cogl.Euler.free().

New in version 2.0.

free()

Frees a Cogl.Euler that was previously allocated using Cogl.Euler.copy().

New in version 2.0.

init(heading, pitch, roll)
Parameters:
  • heading (float) – Angle to rotate around an object’s y axis

  • pitch (float) – Angle to rotate around an object’s x axis

  • roll (float) – Angle to rotate around an object’s z axis

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) – A Cogl.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) – A Cogl.Euler with the rotation to initialize with

Initializes a self rotation with the equivalent rotation represented by the given quaternion.