Transform
Transform
Class representing a Transform. A Transform holds all the spacial information about an object (ex. position, rotating, size, etc.).
For performance reasons the transform also stores a list of corners to be able to quickly apply intersection testing.
Constructor
public Transform
Properties
No publicly accessible properties on Transform
private angle: number
Description needed
private dirty: false | true
Description needed
private dirtySize: false | true
Description needed
private dirtyCorners: false | true
Description needed
private radius: number
Description needed
Methods
public calcRotationAbout
calcRotationAbout(a, c) => Vector<Vector, number>
Calculates the new position and angle after transforming this by 'a' radians about the axis 'c'.
Parameters
a: number
– The angle to rotate.c: Vector
– The axis to rotate about.
Returns
public toLocalSpace
toLocalSpace(v) => Vector
Converts the given Vector, v, to local space relative to this transform.
Parameters
-
v: Vector
– The vector to transform, must be in world coordinates.
Returns
-
Vector
– The local space vector.
public toWorldSpace
toWorldSpace(v) => Vector
Converts the given Vector, v, to world space relative to this transform.
Parameters
-
v: Vector
– The vector to transform, must be in local coordinates.
Returns
-
Vector
– The world space vector.
public getInverseMatrix
getInverseMatrix() => Matrix2x3
Description needed
Returns
-
Matrix2x3
– Description needed
public getBottomRight
getBottomRight() => Vector
Description needed
Returns
-
Vector
– Description needed
public getLocalCorners
getLocalCorners() => Vector[]
Description needed
Returns
-
Vector[]
– Description needed
Static Methods
public FromCorners
FromCorners(p1, p2) => Transform
Description needed
Parameters
Returns
-
Transform
– Description needed