class Object
package iron.object
extended by CameraObject, DecalObject, LightObject, MeshObject, ProbeObject, SpeakerObject
Constructor
Variables
Methods
inlineaddChild(o:Object, parentInverse:Bool = false):Void
Add a game Object as a child of this game Object.
Parameters:
o | The game Object instance to be added as a child. |
---|---|
parentInverse | Optional (default false) change the scale of the child object to be relative to the parents 3D space or use the original scale. |
getChild(name:String):Object
Get a child game Object of this game Object. Using the childs name property as a lookup.
Parameters:
name | A string matching the name property of the game Object to fetch. |
---|
Returns:
Object or null
getChildren(recursive:Bool = false):Array<Object>
getTrait<T>(c:Class<T>):T
Get the Trait instance that is attached to this game Object.
Parameters:
c | The class of type Trait to attempt to retrieve. |
---|
Returns:
Trait or null
inlineremoveChild(o:Object, keepTransform:Bool = false):Void
Remove a child game Object from it's parentage. Does not remove the object from the scene.
Parameters:
o | The game Object instance to be removed. |
---|---|
keepTransform | Optional (defaut false) keep the transform given by the parent or revert to the objects default. |
removeTrait(t:Trait):Void
Remove the Trait from the Object.
Parameters:
t | The Trait to be removed from the game Object. |
---|
setParent(parentObject:Object, parentInverse:Bool = false, keepTransform:Bool = false):Void
Set the given parentObject
as the parent of this object.
If parentObject
is null
, the object is parented to the scene's
sceneParent
, which is the topmost object of the scene tree.
If you want to remove it from the scene, use Object.remove()
instead.
If parentObject
is the object on which this function is called,
nothing happens.
Parameters:
parentObject | The new parent object. |
---|---|
parentInverse | (Optional) Change the scale of the child object to be relative to the new parents 3D space or use the original scale. |
keepTransform | (Optional) When unparenting from the old parent, keep the transform given by the old parent or revert to the object's default. |