GameObject

Currently there is a maximum of 65536 GameObjects at any given time. These are statically allocated at startup.

Types

struct GameObject A 32 bit handle.

enum GameObjectState One of GameObjectStateNull, GameObjectStateEnabled, GameObjectStateDisabled, GameObjectStateDestroyed

Creation & Destruction

GameObject_Create(void) : GameObject Create a new GameObject.

GameObject_CreateInactive(void) : GameObject Create a new GameObject that is disabled.

GameObject_Instantiate( GameObject source ) : GameObject Clone the GameObject at source recursively.

GameObject_Destroy( GameObject object ) : void
Destroy the GameObject, if it exists.

Functions

GameObject_Exists( GameObject object ) : bool
Returns true if the GameObject is non-null.

GameObject_Status( GameObject object ) : GameObjectState Returns the state of this GameObject.

GameObject_ActiveSelf( GameObject object ) : bool
Returns the active status of the object independent of the hierarchy. Returns false if the GameObject is null.

GameObject_ActiveInHierarchy( GameObject object ) : bool
Returns the active status of the object taking the hierarchy into account. Returns false if the GameObject is null.

GameObject_Parent( GameObject object ) : GameObject Returns the object’s parent. If the object is null, a warning is logged and a null object is returned.

GameObject_FirstChild( GameObject object ) : GameObject Returns the object’s first child. If the object is null, a warning is logged and a null object is returned.

GameObject_NextSibling( GameObject object ) : GameObject Returns the object’s next sibling. If the object is null, a warning is logged and a null object is returned.

GameObject_PreviousSibling( GameObject object ) : GameObject Returns the object’s previous sibling. If the object is null, a warning is logged and a null object is returned.

GameObject_LocalPosition( GameObject object ) : Float3 Returns the local position of this object. If the object is null, a warning is logged and NaN is returned.

GameObject_WorldPosition( GameObject object ) : Float3 Returns the world position of this object. If the object is null, a warning is logged and NaN is returned.

GameObject_LocalRotation( GameObject object ) : Quaternion
Returns the local rotation of this object. If the object is null, a warning is logged and NaN is returned.

GameObject_WorldRotation( GameObject object ) : Quaternion
Returns the world position of this object. If the object is null, a warning is logged and NaN is returned.

GameObject_LocalScale( GameObject object ) : float
Returns the local scale of this object. If the object is null, a warning is logged and NaN is returned.

GameObject_WorldScale( GameObject object ) : float
Returns the world scale of this object. If the object is null, a warning is logged and NaN is returned.

GameObject_TransformPoint( GameObject object, Float3 point ) : Float3
Transform the point from game-object-local to world space, using scale, rotation, and position. If the object is null, a warning is logged and NaN is returned.

GameObject_TransformFloat( GameObject object, Float3 Float ) : Float3
Transform the Float from game-object-local to world space, using scale and rotation. If the object is null, a warning is logged and NaN is returned.

GameObject_TransformDirection( GameObject object, Float3 direction ) : Float3
Transform the direction from game-object-local to world space, using rotation. If the object is null, a warning is logged and NaN is returned.

GameObject_InverseTransformPoint( GameObject object, Float3 point ) : Float3
Transform the point from world to game-object-local space, using scale, rotation, and position. If the object is null, a warning is logged and NaN is returned.

GameObject_InverseTransformFloat( GameObject object, Float3 Float ) : Float3
Transform the Float from world to game-object-local space, using scale and rotation. If the object is null, a warning is logged and NaN is returned.

GameObject_InverseTransformDirection( GameObject object, Float3 direction ) : Float3
Transform the direction from world to game-object-local space, using rotation. If the object is null, a warning is logged and NaN is returned.

GameObject_TransformMatrix( GameObject object, float asset_scale ) : Float4x4
Returns the matrix transforming points from local to world space, scaled by asset_scale. If the object is null, a warning is logged and NaN is returned.

GameObject_InverseTransformMatrix( GameObject object, float asset_scale ) : Float4x4
Returns the matrix transforming points from world to local space, scaled by asset_scale. If the object is null, a warning is logged and NaN is returned.

GameObject_LastModifiedFrame( GameObject object) : uint64_t
Returns the last frame this object was modified. If the object is null, a warning is logged and 0 is returned.

Methods

GameObject_Activate( GameObject object ) : GameObjectState Activates the object if possible and returns the state of the object. This will recursively update children.

GameObject_Deactivate( GameObject object ) : GameObjectState Deactivates the object if possible and returns the state of the object. This will recursively update children.

GameObject_SetParent( GameObject object, GameObject parent ) : bool
Set the object’s parent. Returns true if the operation succeeds. Returns false if either object is null or destroyed, or the operation would create a cycle.

GameObject_MakeRoot( GameObject object ) : bool
Set the object to be a root. This will unparent the object from its parent, if it has one. Returns true if the operation succeeds. Returns false if the object is null or destroyed.

GameObject_SetLocalPosition( GameObject object, Float3 position ) : bool
Set the object’s local position and update the hierarchy. Returns false if the object is null.

GameObject_SetWorldPosition( GameObject object, Float3 position ) : bool
Set the object’s world position and update the hierarchy. Returns false if the object is null.

GameObject_SetLocalRotation( GameObject object, Quaternion rotation ) : bool
Set the object’s local rotation and update the hierarchy. Returns false if the object is null.

GameObject_SetWorldRotation( GameObject object, Quaternion rotation ) : bool
Set the object’s world rotation and update the hierarchy. Returns false if the object is null.

GameObject_LookAt( GameObject object, Float3 point ) : bool
Set the object’s rotation to face point and update the hierarchy. Returns false if the object is null.

GameObject_SetLocalScale( GameObject object, float scale ) : bool
Set the object’s local scale and update the hierarchy. Returns false if the object is null.

GameObject_SetWorldScale( GameObject object, float scale ) : bool
Set the object’s world scale and update the hierarchy. Returns false if the object is null.