Detailed Description

Represents a transformation applied to the vertices of an element on the UI. It generates a matrix when applied. This matrix is then applied to any existing matrix (the current top of a stack) and the result is pushed to the same stack. The matrix at the top of the stack is the one which is actually applied to elements.

Public Member Functions

 Transformation ()
 
 Transformation (Matrix4x4 matrix)
 
void RecalculateMatrix (ComputedStyle style, LayoutBox box)
 Recalculates the matrices if this transformation has changed. More...
 
void SetOriginOffset (Value value)
 The position of the origin relative to the top left corner of the element. More...
 
Vector3 Apply (Vector4 point)
 Applies this transformation to the given vertex. More...
 
Vector3 ApplyInverse (Vector4 point)
 Applies this transformation to the given vertex. More...
 

Public Attributes

Transformation Parent
 The parent transform, if any. More...
 

Properties

Matrix4x4 Matrix [get]
 Read only version of the fully resolved matrix - parent one included. More...
 
Matrix4x4 LocalMatrix [get]
 Read only version of the matrix that represents this transformation. More...
 
bool Changed [get]
 True if any property of this transformation changed. More...
 
int OriginPosition [get, set]
 The PositionMode of the origin. May be fixed (i.e. in exact screen pixels) or relative to the element that this transformation is on. More...
 
Vector3 Scale [get, set]
 A scale transformation to apply (post process). More...
 
Vector3 Translate [get, set]
 A translate transformation to apply (post process). More...
 
Quaternion Rotation [get, set]
 A rotation to apply (post process). More...
 
Matrix4x4 Skew [get, set]
 A skew to apply (post process). More...
 
Matrix4x4 RawMatrix [get, set]
 A raw matrix to apply (originates from transform: CSS). Post process. More...
 

Private Member Functions

Vector3 CalculateOrigin (ComputedStyle relativeTo, LayoutBox box)
 Calculates where the transformation origin should go in screen space. More...
 

Private Attributes

bool HasRawMatrix
 Has this transformation got an active raw matrix? More...
 
bool _Changed
 True if any component of this transformation changed. More...
 
Matrix4x4 _RawMatrix =Matrix4x4.identity
 A raw matrix to apply. More...
 
Vector3 _Origin
 The location of the transform origin. More...
 
Matrix4x4 _Matrix
 The fully resolved matrix (i.e. the parent matrix and my local one). More...
 
Vector3 _Translate
 A translation to apply in world units. More...
 
Quaternion _Rotation =Quaternion.identity
 Rotation to apply. More...
 
Value _OriginOffset =null
 The location of the origin relative to the top corner of the element this transformation is on. More...
 
Matrix4x4 _LocalMatrix
 The matrix that represents only this transformation. More...
 
Vector3 _Scale =Vector3.one
 Scale to apply. More...
 
int _OriginPosition =PositionMode.Relative
 The location of the origin. May be relative (to this element) or fixed (fixed place on the screen). More...
 

Constructor & Destructor Documentation

Css.Transformation.Transformation ( )
inline
Css.Transformation.Transformation ( Matrix4x4  matrix)
inline

Member Function Documentation

Vector3 Css.Transformation.Apply ( Vector4  point)
inline

Applies this transformation to the given vertex.

Parameters
pointThe vertex to transform.
Returns
The transformed vertex.
Vector3 Css.Transformation.ApplyInverse ( Vector4  point)
inline

Applies this transformation to the given vertex.

Parameters
pointThe vertex to transform.
Returns
The transformed vertex.
Vector3 Css.Transformation.CalculateOrigin ( ComputedStyle  relativeTo,
LayoutBox  box 
)
inlineprivate

Calculates where the transformation origin should go in screen space.

Parameters
relativeToThe computed style of the element that the origin will be relative to if the origin position is 'Relative'
void Css.Transformation.RecalculateMatrix ( ComputedStyle  style,
LayoutBox  box 
)
inline

Recalculates the matrices if this transformation has changed.

void Css.Transformation.SetOriginOffset ( Value  value)
inline

The position of the origin relative to the top left corner of the element.

Member Data Documentation

bool Css.Transformation._Changed
private

True if any component of this transformation changed.

Matrix4x4 Css.Transformation._LocalMatrix
private

The matrix that represents only this transformation.

Matrix4x4 Css.Transformation._Matrix
private

The fully resolved matrix (i.e. the parent matrix and my local one).

Vector3 Css.Transformation._Origin
private

The location of the transform origin.

Value Css.Transformation._OriginOffset =null
private

The location of the origin relative to the top corner of the element this transformation is on.

int Css.Transformation._OriginPosition =PositionMode.Relative
private

The location of the origin. May be relative (to this element) or fixed (fixed place on the screen).

Matrix4x4 Css.Transformation._RawMatrix =Matrix4x4.identity
private

A raw matrix to apply.

Quaternion Css.Transformation._Rotation =Quaternion.identity
private

Rotation to apply.

Vector3 Css.Transformation._Scale =Vector3.one
private

Scale to apply.

Vector3 Css.Transformation._Translate
private

A translation to apply in world units.

bool Css.Transformation.HasRawMatrix
private

Has this transformation got an active raw matrix?

Transformation Css.Transformation.Parent

The parent transform, if any.

Property Documentation

bool Css.Transformation.Changed
get

True if any property of this transformation changed.

Matrix4x4 Css.Transformation.LocalMatrix
get

Read only version of the matrix that represents this transformation.

Matrix4x4 Css.Transformation.Matrix
get

Read only version of the fully resolved matrix - parent one included.

int Css.Transformation.OriginPosition
getset

The PositionMode of the origin. May be fixed (i.e. in exact screen pixels) or relative to the element that this transformation is on.

Matrix4x4 Css.Transformation.RawMatrix
getset

A raw matrix to apply (originates from transform: CSS). Post process.

Quaternion Css.Transformation.Rotation
getset

A rotation to apply (post process).

Vector3 Css.Transformation.Scale
getset

A scale transformation to apply (post process).

Matrix4x4 Css.Transformation.Skew
getset

A skew to apply (post process).

Vector3 Css.Transformation.Translate
getset

A translate transformation to apply (post process).