public class Transform extends A3DObject
Scene scene = new Scene();
var boxNode = scene.getRootNode().createChildNode(new Box());
//place the box at (10, 0, 0)
boxNode.getTransform().setTranslation(new Vector3(10, 0, 0));
name, properties| Modifier and Type | Method and Description |
|---|---|
Vector3 |
getEulerAngles()
Gets the rotation represented in Euler angles, measured in degree
|
Vector3 |
getGeometricRotation()
Gets the geometric Euler rotation(measured in degree).
|
Vector3 |
getGeometricScaling()
Gets the geometric scaling.
|
Vector3 |
getGeometricTranslation()
Gets the geometric translation.
|
Vector3 |
getPostRotation()
Gets the post-rotation represented in degree
|
Vector3 |
getPreRotation()
Gets the pre-rotation represented in degree
|
Quaternion |
getRotation()
Gets the rotation represented in quaternion.
|
Vector3 |
getRotationOffset()
Gets the rotation offset
|
Vector3 |
getRotationPivot()
Gets the rotation pivot
|
Vector3 |
getScaling()
Gets the scaling
|
Vector3 |
getScalingOffset()
Gets the scaling offset
|
Vector3 |
getScalingPivot()
Gets the scaling pivot
|
Matrix4 |
getTransformMatrix()
Gets the transform matrix.
|
Vector3 |
getTranslation()
Gets the translation
|
Transform |
setEulerAngles(double rx,
double ry,
double rz)
Sets the Euler angles in degrees of current transform.
|
void |
setEulerAngles(Vector3 value)
Sets the rotation represented in Euler angles, measured in degree
|
Transform |
setGeometricRotation(double rx,
double ry,
double rz)
Sets the geometric Euler rotation(measured in degree).
|
void |
setGeometricRotation(Vector3 value)
Sets the geometric Euler rotation(measured in degree).
|
Transform |
setGeometricScaling(double sx,
double sy,
double sz)
Sets the geometric scaling.
|
void |
setGeometricScaling(Vector3 value)
Sets the geometric scaling.
|
Transform |
setGeometricTranslation(double x,
double y,
double z)
Sets the geometric translation.
|
void |
setGeometricTranslation(Vector3 value)
Sets the geometric translation.
|
Transform |
setPostRotation(double rx,
double ry,
double rz)
Sets the post-rotation represented in degree
Example:
|
void |
setPostRotation(Vector3 value)
Sets the post-rotation represented in degree
|
Transform |
setPreRotation(double rx,
double ry,
double rz)
Sets the pre-rotation represented in degree
Example:
|
void |
setPreRotation(Vector3 value)
Sets the pre-rotation represented in degree
|
Transform |
setRotation(double rw,
double rx,
double ry,
double rz)
Sets the rotation(as quaternion components) of current transform.
|
void |
setRotation(Quaternion value)
Sets the rotation represented in quaternion.
|
void |
setRotationOffset(Vector3 value)
Sets the rotation offset
|
void |
setRotationPivot(Vector3 value)
Sets the rotation pivot
|
Transform |
setScale(double sx,
double sy,
double sz)
Sets the scale of current transform.
|
void |
setScaling(Vector3 value)
Sets the scaling
|
void |
setScalingOffset(Vector3 value)
Sets the scaling offset
|
void |
setScalingPivot(Vector3 value)
Sets the scaling pivot
|
void |
setTransformMatrix(Matrix4 value)
Sets the transform matrix.
|
Transform |
setTranslation(double tx,
double ty,
double tz)
Sets the translation of current transform.
|
void |
setTranslation(Vector3 value)
Sets the translation
|
findProperty, getName, getProperties, getProperty, removeProperty, removeProperty, setName, setPropertypublic Vector3 getGeometricTranslation()
Node node = new Node();
node.getTransform().setGeometricTranslation(new Vector3(10, 0, 0));
public void setGeometricTranslation(Vector3 value)
value - New value
Example:
Node node = new Node();
node.getTransform().setGeometricTranslation(new Vector3(10, 0, 0));
public Vector3 getGeometricScaling()
Node node = new Node();
node.getTransform.setGeometricScaling(new Vector3(2, 2, 2));
public void setGeometricScaling(Vector3 value)
value - New value
Example:
Node node = new Node();
node.getTransform.setGeometricScaling(new Vector3(2, 2, 2));
public Vector3 getGeometricRotation()
public void setGeometricRotation(Vector3 value)
value - New valuepublic Transform setGeometricTranslation(double x, double y, double z)
Node node = new Node();
node.getTransform().setGeometricTranslation(10, 0, 0);
public Transform setGeometricScaling(double sx, double sy, double sz)
Node node = new Node();
node.getTransform().setGeometricScaling(2, 2, 2);
public Transform setGeometricRotation(double rx, double ry, double rz)
Node node = new Node();
node.getTransform().setGeometricRotation(90, 0, 0);
public Vector3 getTranslation()
Node node = new Node();
node.getTransform().setTranslation(new Vector3(10, 0, 0));
public void setTranslation(Vector3 value)
value - New value
Example:
Node node = new Node();
node.getTransform().setTranslation(new Vector3(10, 0, 0));
public Transform setTranslation(double tx, double ty, double tz)
Node node = new Node();
node.getTransform().setTranslation(10, 0, 0);
public Transform setScale(double sx, double sy, double sz)
Node node = new Node();
node.getTransform().setScale(2, 2, 2);
public Transform setEulerAngles(double rx, double ry, double rz)
Node node = new Node();
node.getTransform().setEulerAngles(90, 0, 0);
public Transform setRotation(double rw, double rx, double ry, double rz)
Node node = new Node();
node.getTransform().setRotation(1, 0, 0, 0);
public Transform setPreRotation(double rx, double ry, double rz)
Node node = new Node();
node.getTransform().setPreRotation(90, 0, 0);
public Transform setPostRotation(double rx, double ry, double rz)
Node node = new Node();
node.getTransform().setPostRotation(90, 0, 0);
public Vector3 getScaling()
Node node = new Node();
node.getTransform().setScaling(new Vector3(2, 2, 2));
public void setScaling(Vector3 value)
value - New value
Example:
Node node = new Node();
node.getTransform().setScaling(new Vector3(2, 2, 2));
public Vector3 getScalingOffset()
public void setScalingOffset(Vector3 value)
value - New valuepublic Vector3 getScalingPivot()
public void setScalingPivot(Vector3 value)
value - New valuepublic Vector3 getPreRotation()
Node node = new Node();
node.getTransform().setPreRotation(new Vector3(90, 0, 0));
public void setPreRotation(Vector3 value)
value - New value
Example:
Node node = new Node();
node.getTransform().setPreRotation(new Vector3(90, 0, 0));
public Vector3 getRotationOffset()
public void setRotationOffset(Vector3 value)
value - New valuepublic Vector3 getRotationPivot()
public void setRotationPivot(Vector3 value)
value - New valuepublic Vector3 getPostRotation()
Node node = new Node();
node.getTransform().setPostRotation(new Vector3(90, 0, 0));
public void setPostRotation(Vector3 value)
value - New value
Example:
Node node = new Node();
node.getTransform().setPostRotation(new Vector3(90, 0, 0));
public Vector3 getEulerAngles()
Node node = new Node();
node.getTransform().setEulerAngles(new Vector3(90, 0, 0));
public void setEulerAngles(Vector3 value)
value - New value
Example:
Node node = new Node();
node.getTransform().setEulerAngles(new Vector3(90, 0, 0));
public Quaternion getRotation()
Node node = new Node();
node.getTransform().setRotation(new Quaternion(1, 0, 0, 0));
public void setRotation(Quaternion value)
value - New value
Example:
Node node = new Node();
node.getTransform().setRotation(new Quaternion(1, 0, 0, 0));
public Matrix4 getTransformMatrix()
getTranslation(), getScaling() and getRotation(), the getGeometricRotation(), getGeometricScaling() and getGeometricTranslation() will not be affected.
Example:
Node node = new Node();
node.getTransform().setTransformMatrix(Matrix4.getIdentity());
public void setTransformMatrix(Matrix4 value)
value - New value
Remarks:
Assign on this will reset the getTranslation(), getScaling() and getRotation(), the getGeometricRotation(), getGeometricScaling() and getGeometricTranslation() will not be affected.
Example:
Node node = new Node();
node.getTransform().setTransformMatrix(Matrix4.getIdentity());