GlobalTransform
Inheritance: java.lang.Object
public class GlobalTransform
Global transform is similar to 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());
Methods
Method | Description |
---|---|
equals(Object arg0) | |
getClass() | |
getEulerAngles() | Gets the rotation represented in Euler angles, measured in degree Example: |
getRotation() | Gets the rotation represented in quaternion. |
getScale() | Gets the scale Example: |
getTransformMatrix() | Gets the transform matrix. |
getTranslation() | Gets the translation Example: |
hashCode() | |
notify() | |
notifyAll() | |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getEulerAngles()
public Vector3 getEulerAngles()
Gets the rotation represented in Euler angles, measured in degree Example:
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("EulerAngles = %s", tr.getEulerAngles());
Returns: Vector3
getRotation()
public Quaternion getRotation()
Gets the rotation represented in quaternion. Example:
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("Rotation = %s", tr.getRotation());
Returns: Quaternion
getScale()
public Vector3 getScale()
Gets the scale Example:
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("Scale = %s", tr.getScale());
Returns: Vector3
getTransformMatrix()
public Matrix4 getTransformMatrix()
Gets the transform matrix. Example:
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("Matrix = %s", tr.getTransformMatrix());
Returns: Matrix4
getTranslation()
public Vector3 getTranslation()
Gets the translation Example:
Scene scene = Scene.fromFile("test.fbx");
var tr = scene.getRootNode().getGlobalTransform();
System.out.printf("Translation = %s", tr.getTranslation());
Returns: Vector3
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |