[ Compact ]
public class MatrixEntry
Represents a single immutable transformation that was retrieved from a MatrixStack
Internally a MatrixEntry represents a single matrix operation (such as "rotate", "scale", "translate") which
is applied to the transform of a single parent entry.
Using the MatrixStack api effectively builds up a graph of these immutable
MatrixEntry structures whereby operations that can be shared between multiple transformations will result in
shared MatrixEntry nodes in the graph.
When a MatrixStack is first created it references one 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 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 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.
<note>MatrixEntry<!-- -->s are reference counted using
@ref and unref not with
- public Bool calculate_translation (MatrixEntry entry1, out float x, out float y, out float z)
Determines if the only difference between two transforms is a
translation and if so returns what the
z components of the translation are.
- public Bool equal (MatrixEntry entry1)
Compares two arbitrary MatrixEntry
transforms for equality returning true if they are equal or
- public Matrix? @get (out Matrix matrix)
Resolves the current this transform
into a Matrix by combining the sequence of operations that have been applied to build up
the current transform.
- public Bool is_identity ()
Determines whether this is known to
represent an identity transform.
- public MatrixEntry @ref ()
Takes a reference on the given this
to ensure the this stays alive and remains valid.
- public void unref ()
Releases a reference on this either
taken by calling unref or to release the reference given when calling