Skip to main content

Transform

class Transform

All objects in a scene have a transform, which is used to store and manipulate the object's position, rotation, and scale.


public class Transform

— Constructors (1) —

ConstructorDescription
Transform()Creates a new Transform.

— Methods (72) —

NameDescription
Vector3 getPosition()Returns a new Vector with the Transform position.
Vector3 getGlobalPosition()Returns a new Vector with the global position of the transform.
Vector3 getGlobalPosition(Vector3 out)Applies global position to the Vector to be "out" argument.
Quaternion getRotation()Returns a new Quaternion with the Transform rotation.
Quaternion getGlobalRotation()Returns a new Quaternion with the global rotation of the Transform.
Quaternion getGlobalRotation(Quaternion out)Applies global rotation to the Quaternion to be "out" argument.
Vector3 getScale()Returns a new Vector with the scale of the Transform.
Vector3 getGlobalScale()Returns a new Vector with the global scale of the Transform.
Vector3 getGlobalScale(Vector3 out)Applies global scaling to the Vector to be "out" argument.
void setPosition(Vector3 vector)Set the Transform's position to be "vector" argument Vector3.
void setPosition(float x, float y, float z)Set the Transform position respectively X, Y and Z.
void setPositionX(float v)Sets the current X position of the Transform to be "v" argument.
void setPositionY(float v)Sets the current Y position of the Transform to be "v" argument.
void setPositionZ(float v)Sets the current Z position of the Transform to be "v" argument.
void setRotation(Quaternion quaternion)Set the rotation of the Transform by the Quaternion to be "quaternion" argument.
void setRotation(float w, float x, float y, float z)Set the rotation of the Transform respectively, W, X, Y and Z.
void setScale(Vector3 vector)Set the Transform's scale to be "vector" argument Vector3.
void setScale(float x, float y, float z)Set the scale of the Transform respectively X, Y and Z.
void setScale(float all)Defines the scale of the three axes, X, Y and Z of the Transform to be "all" argument.
void translate(float x, float y, float z)Moves the Transform along the respectively X, Y and Z axes to those passed to be "x", "y" and "z" argument.
void move(float x, float y, float z)Moves the Transform on the respective axes, X, Y and Z.
void rotate(float x, float y, float z)Rotates the Transform to be respective X, Y and Z axes.
void translateInSeconds(float x, float y, float z)Moves the Transform along the respectively X, Y and Z axes to the ones passed to be argument "x", "y" and "z" multiplied by "Math.bySecond(1)".
void translateInSeconds(int x, int y, int z)Moves the Transform along the respectively X, Y and Z axes to the ones passed to be argument "x", "y" and "z" multiplied by "Math.bySecond(1)".
void moveInSeconds(float x, float y, float z)Moves the Transform to be respective X, Y and Z axes multiplied by "Math.bySecond(1)".
void moveInSeconds(int x, int y, int z)Moves the Transform to be respective X, Y and Z axes multiplied by "Math.bySecond(1)".
void rotateInSeconds(float x, float y, float z)Rotates the Transform to be X, Y and Z axes multiplied by "Math.bySecond(1)".
void rotateInSeconds(int x, int y, int z)Rotates the Transform to be X, Y and Z axes multiplied by "Math.bySecond(1)".
void lerpLookTo([SpatialOject] other, float lerpSped)Points Transform to the position of the SpatialObject defined to be argument based on a velocity.
void lerpLookTo(Vector3 position, float lerpSpeed)Points Transform to the Vector3 position defined to be argument based on a velocity.
void lookTo(SpatialObject object)Points the Transform to the position of the SpatialObject defined to be "object" argument.
void lookTo(Vector3 position)Points the Transform to the position of the Vector defined to be "position" argument.
void lookTo(float x, float y, float z)Points the Transform to the positions respectively X, Y and Z passed to be argument.
void lookToIgnoreY(SpatialObject object)Points the Transform to the position of the SpatialObject ignoring the Y axis defined to be "object" argument.
void lookToIgnoreY(Vector3 position)Points the Transform to the Vector position ignoring the Y axis defined to be "position" argument.
void lerpLookToIgnoreY(SpatialObject other, float lerpSpeed)Points Transform to the position of the SpatialObject defined to be argument ignoring the Y-axis based on a velocity.
void lerpLookToIgnoreY(Vector3 position, float lerpSpeed)Points Transform to the Vector3 position defined to be argument ignoring the Y-axis based on a velocity.
void teleportTo(SpatialObject object)Changes the position of the Transform to the position of the SpatialObject to be "object" argument.
void teleportTo(Vector3 position)Changes the position of an Transform to the position of the Vector to be "position" argument.
void transformPoint(Vector3 vector3)Multiplies the Vector with the Transform's global matrix, and returns a new Vector with the result.
void transformPoint(Vector3 vector3, Vector3 out)Multiply the Vector with the Transform's global matrix, and apply the result to the Vector to be "out" argument.
Vector3 inverseTransformPoint(Vector3 vector3)Multiplies the Vector with the inverse of the Transform's global matrix, and returns a new Vector as a result.
void inverseTransformPoint(Vector3 vector3, Vector3 out)Multiplies the Vector with the inverse of the Transform's global matrix, and applies the result to the Vector to be "out" argument.
Vector3 transformDirection(Vector3 vector3)Multiplies the Vector with the global matrix of the Transform, disregarding the position and scale, considering only rotation, and returns a new Vector with the result.
void transformDirection(Vector3 vector3, Vector3 out)Multiplies the Vector with the Transform's global matrix, disregarding the position and scale, taking into account only rotation, and applies the result to the Vector to be "out" argument.
Vector3 inverseTransformDirection(Vector3 vector3)Multiplies the Vector with the inverse of the Transform's global matrix, disregarding the position and scale, considering only rotation, and returns a new Vector with the result.
void inverseTransformDirection(Vector3 vector3, Vector3 out)Multiplies the Vector with the inverse of the Transform's global matrix, disregarding the position and scale, taking into account only rotation, and applies the result to the Vector to be "out" argument.
Vector3 forward()Returns a Vector3 pointing to the front of the Transform.
Vector3 forward(Vector3 out)returns a Vector3 passed to be argument "out" pointing to the front of the Transform.
Vector3 back()Returns a Vector3 pointing behind the Transform.
Vector3 back(Vector3 out)Points the Vector3 to be "out" argument to the back of the Transform.
Vector3 left()Returns a Vector3 pointing to the left of the Transform.
Vector3 left(Vector3 out)Points the Vector3 to be "out" argument to the left of the Transform.
Vector3 right()Returns a Vector3 pointing to the right of the Transform.
Vector3 right(Vector3 out)Points the Vector3 to be "out" argument to the right of the Transform.
Vector3 up()Returns a Vector3 pointing up from the Transform.
Vector3 up(Vector3 out)Points the Vector3 to be "out" argument to the up of the Transform.
Vector3 down()Returns a Vector3 pointing down from the Transform.
Vector3 down(Vector3 out)Points the Vector3 to be "out" argument to the down of the Transform.
float globalDistance(SpatialObject other)Returns the global distance between one Transform and SpatialObject.
float globalDistance(Transform other)Returns the global distance between the Transform and other Transform.
float globalDistance(Vector3 other)Returns the global distance between the Transform and the vector.
float globalSqrtDistance(SpatialObject other)Returns the overall distance squared between the Transform and the SpatialObject.
float globalSqrtDistance(Transform other)Returns the overall distance squared between the Transform and other Transform.
float globalSqrtDistance(Vector3 other)Returns the overall distance squared between the Transform and the vector.
int getState()Returns the current state of the Transform.
void setState(int state)Define the state of the Transform to be "state" argument.
float[] getGlobalMatrix()Returns a copy of the Transform's global matrix in array format.
float[] getGlobalMatrix(float[] out)Returns a copy of the Transform's global array in array format defined to be "out" argument.
float[] getLocalMatrix()Returns a copy of the Transform's local matrix in array format.
float[] getLocalMatrix(float[] out)Returns a copy of the Transform's local matrix in array format defined to be "out" argument.
Vector3 mulGlobalVector3(Vector3 vector)Multiplies the Vector by the global transformation matrix of this Transform and returns the result in a new Vector.
Vector3 mulLocalVector3(Vector3 vector)Multiplies the Vector by the local transformation matrix of this Transform and returns the result in a new Vector.
void recalculateMatrices()Forces instant recalculation of Transform arrays.
boolean isStatic()Returns true if the Transform is marked "static", false if not.
void setStatic(boolean value)Defines if the Transform will be "static" or not to be "value" argument.