Cogl.MatrixEntry
Description: Reference for Cogl.MatrixEntry

### Struct

# CoglMatrixEntry

#### Description [src]

    struct CoglMatrixEntry {
      /* No available fields */
    }

Represents a single immutable transformation that was retrieved from a `CoglMatrixStack` using cogl_matrix_stack_get_entry().

Internally a `CoglMatrixEntry` represents a single matrix operation (such as “rotate”, “scale”, “translate”) which is applied to the transform of a single parent entry.

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

When a `CoglMatrixStack` is first created it references one `CoglMatrixEntry` 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 `CoglMatrixStack` 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 `CoglMatrixEntry` 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.

`CoglMatrixEntry`s are reference counted using `cogl_matrix_entry_ref()` and `cogl_matrix_entry_unref()` not with `g_object_ref()` and g_object_unref().

#### Instance methods

###### cogl_matrix_entry_calculate_translation

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.

###### cogl_matrix_entry_get

Resolves the current `entry` transform into a #graphene_matrix_t by combining the sequence of operations that have been applied to build up the current transform.

###### cogl_matrix_entry_is_identity

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

###### cogl_matrix_entry_ref

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().

###### cogl_matrix_entry_unref

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().