Class (GI Struct)

Cogl-18CoglMatrixEntryAbstract

Represents a single immutable transformation that was retrieved from a Cogl.MatrixStack using cogl_matrix_stack_get_entry().

Internally a Cogl.MatrixEntry represents a single matrix operation (such as "rotate", "scale", "translate") which is applied to the transform of a single parent entry.

Using the Cogl.MatrixStack api effectively builds up a graph of these immutable Cogl.MatrixEntry structures whereby operations that can be shared between multiple transformations will result in shared Cogl.MatrixEntry nodes in the graph.

When a Cogl.MatrixStack is first created it references one Cogl.MatrixEntry that represents a single "load identity" operation. This serves as the root entry and all operations that are then applied to the stack will extend the graph starting from this root "load identity" entry.

Given the typical usage model for a Cogl.MatrixStack and the way the entries are built up while traversing a scenegraph then in most cases where an application is interested in comparing two transformations for equality then it is enough to simply compare two Cogl.MatrixEntry pointers directly. Technically this can lead to false negatives that could be identified with a deeper comparison but often these false negatives are unlikely and don't matter anyway so this enables extremely cheap comparisons.

Cogl.MatrixEntrys are reference counted using cogl_matrix_entry_ref() and cogl_matrix_entry_unref() not with g_object_ref() and g_object_unref().

Index

Constructors

Properties

Methods

  • Determines if the only difference between two transforms is a translation and if so returns what the x, y, and z components of the translation are.

    If the difference between the two translations involves anything other than a translation then the function returns false.

    Parameters

    Returns [boolean, number, number, number]

    true if the only difference between the transform of entry0 and the transform of entry1 is a translation, otherwise false.

  • Resolves the current entry transform into a Graphene.Matrix by combining the sequence of operations that have been applied to build up the current transform.

    There are two possible ways that this function may return its result depending on whether it's possible to directly point to an internal Graphene.Matrix or whether the result needs to be composed of multiple operations.

    If an internal matrix contains the required result then this function will directly return a pointer to that matrix, otherwise if the function returns null then matrix will be initialized to match the transform of entry.

    matrix will be left untouched if a direct pointer is returned.

    Returns [Graphene.Matrix, Graphene.Matrix]

    A direct pointer to a Graphene.Matrix transform or null and in that case matrix will be initialized with the effective transform represented by entry.

  • Determines whether entry is known to represent an identity transform.

    If this returns true then the entry is definitely the identity matrix. If it returns false it may or may not be the identity matrix but no expensive comparison is performed to verify it.

    Returns boolean

    true if entry is definitely an identity transform, otherwise false.

  • Takes a reference on the given entry to ensure the entry stays alive and remains valid. When you are finished with the entry then you should call cogl_matrix_entry_unref().

    Returns MatrixEntry

  • Releases a reference on entry either taken by calling cogl_matrix_entry_unref() or to release the reference given when calling cogl_matrix_stack_get_entry().

    Returns void