Transform [constructor] 

The transform class is responsible for calculating the transform of a particular node from the data on the node and its parent

new Transform(parent)

Parameters:

NameTypeDescription
parentTransform

the parent Transform

Instance methods

.reset()

resets the transform state such that it no longer has a parent and is not a breakpoint.

.setParent(parent)

sets the parent of this transform.

Parameters:

NameTypeDescription
parentTransform

The transform class that parents this class

.getParent()

returns the parent of this transform

.setBreakPoint()

Makes this transform a breakpoint. This will cause it to calculate both a local (relative to the nearest ancestor breakpoint) and a world matrix (relative to the scene).

.setCalculateWorldMatrix()

Set this node to calculate the world matrix.

.isBreakPoint()

returns whether or not this transform is a breakpoint.

.getLocalTransform()

returns the local transform

.getWorldTransform()

returns the world transform. Requires that this transform is a breakpoint.

.calculate(node)

Takes a node and calculates the proper transform from it.

Parameters:

NameTypeDescription
nodeNode

the node to calculate the transform from

.getPosition()

Gets the position component of the transform

.setPosition(x, y, z)

Sets the position component of the transform.

Parameters:

NameTypeDescription
xNumber

The x dimension of the position

yNumber

The y dimension of the position

zNumber

The z dimension of the position

.getRotation()

Gets the rotation component of the transform. Will return a quaternion.

.setRotation(x, y, z, w)

Sets the rotation component of the transform. Can take either Euler angles or a quaternion.

Parameters:

NameTypeDescription
xNumber

The rotation about the x axis or the extent in the x dimension

yNumber

The rotation about the y axis or the extent in the y dimension

zNumber

The rotation about the z axis or the extent in the z dimension

wNumber

The rotation about the proceeding vector

.getScale()

Gets the scale component of the transform

.setScale(x, y, z)

Sets the scale component of the transform.

Parameters:

NameTypeDescription
xNumber

The x dimension of the scale

yNumber

The y dimension of the scale

zNumber

The z dimension of the scale

.getAlign()

Gets the align value of the transform

.setAlign(x, y, z)

Sets the align value of the transform.

Parameters:

NameTypeDescription
xNumber

The x dimension of the align

yNumber

The y dimension of the align

zNumber

The z dimension of the align

.getMountPoint()

Gets the mount point value of the transform.

.setMountPoint(x, y, z)

Sets the mount point value of the transform.

Parameters:

NameTypeDescription
xNumber

the x dimension of the mount point

yNumber

the y dimension of the mount point

zNumber

the z dimension of the mount point

.getOrigin()

Gets the origin of the transform.

.setOrigin(x, y, z)

Sets the origin of the transform.

Parameters:

NameTypeDescription
xNumber

the x dimension of the origin

yNumber

the y dimension of the origin

zNumber

the z dimension of the origin

.calculateWorldMatrix()

Calculates the world for this particular transform.