public class GlobalTransform
extends java.lang.Object
Transform but it's immutable while it represents the final evaluated transformation.
Right-hand coordinate system is used while evaluating global transform
Example:
The following code shows how to read node's global transform
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));
var global = boxNode.getGlobalTransform();
System.out.print("The box's position in world coordinate is %s", global.getTranslation());
| Modifier and Type | Method and Description |
|---|---|
Vector3 |
getEulerAngles()
Gets the rotation represented in Euler angles, measured in degree
|
Quaternion |
getRotation()
Gets the rotation represented in quaternion.
|
Vector3 |
getScale()
Gets the scale
|
Matrix4 |
getTransformMatrix()
Gets the transform matrix.
|
Vector3 |
getTranslation()
Gets the translation
|
public Vector3 getTranslation()
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("Translation = %s", tr.getTranslation());
public Vector3 getScale()
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("Scale = %s", tr.getScale());
public Vector3 getEulerAngles()
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("EulerAngles = %s", tr.getEulerAngles());
public Quaternion getRotation()
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("Rotation = %s", tr.getRotation());
public Matrix4 getTransformMatrix()
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("Matrix = %s", tr.getTransformMatrix());