ITransform3D 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.
new Transform3D()static public onUpdateEVENT:EventTypepublic function rotX(pAngle:Number):VoidSet the matrix rotation around the X axis.
pAngle | Number The angle of rotation in degree. |
public function rotY(pAngle:Number):VoidSet the matrix rotation around the Y axis.
pAngle | Number The angle of rotation in degree. |
public function rotZ(pAngle:Number):VoidSet the matrix rotation around the Z axis.
pAngle | Number The angle of rotation in degree. |
public function rot(px:Number, py:Number, pz:Number):VoidRealize the euler rotation matrix thanks to the three angles in arguments as a degree angle.
px | Number Angle of rotation in degree around the X axis |
py | Number Angle of rotation in degree around the Y axis |
pz | Number Angle of rotation in degree around the Z axis |
public function eulerRotation(eulerMatrix:Matrix4):VoidSet the rotation based on a euler rotation matrix. Useful for restoring the rotation based on the Matrix4 value retrieved by getMatrix();
eulerMatrix | Matrix4 - existing matrix containing rotation matrix to restore. |
public function rotVector(v:Vector):VoidRealize the euler rotation matrix thanks to angles defined in the vector argument
v | Vector The vector containing the eulers angles |
public function rotAxis(pAxis:Vector, pAngle:Number):VoidRealize a rotation around a specific axis (the axis will be normalized) and from an pangle degrees.
pAxis | A 3D Vector representing the axis of rtation. This axis will be normalized inside the method. |
pAngle | Number The angle of rotation in degrees. |
public function rotAxisWithReference(axis:Vector, ref:Vector, pAngle:Number):VoidRealize a rotation around a specific axis (the axis must be normalized!) and from an pangle degrees and around a specific position.
ref | Vector The center of rotation as a 3D point. |
pAngle | Number The angle of rotation in degrees. |
public function scaleX(pVal:Number):VoidRealize a scale on the X axis
pVal | Number the value of scale. |
public function scaleY(pVal:Number):VoidRealize a scale on the Y axis
pVal | Number the value of scale. |
public function scaleZ(pVal:Number):VoidRealize a scale on the Z axis
pVal | Number the value of scale. |
public function scale(px:Number, py:Number, pz:Number):VoidRealize a scale on all the directions.
px | Number the scale on the X direction |
py | Number the scale on the Y direction |
pz | Number the scale on the Z direction |
public function scaleVector(v:Vector):VoidRealize a scale on all the 3 dimensions thnaks to the 3 properties of the Vector object.
v | Vector Vector containing the scale values in the 3 axis directions. |
public function translateX(val:Number):VoidRealize a translation on the X direction
val | Number the amount of translation |
public function translateY(val:Number):VoidRealize a translation on the Y direction
val | Number the amount of translation |
public function translateZ(val:Number):VoidRealize a translation on the Z direction
val | Number the amount of translation |
public function translate(tx:Number, ty:Number, tz:Number):VoidRealize a translation on all the 3 directions
tx | Number the amount of translation in x axis |
ty | Number the amount of translation in y axis |
tz | Number the amount of translation in z axis |
public function translateVector(v:Vector):VoidRealize the translation on all the 3 directions thanks to the Vector object.
v | Vector Vector containing the translation values in all the 3 directions |
public function getType(Void):TransformTypeGet the type of transformation you have.
TransformType The type of transformation.
public function getMatrix(Void):Matrix4Get the equilavent matrix representing the transformation.
Matrix4 the matrix representing the transformation in 3D space.
public function combineMatrix(m:Matrix4):VoidThis 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.
m | Matrix4 The matrix you want to combine with the current transformation one. |
public function combineTransform(t:Transform3D):VoidThis 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.
public function isModified(Void):BooleanAllows you to know if the transformation has been modified.
Void |
Boolean True if the transformation has been modified, false otherwise.
public function setModified(b:Boolean):VoidSet 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.
b | Boolean True value means the transformation has been modified, and false the opposite. |