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

void RecalculateMatrix (ComputedStyle style)
 Recalculates the matrices if this transformation has changed. 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...
 
PositionType OriginPosition [get, set]
 The position of the origin. May be fixed (i.e. in exact screen pixels) or relative to the element that this transformation is on. More...
 
Css.Value OriginOffset [set]
 The position of the origin relative to the top left corner of the element. 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...
 

Private Member Functions

void CalculateOrigin (ComputedStyle relativeTo)
 Calculates where the transformation origin should go in screen space. More...
 

Private Attributes

bool HasSkew
 Has this transformation got an active skew? More...
 
bool _Changed
 True if any component of this transformation changed. More...
 
Matrix4x4 _Skew =Matrix4x4.identity
 A skew 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...
 
Vector3 _OriginOffset
 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...
 
PositionType _OriginPosition =PositionType.Relative
 The location of the origin. May be relative (to this element) or fixed (fixed place on the screen). More...
 
bool _OriginOffsetPercX
 
bool _OriginOffsetPercY
 

Member Function Documentation

Vector3 PowerUI.Transformation.Apply ( Vector4  point)
inline

Applies this transformation to the given vertex.

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

Applies this transformation to the given vertex.

Parameters
pointThe vertex to transform.
Returns
The transformed vertex.
void PowerUI.Transformation.CalculateOrigin ( ComputedStyle  relativeTo)
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 PowerUI.Transformation.RecalculateMatrix ( ComputedStyle  style)
inline

Recalculates the matrices if this transformation has changed.

Member Data Documentation

bool PowerUI.Transformation._Changed
private

True if any component of this transformation changed.

Matrix4x4 PowerUI.Transformation._LocalMatrix
private

The matrix that represents only this transformation.

Matrix4x4 PowerUI.Transformation._Matrix
private

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

Vector3 PowerUI.Transformation._Origin
private

The location of the transform origin.

Vector3 PowerUI.Transformation._OriginOffset
private

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

bool PowerUI.Transformation._OriginOffsetPercX
private
bool PowerUI.Transformation._OriginOffsetPercY
private
PositionType PowerUI.Transformation._OriginPosition =PositionType.Relative
private

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

Quaternion PowerUI.Transformation._Rotation =Quaternion.identity
private

Rotation to apply.

Vector3 PowerUI.Transformation._Scale =Vector3.one
private

Scale to apply.

Matrix4x4 PowerUI.Transformation._Skew =Matrix4x4.identity
private

A skew to apply.

Vector3 PowerUI.Transformation._Translate
private

A translation to apply in world units.

bool PowerUI.Transformation.HasSkew
private

Has this transformation got an active skew?

Transformation PowerUI.Transformation.Parent

The parent transform, if any.

Property Documentation

bool PowerUI.Transformation.Changed
get

True if any property of this transformation changed.

Matrix4x4 PowerUI.Transformation.LocalMatrix
get

Read only version of the matrix that represents this transformation.

Matrix4x4 PowerUI.Transformation.Matrix
get

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

Css.Value PowerUI.Transformation.OriginOffset
set

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

PositionType PowerUI.Transformation.OriginPosition
getset

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

Quaternion PowerUI.Transformation.Rotation
getset

A rotation to apply (post process).

Vector3 PowerUI.Transformation.Scale
getset

A scale transformation to apply (post process).

Matrix4x4 PowerUI.Transformation.Skew
getset

A skew to apply (post process).

Vector3 PowerUI.Transformation.Translate
getset

A translate transformation to apply (post process).