@:value({ depth : true, color : 0xFFFF0000 })new(color:Int = 0xFFFF0000, ?bounds:Bounds, depth:Bool = true, ?parent:Object)



@:value(1.0)thickness:Float = 1.0


Inherited Variables

Defined by Graphics


Setting is3D to true will switch from a screen space line (constant size whatever the distance) to a world space line

Defined by Mesh


The material of the mesh: the properties used to display it (texture, color, shaders, etc.)


The primitive of the mesh: the list of vertexes and indices necessary to display the mesh.

Defined by Object


When enabled, the object can be serialized (default : true)


When an object is not visible or culled, its animation does not get synchronized unless you set alwaysSync=true


Inform that the object is not to be displayed and his animation doesn't have to be sync. Unlike visible, this doesn't apply to children unless inheritCulled is set to true.


When set, collider shape will be used for automatic frustum culling. If inheritCulled is true, collider will be inherited to children unless they have their own collider set.


This is an additional optional transformation that is performed before other local transformations. It is used by the animation system.


Follow a given object or joint as if it was our parent. Ignore defaultTransform when set.


When follow is set, only follow the position and ignore both scale and rotation.


When enabled, the object bounds are ignored when using getBounds()


When enabled, the object is ignored when using getCollider()


When enabled, the object will not follow its parent transform


When enabled, the culled flag and culling collider is inherited by children objects.


When selecting the lights to apply to this object, we will use the camera target as reference instead of the object absolute position. This is useful for very large objects so they can get good lighting.


The name of the object, can be used to retrieve an object within a tree by using getObjectByName (default null)

read onlynumChildren:Int

How many immediate children this object has.

read onlyparent:Object

The parent object in the scene tree.


The amount of scaling along the X axis of this object (default 1.0)


The amount of scaling along the Y axis of this object (default 1.0)


The amount of scaling along the Z axis of this object (default 1.0)


Is the object and its children are displayed on screen (default true).


The x position of the object relative to its parent.


The y position of the object relative to its parent.


The z position of the object relative to its parent.

Inherited Methods

Defined by Graphics


inlinedrawLine(p1:Point, p2:Point):Void

@:value({ alpha : 1., color : 0, size : 0. })lineStyle(size:Float = 0., color:Int = 0, alpha:Float = 1.):Void

lineTo(x:Float, y:Float, z:Float):Void

moveTo(x:Float, y:Float, z:Float):Void

@:value({ alpha : 1. })setColor(color:Int, alpha:Float = 1.):Void

Defined by Mesh


Return all materials for the current object.

Defined by Object


Add a child object at the end of the children list.

addChildAt(o:Object, pos:Int):Void

Insert a child object at the specified position of the children list.

@:value({ recursive : true })applyAnimationTransform(recursive:Bool = true):Void

When an object is loaded, its position scale and rotation will always be set to the default values (0 for position/rotation and 1 for scale). If it's part of a group/scene or if it's animated, then its position/rotation/scale will be stored into the defaultTransform matrix. Calling this function will reset the defaultTransform to null and instead initialize x/y/z/rotation/scale properties. This will not change the actual position of the object but allows you to move the object more freely on your own. Do not use on an object that is currently being animated, since it will set again defaultTransform and apply twice the transformation.


Tells if the object is contained into this object children, recursively.

find<T>(f:Object ‑> Null<T>):Null<T>

Find a single object in the tree by calling f on each and returning the first not-null value returned, or null if not found.

findAll<T>(f:Object ‑> Null<T>, ?arr:Array<T>):Array<T>

Find several objects in the tree by calling f on each and returning all the not-null values returned.


Returns the updated absolute position matrix. Please note that this is not a copy so it should not be modified.


Return the bounds of this object and all its children, in absolute global coordinates.


Return the nth element among our immediate children list, or null if there is no.


Return the index of the object o within our immediate children list, or -1 if it is not part of our children list.


Build and return the global absolute recursive collider for the object. Returns null if no collider was found or if ignoreCollide was set to true.


Same as getLocalCollider, but returns an absolute collider instead of a local one.


Returns the updated inverse position matrix. Please note that this is not a copy and should not be modified.


Return the direction in which the object rotation is currently oriented to


Search for an mesh recursively by name, return null if not found.


Return all meshes part of this tree


Search for an object recursively by name, return null if not found.


Return the total number of children, recursively.


Returns the position matrix relative to another scene object


Return the quaternion representing the current object rotation. Dot not modify as it's not a copy.


Return the Scene this object is part of, or null if not added to a Scene.


Returns the local position, scale and rotation of the object relative to its parent.


Convert an absolute global position into a local position relative to the object origin, applying all the inherited transforms.


Tell if the object is a Mesh.

iterVisibleMeshes(callb:Mesh ‑> Void):Void

Iterate on all mesh that are currently visible and not culled in the tree. Call callb for each mesh found.


Return an iterator over this object immediate children


Convert a local position (or [0,0] if pt is null) relative to the object origin into an absolute global position, applying all the inherited transforms.


Create an animation instance bound to the object, set it as currentAnimation and play it.


Same as parent.removeChild(this), but does nothing if parent is null. In order to capture add/removal from scene, you can override onAdd/onRemove/onParentChanged


Remove the given object from our immediate children list if it's part of it.


Remove all children from our immediate children list

rotate(rx:Float, ry:Float, rz:Float):Void

Rotate around the current rotation axis by the specified angles (in radian).


Scale uniformly the object by the given factor.


Set the rotation using the specified look at direction

inlinesetPosition(x:Float, y:Float, z:Float):Void

Set the position of the object relative to its parent.

setRotation(rx:Float, ry:Float, rz:Float):Void

Set the rotation using the specified angles (in radian).

setRotationAxis(ax:Float, ay:Float, az:Float, angle:Float):Void

Set the rotation using the specified axis and angle of rotation around it (in radian).


Set the quaternion representing the current object rotation. Dot not modify the value afterwards as no copy is made.


Set the uniform scale for the object.

@:value({ recursive : false })stopAnimation(recursive:Bool = false):Void

Stop the current animation. If recursive is set to true, all children will also stop their animation


Change the current animation. This animation should be an instance that was previously created by playAnimation.


If the object is a Mesh, return the corresponding Mesh. If not, throw an exception.


Return both class name and object name if any.