API Reference

Class List

pc.callbacks

Namespace for callback definitions.

Summary

Type Defintions

AddParserCallback used by pc.ModelHandler#addParser to decide on which parser to use.
AssetReadyCallback used by pc.Asset#ready and called when an asset is ready.
CalculateMatrixCallback used by pc.CameraComponent#calculateTransform and pc.CameraComponent#calculateProjection.
ConfigureAppCallback used by pc.Application#configure when configuration file is loaded and parsed (or an error occurs).
CreateScreenCallback used by pc.script.createLoadingScreen.
FilterAssetCallback used by pc.AssetRegistry#filter to filter assets.
FindNodeCallback used by pc.GraphNode#find and pc.GraphNode#findOne to search through a graph node and all of its descendants.
ForEachCallback used by pc.GraphNode#forEach to iterate through a graph node and all of its descendants.
HandleEventCallback used by pc.events functions.
HttpResponseCallback used by pc.Http#get, pc.Http#post, pc.Http#put, pc.Http#del, and pc.Http#request.
LoadAssetCallback used by pc.AssetRegistry#loadFromUrl and called when an asset is loaded (or an error occurs).
LoadHierarchyCallback used by pc.Application#loadSceneHierarchy.
LoadSettingsCallback used by pc.Application#loadSceneSettings.
LockMouseCallback used by pc.Mouse#enablePointerLock and pc.Application#disablePointerLock.
PreloadAppCallback used by pc.Application#preload when all assets (marked as 'preload') are loaded.
ResourceHandlerCallback used by pc.ResourceHandler#load when a resource is loaded (or an error occurs).
ResourceLoaderCallback used by pc.ResourceLoader#load when a resource is loaded (or an error occurs).
UpdateShaderCallback used by pc.StandardMaterial#onUpdateShader.
VrCameraCallback used by pc.CameraComponent#enterVr and pc.CameraComponent#exitVr.
VrDisplayCallback used by pc.VrDisplay#requestPresent and pc.VrDisplay#exitPresent.
VrFrameCallback used by pc.VrDisplay#requestAnimationFrame.

Details

Type Defintions

AddParser

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

Parameters

urlStringThe resource url.
dataObjectThe raw model data.

AssetReady

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

Parameters

assetpc.AssetThe ready asset.

CalculateMatrix

Callback used by pc.CameraComponent#calculateTransform and pc.CameraComponent#calculateProjection.

Parameters

transformMatrixpc.Mat4Output of the function.
viewNumberType of view. Can be pc.VIEW_CENTER, pc.VIEW_LEFT or pc.VIEW_RIGHT. Left and right are only used in stereo rendering.

ConfigureApp

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

Parameters

errString, NullThe error message in the case where the loading or parsing fails.

CreateScreen

Callback used by pc.script.createLoadingScreen.

Parameters

apppc.ApplicationThe application.

FilterAsset

Callback used by pc.AssetRegistry#filter to filter assets.

Parameters

assetpc.AssetThe current asset to filter.

FindNode

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

Parameters

nodepc.GraphNodeThe current graph node.

ForEach

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

Parameters

nodepc.GraphNodeThe current graph node.

HandleEvent

Callback used by pc.events 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 pc.Http#get, pc.Http#post, pc.Http#put, pc.Http#del, and pc.Http#request.

Parameters

errNumber, String, Error, NullThe 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 pc.AssetRegistry#loadFromUrl and called when an asset is loaded (or an error occurs).

Parameters

errString, NullThe error message is null if no errors were encountered.
assetpc.AssetThe loaded asset if no errors were encountered.

LoadHierarchy

Callback used by pc.Application#loadSceneHierarchy.

Parameters

errString, NullThe error message in the case where the loading or parsing fails.
entitypc.EntityThe loaded root entity if no errors were encountered.

LoadSettings

Callback used by pc.Application#loadSceneSettings.

Parameters

errString, NullThe error message in the case where the loading or parsing fails.

LockMouse

Callback used by pc.Mouse#enablePointerLock and pc.Application#disablePointerLock.

PreloadApp

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

ResourceHandler

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

Parameters

errString, NullThe error message in the case where the load fails.
response*The raw data that has been successfully loaded.

ResourceLoader

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

Parameters

errString, NullThe error message in the case where the load fails.
resource*The resource that has been successfully loaded.

UpdateShader

Callback used by pc.StandardMaterial#onUpdateShader.

Parameters

optionsObjectAn 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 pc.StandardMaterial#onUpdateShader.

VrCamera

Callback used by pc.CameraComponent#enterVr and pc.CameraComponent#exitVr.

Parameters

errString, NullOn success it is null on failure it is the error message.

VrDisplay

Callback used by pc.VrDisplay#requestPresent and pc.VrDisplay#exitPresent.

Parameters

errString, NullThe error message if presenting fails, or null if the call succeeds.

VrFrame

Callback used by pc.VrDisplay#requestAnimationFrame.