Interfaces
Interfaces API reference
- WL
- ComponentProperty: Interface
- ComponentProto: Interface
- GLTFExtensions: Interface
- ListenerOptions: Interface
- LoadRuntimeOptions: Interface
- MaterialParameters: Interface
- MeshParameters: Interface
- NumberArray: Interface
- PropertyReferenceOptions: Interface
- RetainListenerOptions: Interface
- SceneAppendParameters: Interface
- SceneLoadOptions: Interface
- CollisionCallback: Type Alias
- ComponentConstructor: Type Alias
- Constructor: Type Alias
- ImageLike: Type Alias
- ListenerCallback: Type Alias
- PropertyArgs: Type Alias
- PropertyKeys: Type Alias
- SceneAppendResult: Type Alias
- SceneAppendResultWithExtensions: Type Alias
- TypedArray: Type Alias
- TypedArrayCtor: Type Alias
- Version: Type Alias
.ComponentProperty: Interface
Custom component property.
For more information about component properties, have a look at the Properties attribute.
Properties
Name | Type | Description |
---|---|---|
default | any | Default value, depending on type. |
required | boolean | |
type | Type | Property type. |
values | string[] | Values for Enum |
.ComponentProto: Interface
Component prototype interface.
User component’s should have the same structure.
Properties
Name | Type | Description |
---|---|---|
init | () ⇒ void | Triggered after the component instantiation. For more information, please have a look at init. |
onActivate | () ⇒ void | Triggered when the component goes from deactivated to activated. For more information, please have a look at onActivate. |
onDeactivate | () ⇒ void | Triggered when the component goes from activated to deactivated. For more information, please have a look at onDeactivate. |
onDestroy | () ⇒ void | 0.9.0+ Triggered when the component is removed from its object. For more information, please have a look at onDestroy. |
start | () ⇒ void | Triggered after the component is activated for the first time. For more information, please have a look at start. |
update | (dt: number) ⇒ void | Triggered once per frame. For more information, please have a look at update. |
.GLTFExtensions: Interface
Extension data obtained from glTF files.
Properties
Name | Type | Description |
---|---|---|
idMapping | number[] | Remapping from glTF node index to objectId. |
mesh | Record<number, Record<string, Record<string, any»> | Mesh extension objects. Key is objectId, value is JSON data indexed by extension name. |
node | Record<number, Record<string, Record<string, any»> | Node extension objects. Key is objectId, value is JSON data indexed by extension name. |
root | Record<string, Record<string, any» | glTF root extensions object. JSON data indexed by extension name. |
.ListenerOptions: Interface
Registration options for a listener in an Emitter.
Properties
Name | Type | Description |
---|---|---|
id | any | Listener identifier. This is used to find and remove the listener without needing the callback reference. The identifier can be any type. However, remember that the comparison will be by-value for primitive types (string, number), but by reference for objects. For more information, please look at the remove method. |
once | boolean | If true , the listener is automatically removed after it’s invoked. Defaults to false . |
.LoadRuntimeOptions: Interface
Options to forward to loadRuntime
Properties
Name | Type | Description |
---|---|---|
canvas | string | Canvas id or element. If this is undefined , looks for a canvas with id ‘canvas’. |
loader | boolean | If true , forces the runtime to load a loader-compatible version. This option allows to load gltf data at runtime. |
loadingScreen | string | Path to the loading screen. If undefined , defaults to ‘WonderlandRuntime-LoadingScreen.bin’. Beware that these are special .bin files signed by Wonderland. Customizing requires an enterprise license, please reach out for more information. |
physx | boolean | If true , forces the runtime to load a physx-compatible version. Note: If your scene uses physx, you must enable this option. |
simd | boolean | If true , forces the runtime to load the SIMD-compatible version. If undefined , performs browser feature detection to check whether SIMD is supported or not. |
threads | boolean | If true , forces the runtime to load the threads-compatible version. If undefined , performs browser feature detection to check whether threads are supported or not. |
xrFramebufferScaleFactor | number | Default framebuffer scale factor. This can later be changed using xrFramebufferScaleFactor |
.MaterialParameters: Interface
Constructor parameters object for a Material instance.
Properties
Name | Type | Description |
---|---|---|
pipeline | string | The name of the pipeline. |
.MeshParameters: Interface
Mesh constructor parameters object.
Usage:
1const mesh = Mesh({vertexCount: 3, indexData: [0, 1, 2]});
Properties
Name | Type | Description |
---|---|---|
indexData | Readonly<NumberArray> | Index data values. |
indexType | MeshIndexType | Index type, null if not indexed. |
skinningType | MeshSkinningType | Whether the mesh should be skinned. Defaults to not skinned. |
vertexCount | number | Number of vertices to allocate. |
.NumberArray: Interface
Represents any object that can be used as an array for read / write.
Properties
Name | Type | Description |
---|---|---|
length | number |
.PropertyReferenceOptions: Interface
Options to create a reference property, i.e., object, mesh, animation, skin, etc…
Properties
Name | Type | Description |
---|---|---|
required | boolean | If true , the component will throw if the property isn’t initialized. |
.RetainListenerOptions: Interface
Registration options for a listener in an RetainEmitter.
Those options extend ListenerOptions.
Properties
Name | Type | Description |
---|---|---|
id | any | Listener identifier. This is used to find and remove the listener without needing the callback reference. The identifier can be any type. However, remember that the comparison will be by-value for primitive types (string, number), but by reference for objects. For more information, please look at the remove method. |
immediate | boolean | If true , directly resolves if the emitter retains a value. If false , the listener isn’t invoked until the next notify. Defaults to true . |
once | boolean | If true , the listener is automatically removed after it’s invoked. Defaults to false . |
.SceneAppendParameters: Interface
Options for append.
Properties
Name | Type | Description |
---|---|---|
baseURL | undefined | string |
loadGltfExtensions | boolean | Whether to load glTF extension data |
.SceneLoadOptions: Interface
Scene loading options.
Properties
Name | Type | Description |
---|---|---|
baseURL | string | Path from which resources are resolved (images, languages, etc…). |
buffer | ArrayBuffer | An in-memory buffer, containing the bytes of a .bin file. |
.CollisionCallback: Type Alias
Definition:
1CollisionCallback = (type: CollisionEventType, other: PhysXComponent) ⇒ void
.ComponentConstructor: Type Alias
Component constructor type.
For more information, please have a look at the Component class.
Definition:
.Constructor: Type Alias
Definition:
1Constructor<T> = (...args: any[][]) ⇒ T
.ImageLike: Type Alias
Element that can be used as an image in the engine.
Definition:
1ImageLike = HTMLImageElement | HTMLVideoElement | HTMLCanvasElement
.ListenerCallback: Type Alias
Definition:
1ListenerCallback<T: extends unknown[]> = (...data: T[]) ⇒ void
.PropertyArgs: Type Alias
Retrieve all the argument types of a Property function.
Definition:
1PropertyArgs<key: extends PropertyKeys> = Parameters<['undefined']>
.PropertyKeys: Type Alias
All the keys that exists on the Property object.
Definition:
1PropertyKeys = keyof undefined
.SceneAppendResult: Type Alias
Result obtained when appending a scene with append.
Definition:
1SceneAppendResult = Object3D | null | SceneAppendResultWithExtensions
.SceneAppendResultWithExtensions: Type Alias
Result obtained when appending a scene with append with gltf extensions.
Definition:
.TypedArray: Type Alias
Typed array instance based on a given TypedArrayCtor constructor.
Definition:
1TypedArray<T: extends TypedArrayCtor> = InstanceType<T>
.TypedArrayCtor: Type Alias
A type alias for any TypedArray constructor, except big-int arrays.
Definition:
1TypedArrayCtor = Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor
.Version: Type Alias
Version type following a subset of the Semantic Versioning specification.
Definition: