Pular para o conteúdo principal

SpatialObject

class SpatialObject

SpatialObject represents objects in 3d space.


public class SpatialObject 

— Constructors (4) —

ConstructorDescription
SpatialObject()Creates a new SpatialObject.
SpatialObject(SpatialObject parent)Creates a new SpatialObject with parentage in the SpatialObject to be "parent" argument.
SpatialObject(String name)Creates a new SpatialObject with a name defined to be "name" argument.
SpatialObject(String name, SpatialObject parent)Creates a new SpatialObject with name defined to be "name" argument, and with parentage in the SpatialObject to be "parent" argument.

— Methods (123) —

NameDescription
boolean isEnabled()Returns true if SpatialObject is enabled, false if not.
void setEnabled(boolean value)Defines whether SpatialObject is enabled or disabled to be "value" argument.
boolean isDontDestroyOnLoad()Returns true if SpatialObject is set to "DontDestroyOnLoad", false if not.
void setDontDestroyOnLoad(boolean value)Defines whether the SpatialObject will have "DontDestroyOnLoad" activated or not.
String getName()Returns a String with the name of the SpatialObject.
void setName(String name)Defines the name of the SpatialObject to be "name" argument.
[JAVARuntime.OHString] getNameOH()Returns an OHString with the name of the SpatialObject.
void setNameOH([JAVARuntime.OHString] name)Defines the name of the SpatialObject to be "name" argument (in OHString).
Transform getTransform()Returns the Transform of the SpatialObject.
[ObjectPhysics] getPhysics()Returns the physics of the SpatialObject.
void destroy()Delete the SpatialObject.
GUID getGUID()Returns the guid of the SpatialObject.
void callFunction(String name)Calls all methods that have the same name passed to be "name" argument in the Components of this SpatialObject.
void callFunction(String name, Object value)Calls all methods that have the same name passed to be "name" argument in the Components of this SpatialObject and sets its value to be "value" argument.
void callFunction(String name, int value)Calls all methods that have the same name passed to be "name" argument in the Components of this SpatialObject and sets its value to be "value" argument.
void callFunction(String name, float value)Calls all methods that have the same name passed to be "name" argument in the Components of this SpatialObject and sets its value to be "value" argument.
void callFunction(String name, String value)Calls all methods that have the same name passed to be "name" argument in the Components of this SpatialObject and sets its value to be "value" argument.
void callFunction(String name, boolean value)Calls all methods that have the same name passed to be "name" argument in the Components of this SpatialObject and sets its value to be "value" argument.
SpatialObject instantiate(ObjectFile file)Instance an "Object.go" defined to be "file" argument.
SpatialObject instantiate(ObjectFile file, Vector3 position)Instance an "Object.go" defined to be "file" argument at the position defined to be "position" argument.
SpatialObject instantiate(ObjectFile file, Vector3 position, Quaternion rotation)Instance an "Object.go" defined to be "file" argument at the position defined to be "position" argument, and with the rotation defined to be "rotation" argument.
SpatialObject instantiate(ObjectFile file, Vector3 position, Quaternion rotation, Vector3 scale)Instance an "Object.go" defined to be "file" argument at the position defined to be "position" argument, with the rotation defined to be "rotation" argument, and with the scale defined to be "scale" argument.
SpatialObject instantiateHasChild(ObjectFile file)Instance as a child an "Object.go" defined to be "file" argument.
SpatialObject instantiateHasChild(ObjectFile file, SpatialObject parent)Instance as a child an "Object.go" defined to be "file" argument, and define its parentage to be "parent" argument.
Any Component findComponent(String tittle)Searches for a SpatialObject Component by the name defined to be "tittle" argument.
Any Component findComponent([Class] type)Searches for a Component(Class) of the SpatialObject by the name defined to be "type" argument.
ArrayList findComponents(String tittle)Fetch the list of Components defined by the name to be "tittle" argument.
ArrayList findComponents([Class] type)Fetch the list of Components(Class) defined by the name to be "type" argument.
Any Component findComponentInChildren(String tittle)Searches for a Component of a child of SpatialObject by the name defined to be "tittle" argument.
Any Component findComponentInChildren([Class] type)Searches for a Component(Class) of a child of SpatialObject by the name defined to be "type" argument.
void removeComponent(Component component)Removes a Component from the SpatialObject to be "component" argument.
void addComponent(Component component)Adds a Component from the SpatialObject to be "component" argument.
void addComponent(Component component, [Class] type)Adds a Component to the SpatialObject to be "component" argument and Component(Class) to be "type" argument.
SpatialObject getParent()Returns the peer value of the SpatialObject.
void setParent(SpatialObject parent)Defines the parentage of the SpatialObject with another one passed to be "parent" argument.
SpatialObject getMainParent()Returns the main peer(main father SpatialObject) of the SpatialObject.
void removeParent()Removes the parentage from the SpatialObject.
SpatialObject findChildObject(String name)Searches for a child SpatialObject by a name defined to be "name" argument.
SpatialObject getChildAt(int idx)Returns a child SpatialObject by an id passed to be "idx" argument.
int getChildCount()Returns the number of children of a SpatialObject.
int getChildIndex(SpatialObject child)Returns the id of a child of the SpatialObject passed to be "child" argument.
ArrayList getChildList()Returns a list with the number of children of the SpatialObject.
ArrayList getComponentsList()Returns the list of SpatialObject Components.
Component getComponentsAt(int idx)Returns the Components of a child of SpatialObject by an id defined to be "idx" argument.
String toJson()Serialize SpatialObject to .json.
boolean exists()Checks that the SpatialObject has not been destroyed.
float distance(SpatialObject other)Returns the current distance between this SpatialObject and the SpatialObject passed to be "other" argument.
float distance(Transform other)Returns the current distance between this SpatialObject and the Transform passed to be "other" argument.
float distance(Vector3 other)Returns the current distance between this SpatialObject and the Vector passed to be "other" argument.
float sqrtDistance(SpatialObject other)Returns the current distance squared between this SpatialObject and the SpatialObject passed to be the "other" argument.
float sqrtDistance(Transform other)Returns the current distance squared between this SpatialObject and the Transform passed to be the "other" argument.
float sqrtDistance(Vector3 other)Returns the current distance squared between this SpatialObject and the Vector passed to be the "other" argument.
boolean compareName(String name)Returns true if the name of this SpatialObject is the same as the one defined to be "name" argument, false if not.
String getTag()Returns the current tag of this SpatialObject.
void setTag(String name)Sets the current tag of this SpatialObject to be "name" argument.
boolean compareTag(String name)Returns true if the tag of this SpatialObject is the same as the one defined to be "name" argument.
SpatialObject findChildObject([JAVARuntime.OHString] name)Searches a child object of this SpatialObject by its name defined to be "name" argument.
Vector3 getPosition()Returns a new Vector with the SpatialObject 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 SpatialObject rotation.
Quaternion getGlobalRotation()Returns a new Quaternion with the global rotation of the SpatialObject.
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 SpatialObject.
Vector3 getGlobalScale()Returns a new Vector with the global scale of the SpatialObject.
Vector3 getGlobalScale(Vector3 out)Applies global scaling to the Vector to be "out" argument.
void setPosition(Vector3 vector)Set the SpatialObject's position to be "vector" argument Vector3.
void setPosition(float x, float y, float z)Set the SpatialObject position respectively X, Y and Z.
void setPositionX(float v)Sets the current X position of the SpatialObject to be "v" argument.
void setPositionY(float v)Sets the current Y position of the SpatialObject to be "v" argument.
void setPositionZ(float v)Sets the current Z position of the SpatialObject to be "v" argument.
void setRotation(Quaternion quaternion)Set the rotation of the SpatialObject by the Quaternion to be "quaternion" argument.
void setRotation(float w, float x, float y, float z)Set the rotation of the SpatialObject respectively, W, X, Y and Z.
void setScale(Vector3 vector)Set the SpatialObject's scale to be "vector" argument Vector3.
void setScale(float x, float y, float z)Set the scale of the SpatialObject respectively X, Y and Z.
void setScale(float all)Defines the scale of the three axes, X, Y and Z of the SpatialObject to be "all" argument.
void translate(float x, float y, float z)Moves the SpatialObject 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 SpatialObject on the respective axes, X, Y and Z.
void rotate(float x, float y, float z)Rotates the SpatialObject to be respective X, Y and Z axes.
void translateInSeconds(float x, float y, float z)Moves the SpatialObject 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 SpatialObject 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 SpatialObject to be respective X, Y and Z axes multiplied by "Math.bySecond(1)".
void moveInSeconds(int x, int y, int z)Moves the SpatialObject to be respective X, Y and Z axes multiplied by "Math.bySecond(1)".
void rotateInSeconds(float x, float y, float z)Rotates the SpatialObject to be X, Y and Z axes multiplied by "Math.bySecond(1)".
void rotateInSeconds(int x, int y, int z)Rotates the SpatialObject to be X, Y and Z axes multiplied by "Math.bySecond(1)".
void transformPoint(Vector3 vector3)Multiplies the Vector with the SpatialObject's global matrix, and returns a new Vector with the result.
void transformPoint(Vector3 vector3, Vector3 out)Multiply the Vector with the SpatialObject'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 SpatialObject'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 SpatialObject'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 SpatialObject, 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 SpatialObject'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 SpatialObject'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 SpatialObject'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 SpatialObject.
Vector3 forward(Vector3 out)returns a Vector3 passed to be argument "out" pointing to the front of the SpatialObject.
Vector3 back()Returns a Vector3 pointing behind the SpatialObject.
Vector3 back(Vector3 out)Points the Vector3 to be "out" argument to the back of the SpatialObject.
Vector3 left()Returns a Vector3 pointing to the left of the SpatialObject.
Vector3 left(Vector3 out)Points the Vector3 to be "out" argument to the left of the SpatialObject.
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 SpatialObject.
Vector3 up()Returns a Vector3 pointing up from the SpatialObject.
Vector3 up(Vector3 out)Points the Vector3 to be "out" argument to the up of the SpatialObject.
Vector3 down()Returns a Vector3 pointing down from the SpatialObject.
Vector3 down(Vector3 out)Points the Vector3 to be "out" argument to the down of the SpatialObject.
void lookTo(SpatialObject object)Points the SpatialObject to the position of the other SpatialObject defined to be "object" argument.
void lookTo(Vector3 position)Points the SpatialObject to the position of the vector defined to be "position" argument.
void lookTo(float x, float y, float z)Points the SpatialObject to the positions respectively X, Y and Z passed to be argument.
void lookToIgnoreY(SpatialObject object)Points the SpatialObject to the position of the other SpatialObject ignoring the Y axis defined to be "object" argument.
void lookToIgnoreY(Vector3 position)Points the SpatialObject to the vector position ignoring the Y axis defined to be "position" argument.
void teleportTo(SpatialObject object)Changes the position of the SpatialObject to the position of the other SpatialObject to be "object" argument.
void teleportTo(Vector3 position)Changes the position of an SpatialObject to the position of the vector to be "position" argument.
int getState()Returns the current state of the SpatialObject.
void setState(int state)Define the state of the SpatialObject to be "state" argument.
float[] getGlobalMatrix()Returns a copy of the SpatialObject's global matrix in array format.
float[] getGlobalMatrix(float[] out)Returns a copy of the SpatialObject's global array in array format defined to be "out" argument.
float[] getLocalMatrix()Returns a copy of the SpatialObject's local matrix in array format.
float[] getLocalMatrix(float[] out)Returns a copy of the SpatialObject'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 SpatialObject and returns the result in a new vector.
Vector3 mulLocalVector3(Vector3 vector)Multiplies the Vector by the local transformation matrix of this SpatialObject and returns the result in a new vector.
void recalculateMatrices()Forces instant recalculation of SpatialObject arrays.
boolean isStatic()Returns true if the SpatialObject is marked "static", false if not.
void setStatic(boolean value)Defines if the SpatialObject will be "static" or not to be "value" argument.

— Static Methods (1) —

NameDescription
SpatialObject loadFile(ObjectFile file)Loads the file(.go) defined to be "file" argument.