Gjsify LogoGjsify Logo

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.

#CoglMatrixEntrys are reference counted using cogl_matrix_entry_ref() and cogl_matrix_entry_unref() not with cogl_object_ref() and cogl_object_unref().

record

Hierarchy

  • MatrixEntry

Index

Constructors

Properties

name: string

Methods

  • calculateTranslation(entry1: MatrixEntry): [number, number, number, number]
  • 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 [number, number, number, number]

  • Compares two arbitrary #CoglMatrixEntry transforms for equality returning %TRUE if they are equal or %FALSE otherwise.

    In many cases it is unnecessary to use this api and instead direct pointer comparisons of entries are good enough and much cheaper too.

    Parameters

    • entry1: MatrixEntry

      A second #CoglMatrixEntry to compare

    Returns number

  • Resolves the current entry transform into a #CoglMatrix 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 #CoglMatrix 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 [Cogl.Matrix, Cogl.Matrix]

  • isIdentity(): number
  • 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 number

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

    It is an error to pass an entry pointer to cogl_object_ref() and cogl_object_unref()

    Returns MatrixEntry

  • unref(): void
  • 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

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method