Class sandy.core.transform.Transform3D

Implemented Interfaces

ITransform3D

Description

Transform3D This class helps you to create some transformations to apply to a transformGroup. This way you will be able to transform a whole group of objects, to create the effect you want.

Field Index

onUpdateEVENT

Method Index

new Transform3D()
combineMatrix(), combineTransform(), destroy(), eulerRotation(), getMatrix(), getType(), isModified(), rot(), rotAxis(), rotAxisWithReference(), rotVector(), rotX(), rotY(), rotZ(), scale(), scaleVector(), scaleX(), scaleY(), scaleZ(), setModified(), translate(), translateVector(), translateX(), translateY(), translateZ()

Constructor Detail

Transform3D

public function Transform3D(Void)

Create a new Transform3D instance. An identity matrix is created by default, and the transform type is NONE.

Field Detail

onUpdateEVENT

static public onUpdateEVENT:EventType
The onUpdate Event. It's the event broadcast when the transform changes

Method Detail

rotX

public function rotX(pAngle:Number):Void

Set the matrix rotation around the X axis.

Parameters

pAngleNumber The angle of rotation in degree.

rotY

public function rotY(pAngle:Number):Void

Set the matrix rotation around the Y axis.

Parameters

pAngleNumber The angle of rotation in degree.

rotZ

public function rotZ(pAngle:Number):Void

Set the matrix rotation around the Z axis.

Parameters

pAngleNumber The angle of rotation in degree.

rot

public function rot(px:Number, py:Number, pz:Number):Void

Realize the euler rotation matrix thanks to the three angles in arguments as a degree angle.

Parameters

pxNumber Angle of rotation in degree around the X axis
pyNumber Angle of rotation in degree around the Y axis
pzNumber Angle of rotation in degree around the Z axis

eulerRotation

public function eulerRotation(eulerMatrix:Matrix4):Void

Set the rotation based on a euler rotation matrix. Useful for restoring the rotation based on the Matrix4 value retrieved by getMatrix();

Parameters

eulerMatrixMatrix4 - existing matrix containing rotation matrix to restore.

rotVector

public function rotVector(v:Vector):Void

Realize the euler rotation matrix thanks to angles defined in the vector argument

Parameters

vVector The vector containing the eulers angles

rotAxis

public function rotAxis(pAxis:Vector, pAngle:Number):Void

Realize a rotation around a specific axis (the axis will be normalized) and from an pangle degrees.

Parameters

pAxisA 3D Vector representing the axis of rtation. This axis will be normalized inside the method.
pAngleNumber The angle of rotation in degrees.

rotAxisWithReference

public function rotAxisWithReference(axis:Vector, ref:Vector, pAngle:Number):Void

Realize a rotation around a specific axis (the axis must be normalized!) and from an pangle degrees and around a specific position.

Parameters

refVector The center of rotation as a 3D point.
pAngleNumber The angle of rotation in degrees.

scaleX

public function scaleX(pVal:Number):Void

Realize a scale on the X axis

Parameters

pValNumber the value of scale.

scaleY

public function scaleY(pVal:Number):Void

Realize a scale on the Y axis

Parameters

pValNumber the value of scale.

scaleZ

public function scaleZ(pVal:Number):Void

Realize a scale on the Z axis

Parameters

pValNumber the value of scale.

scale

public function scale(px:Number, py:Number, pz:Number):Void

Realize a scale on all the directions.

Parameters

pxNumber the scale on the X direction
pyNumber the scale on the Y direction
pzNumber the scale on the Z direction

scaleVector

public function scaleVector(v:Vector):Void

Realize a scale on all the 3 dimensions thnaks to the 3 properties of the Vector object.

Parameters

vVector Vector containing the scale values in the 3 axis directions.

translateX

public function translateX(val:Number):Void

Realize a translation on the X direction

Parameters

valNumber the amount of translation

translateY

public function translateY(val:Number):Void

Realize a translation on the Y direction

Parameters

valNumber the amount of translation

translateZ

public function translateZ(val:Number):Void

Realize a translation on the Z direction

Parameters

valNumber the amount of translation

translate

public function translate(tx:Number, ty:Number, tz:Number):Void

Realize a translation on all the 3 directions

Parameters

txNumber the amount of translation in x axis
tyNumber the amount of translation in y axis
tzNumber the amount of translation in z axis

translateVector

public function translateVector(v:Vector):Void

Realize the translation on all the 3 directions thanks to the Vector object.

Parameters

vVector Vector containing the translation values in all the 3 directions

getType

public function getType(Void):TransformType

Get the type of transformation you have.

Return

TransformType The type of transformation.

Specified By

getType() in sandy.core.transform.ITransform3D

getMatrix

public function getMatrix(Void):Matrix4

Get the equilavent matrix representing the transformation.

Return

Matrix4 the matrix representing the transformation in 3D space.

Specified By

getMatrix() in sandy.core.transform.ITransform3D

combineMatrix

public function combineMatrix(m:Matrix4):Void

This method allows you to have a single transform3D to combine several transformations. By combining some transformations, you can expect some speed improvment since the matrix multiplication will be computed only once. BE CAREFULL, this feature can be very hard to use correctly, so you have to completely understand what you are doing. you must also take under consideration that it is the first matrix which is multiplied by the one in argument.

Parameters

mMatrix4 The matrix you want to combine with the current transformation one.

combineTransform

public function combineTransform(t:Transform3D):Void

This method allows you to have a single transform3D to combine several transformations. By combining some transformations, you can expect some speed improvment since the matrix multiplication will be computed only once. BE CAREFULL, this feature can be very hard to use correctly, so you have to completely understand what you are doing. you must also take under consideration that it is the first matrix which is multiplied by the one in argument.

Parameters

isModified

public function isModified(Void):Boolean

Allows you to know if the transformation has been modified.

Parameters

Void

Return

Boolean True if the transformation has been modified, false otherwise.

Specified By

isModified() in sandy.core.transform.ITransform3D

setModified

public function setModified(b:Boolean):Void

Set the transformation as modified or not. Very usefull for the cache transformation system. WARNING: Do not call this method yourself except if you know exactly what you are doing.

Parameters

bBoolean True value means the transformation has been modified, and false the opposite.

Specified By

setModified() in sandy.core.transform.ITransform3D

destroy

public function destroy(Void):Void

Destroy the node by removing all the listeners and deleting the matrix instance.

Parameters

Void

Specified By

destroy() in sandy.core.transform.ITransform3D