API Reference

Class List

callbacks

Namespace for callback definitions.

Summary

Type Defintions

AddParser

Callback used by ModelHandler#addParser to decide on which parser to use.

AssetReady

Callback used by Asset#ready and called when an asset is ready.

CalculateMatrix

Callback used by CameraComponent#calculateTransform and CameraComponent#calculateProjection.

CalculateSortDistance

Callback used by Layer to calculate the "sort distance" for a MeshInstance, which determines its place in the render order.

ConfigureApp

Callback used by Application#configure when configuration file is loaded and parsed (or an error occurs).

CreateScreen

Callback used by script.createLoadingScreen.

FilterAsset

Callback used by AssetRegistry#filter to filter assets.

FindNode

Callback used by GraphNode#find and GraphNode#findOne to search through a graph node and all of its descendants.

ForEach

Callback used by GraphNode#forEach to iterate through a graph node and all of its descendants.

HandleEvent

Callback used by EventHandler functions.

HttpResponse

Callback used by Http#get, Http#post, Http#put, Http#del, and Http#request.

LoadAsset

Callback used by AssetRegistry#loadFromUrl and called when an asset is loaded (or an error occurs).

LoadHierarchy

Callback used by SceneRegistry#loadSceneHierarchy.

LoadScene

Callback used by SceneRegistry#loadScene.

LoadSceneData

Callback used by SceneRegistry.loadSceneData.

LoadSettings

Callback used by SceneRegistry#loadSceneSettings.

LockMouse

Callback used by Mouse#enablePointerLock and Application#disablePointerLock.

PreloadApp

Callback used by Application#preload when all assets (marked as 'preload') are loaded.

ResourceHandler

Callback used by ResourceHandler#load when a resource is loaded (or an error occurs).

ResourceLoader

Callback used by ResourceLoader#load when a resource is loaded (or an error occurs).

UnloadSceneData

Callback used by SceneRegistry.loadSceneData.

UpdateShader

Callback used by StandardMaterial#onUpdateShader.

VrCamera

Callback used by CameraComponent#enterVr and CameraComponent#exitVr.

XrError

Callback used by XrManager#endXr and XrManager#startXr.

XrHitTestStart

Callback used by XrHitTest#start and XrHitTest#startForInputSource.

Details

Type Defintions

AddParser

Callback used by ModelHandler#addParser to decide on which parser to use.

Parameters

urlstring

The resource url.

dataobject

The raw model data.

AssetReady

Callback used by Asset#ready and called when an asset is ready.

Parameters

assetAsset

The ready asset.

CalculateMatrix

Callback used by CameraComponent#calculateTransform and CameraComponent#calculateProjection.

Parameters

transformMatrixMat4

Output of the function.

viewnumber

Type of view. Can be VIEW_CENTER, VIEW_LEFT or VIEW_RIGHT. Left and right are only used in stereo rendering.

CalculateSortDistance

Callback used by Layer to calculate the "sort distance" for a MeshInstance, which determines its place in the render order.

Parameters

meshInstanceMeshInstance

The mesh instance.

cameraPositionVec3

The position of the camera.

cameraForwardVec3

The forward vector of the camera.

ConfigureApp

Callback used by Application#configure when configuration file is loaded and parsed (or an error occurs).

Parameters

errstring, null

The error message in the case where the loading or parsing fails.

CreateScreen

Callback used by script.createLoadingScreen.

Parameters

appApplication

The application.

FilterAsset

Callback used by AssetRegistry#filter to filter assets.

Parameters

assetAsset

The current asset to filter.

FindNode

Callback used by GraphNode#find and GraphNode#findOne to search through a graph node and all of its descendants.

Parameters

nodeGraphNode

The current graph node.

ForEach

Callback used by GraphNode#forEach to iterate through a graph node and all of its descendants.

Parameters

nodeGraphNode

The current graph node.

HandleEvent

Callback used by EventHandler functions. Note the callback is limited to 8 arguments.

Parameters

arg1*

First argument that is passed from caller.

arg2*

Second argument that is passed from caller.

arg3*

Third argument that is passed from caller.

arg4*

Fourth argument that is passed from caller.

arg5*

Fifth argument that is passed from caller.

arg6*

Sixth argument that is passed from caller.

arg7*

Seventh argument that is passed from caller.

arg8*

Eighth argument that is passed from caller.

HttpResponse

Callback used by Http#get, Http#post, Http#put, Http#del, and Http#request.

Parameters

errnumber, string, Error, null

The error code, message, or exception in the case where the request fails.

response*

The response data if no errors were encountered. (format depends on response type: text, Object, ArrayBuffer, XML).

LoadAsset

Callback used by AssetRegistry#loadFromUrl and called when an asset is loaded (or an error occurs).

Parameters

errstring, null

The error message is null if no errors were encountered.

assetAsset

The loaded asset if no errors were encountered.

LoadHierarchy

Callback used by SceneRegistry#loadSceneHierarchy.

Parameters

errstring, null

The error message in the case where the loading or parsing fails.

entityEntity

The loaded root entity if no errors were encountered.

LoadScene

Callback used by SceneRegistry#loadScene.

Parameters

errstring, null

The error message in the case where the loading or parsing fails.

entityEntity

The loaded root entity if no errors were encountered.

LoadSceneData

Callback used by SceneRegistry.loadSceneData.

Parameters

errstring, null

The error message in the case where the loading or parsing fails.

sceneItemSceneRegistryItem

The scene registry item if no errors were encountered.

LoadSettings

Callback used by SceneRegistry#loadSceneSettings.

Parameters

errstring, null

The error message in the case where the loading or parsing fails.

LockMouse

Callback used by Mouse#enablePointerLock and Application#disablePointerLock.

PreloadApp

Callback used by Application#preload when all assets (marked as 'preload') are loaded.

ResourceHandler

Callback used by ResourceHandler#load when a resource is loaded (or an error occurs).

Parameters

errstring, null

The error message in the case where the load fails.

response*

The raw data that has been successfully loaded.

ResourceLoader

Callback used by ResourceLoader#load when a resource is loaded (or an error occurs).

Parameters

errstring, null

The error message in the case where the load fails.

resource*

The resource that has been successfully loaded.

UnloadSceneData

Callback used by SceneRegistry.loadSceneData.

Parameters

errstring, null

The error message in the case where the loading or parsing fails.

sceneItemSceneRegistryItem

The scene registry item if no errors were encountered.

UpdateShader

Callback used by StandardMaterial#onUpdateShader.

Parameters

optionsobject

An object with shader generator settings (based on current material and scene properties), that you can change and then return. Properties of the object passed into this function are documented in StandardMaterial#onUpdateShader.

VrCamera

Callback used by CameraComponent#enterVr and CameraComponent#exitVr.

Parameters

errstring, null

On success it is null on failure it is the error message.

XrError

Callback used by XrManager#endXr and XrManager#startXr.

Parameters

errError, null

The Error object or null if operation was successfull.

XrHitTestStart

Callback used by XrHitTest#start and XrHitTest#startForInputSource.

Parameters

errError, null

The Error object if failed to create hit test source or null.

hitTestSourceXrHitTestSource, null

Object that provides access to hit results against real world geometry.