Static methods

staticdynamicsetupDebugMaterial(debugObj:Object):Void

Constructor

new(shape:Collider, ?parent:Object)

Variables

@:value(false)allowMultiClick:Bool = false

When enabled, allows to receive several onClick events the same frame.

bestMatch:Bool

Is it required to find the best hit point in a complex mesh or any hit possible point will be enough (default = false, faster).

@:value(false)cancelEvents:Bool = false

Set the default cancel mode (see hxd.Event), default to false.

@:value(false)emittedLastFrame:Bool = false

@:value(false)enableRightButton:Bool = false

When enabled, interacting with secondary mouse buttons (right button/wheel) will cause onPush, onClick, onRelease and onReleaseOutside callbacks. Otherwise those callbacks will only be triggered with primary mouse button (left button).

@:value(false)isAbsoluteShape:Bool = false

Tells if our shapes are in absolute space (for example ObjectCollider) or relative to the interactive transform.

preciseShape:Null<Collider>

If several interactive conflicts, the preciseShape (if defined) can be used to distinguish between the two.

priority:Int

In case of conflicting shapes, usually the one in front of the camera is prioritized, unless you set an higher priority.

@:value(false)propagateEvents:Bool = false

Set the default propagate mode (see hxd.Event), default to false.

showDebug:Bool

When set, will display the debug object of the shape (using makeDebugObj)

Methods

blur():Void

focus():Void

getPoint(ray:Ray, bestMatch:Bool):Null<Vector>

hasFocus():Bool

isOver():Bool

dynamiconCheck(e:Event):Void

dynamiconClick(e:Event):Void

Sent when Interactive is clicked by user. This event fired only on Interactive that user pressed and released when mouse is inside Interactive hitbox area.

dynamiconFocus(e:Event):Void

dynamiconFocusLost(e:Event):Void

dynamiconKeyDown(e:Event):Void

dynamiconKeyUp(e:Event):Void

dynamiconMove(e:Event):Void

dynamiconOut(e:Event):Void

Sent when mouse exits Interactive hitbox area. event.propagate and event.cancel are ignored during onOut.

dynamiconOver(e:Event):Void

Sent when mouse enters Interactive hitbox area. event.propagate and event.cancel are ignored during onOver. Propagation can be set with onMove event, as well as cancelling onMove will prevent onOver.

dynamiconPush(e:Event):Void

Sent when Interactive is pressed by user.

dynamiconRelease(e:Event):Void

Sent on multiple conditions. A. Always sent if user releases mouse while it is inside Interactive hitbox area.

This happends regardless if that Interactive was pressed prior or not.

B. Sent before onReleaseOutside if this Interactive was pressed, but released outside it's bounds. For first case event.kind will be ERelease, for second case - EReleaseOutside. See onClick and onReleaseOutside functions for separate events that trigger only when user interacts with this particular Interactive.

dynamiconReleaseOutside(e:Event):Void

Sent when user presses Interactive, moves mouse outside and releases it. This event fired only on Interactive that user pressed, but released mouse after moving it outside of Interactive hitbox area.

dynamiconTextInput(e:Event):Void

dynamiconWheel(e:Event):Void

preventClick():Void

This can be called during or after a push event in order to prevent the release from triggering a click.

set_showDebug(val:Bool):Bool

Inherited Variables

Defined by Object

alwaysSync:Bool

When unset, the object and all its children will not sync() if this root object or one of its parent is culled or not visible. This allows to optimize cpu cost of objects having many children.

alwaysSyncAnimation:Bool

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

culled:Bool

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.

cullingCollider:Collider

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.

defaultTransform:Matrix

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

drawn:Bool

When set, the object has been drawn during previous frame. Useful for temporal effects such as temporal antialiasing.

fixedPosition:Bool

When set, the object and all its children will not sync() unless this root object position has been changed. This allows to optimize cpu cost of static objects having many children.

follow:Object

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

followPositionOnly:Bool

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

ignoreBounds:Bool

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

ignoreCollide:Bool

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

ignoreParentTransform:Bool

When enabled, the object will not follow its parent transform

inheritCulled:Bool

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

lightCameraCenter:Bool

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. (this is only relevant in forward rendering)

modelRoot:Bool

Tag the object as a model root

name:Null<String>

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.

scaleX:Float

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

scaleY:Float

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

scaleZ:Float

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

visible:Bool

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

x:Float

The x position of the object relative to its parent.

y:Float

The y position of the object relative to its parent.

z:Float

The z position of the object relative to its parent.

Inherited Methods

Defined by Object

addChild(o:Object):Void

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.

clone(?o:Object):Object

Make a copy of the object and all its children.

contains(o:Object):Bool

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.

getAbsPos():Matrix

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

finalgetBounds(?b:Bounds, ?relativeTo:Object):Null<Bounds>

Return the bounds of this object and all its children, in absolute global coordinates or relative to the object being used as parameter.

inlinegetChildAt(n:Int):Object

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

getChildIndex(o:Object):Int

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

finalgetCollider():Collider

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.

getGlobalCollider():Collider

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

getInvPos():Matrix

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

getLocalCollider():Collider

Build and returns the local relative not-recursive collider for the object, or null if this object does not have a collider. Does not check for ignoreCollide.

getLocalDirection():Vector

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

getMaterialByName(name:String):Material

Search for a material recursively by name, return it or null if not found.

@:value({ recursive : true })getMaterials(?a:Array<Material>, recursive:Bool = true):Null<Array<Material>>

Return all materials in the tree.

getMeshByName(name:String):Mesh

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

getMeshes(?out:Array<Mesh>):Null<Array<Mesh>>

Return all meshes part of this tree

getObjectByName(name:String):Object

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

getObjectsCount():Int

Return the total number of children, recursively.

getRelPos(obj:Object):Matrix

Returns the position matrix relative to another scene object

getRotationQuat():Quat

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

getScene():Scene

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

getTransform(?mat:Matrix):Matrix

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

globalToLocal(pt:Point):Point

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

inlineisMesh():Bool

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.

inlineiterator():ArrayIterator_h3d_scene_Object

Return an iterator over this object immediate children

localToGlobal(?pt:Null<Point>):Null<Point>

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.

playAnimation(a:Animation):Animation

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

inlineremove():Void

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

removeChild(o:Object):Void

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

removeChildren():Void

Remove all children from our immediate children list

rotate(rx:Float, ry:Float, rz:Float, ?qTmp:Quat):Void

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

inlinescale(v:Float):Void

Scale uniformly the object by the given factor.

setDirection(v:Vector, ?up:Vector):Void

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).

setRotationQuat(q:Quat):Void

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

inlinesetScale(v:Float):Void

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

switchToAnimation(a:Animation):Animation

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

toMesh():Mesh

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

toString():String

Return both class name and object name if any.