Interfaces
- WL
- ActivateOptions: Interface
- ComponentProperty: Interface
- ComponentProto: Interface
- GLTFExtensionsInstance: Interface
- GLTFExtensionsLegacy: Interface
- InMemoryLoadOptions: Interface
- InstantiateGltfResult: Interface
- InstantiateResult: Interface
- ListenerOptions: Interface
- LoadRuntimeOptions: Interface
- MaterialConstructor: Interface
- MaterialParameters: Interface
- MeshParameters: Interface
- NativeComponents: Interface
- NumberArray: Interface
- Options: Interface
- PropertyCloner: Interface
- PropertyReferenceOptions: Interface
- RetainListenerOptions: Interface
- SceneAppendParameters: Interface
- SceneLoadOptions: Interface
- UrlLoadOptions: Interface
- XROfferSessionOptions: Interface
- CollisionCallback: Type Alias
- ComponentConstructor: Type Alias
- Constructor: Type Alias
- DictionaryOption: Type Alias
- FirstConstructorParam: Type Alias
- GLTFOptions: Type Alias
- ImageLike: Type Alias
- ListenerCallback: Type Alias
- LoadOptions: Type Alias
- ProgressCallback: Type Alias
- PropertyArgs: Type Alias
- PropertyKeys: Type Alias
- SceneAppendResult: Type Alias
- SceneAppendResultWithExtensions: Type Alias
- Tagger: Type Alias
- TypedArray: Type Alias
- TypedArrayCtor: Type Alias
- Version: Type Alias
.ActivateOptions: Interface
Options for scene activation.
Properties
Name | Type | Description |
---|---|---|
dispatchReadyEvent | boolean | If true , dispatches a ready event in the document. |
waitForDependencies | boolean | If true , the promise will resolve only once all dependencies are downloaded. If false , resolves as soon as possible, e.g., when the lowest resolution textures are available. |
.ComponentProperty: Interface
Custom component property.
For more information about component properties, have a look at the Properties attribute.
Properties
Name | Type | Description |
---|---|---|
cloner | PropertyCloner | Cloner for the property. If not defined, falls back to defaultPropertyCloner. To prevent any cloning, set a custom cloner that passes the original value back from clone. |
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. |
.GLTFExtensionsInstance: 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. |
.GLTFExtensionsLegacy: Interface
Legacy gltf extension type.
Deprecated: Use the new loadGLTF API.
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. |
.InMemoryLoadOptions: Interface
Loading options for in-memory data.
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. |
filename | string | Name of the file. This is the same that will be retrieved via filename |
nocache | boolean | Force to re-download the components bundle, and not use the version from cache. If not set, defaults to false . Note: For now, this setting only affects the main scene loading. |
.InstantiateGltfResult: Interface
Properties
Name | Type | Description |
---|---|---|
extensions | null | GLTFExtensionsInstance |
root | Object3D |
.InstantiateResult: Interface
Properties
Name | Type | Description |
---|---|---|
root | Object3D |
.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. |
logs | LogLevel[] | Logging level(s) to enable. By default, all levels are enabled. |
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. |
webgpu | boolean | If true , forces the runtime to load the webgpu-compatible version. |
xrFramebufferScaleFactor | number | Default framebuffer scale factor. This can later be changed using xrFramebufferScaleFactor |
xrOfferSession | XROfferSessionOptions | 1.1.5+
Whether to advertise AR/VR session support to the browser. Adds an interactive UI element to the browser interface to start an XR session. Browser support is optional, so it’s advised to still allow requesting a session with a UI element on the website itself. If undefined , no XR session is automatically offered to the browser. |
.MaterialConstructor: Interface
Material constructor.
Material classes are automatically generated by the runtime based on the loaded scene shaders.
Properties
Name | Type | Description |
---|---|---|
constructor | Constructor | |
Parameters | Set<string> | Set of the dynamic parameters that exist on the definition. For instance, the set would contain elements such as ambientColor , diffuseColor for a Phong material. |
.MaterialParameters: Interface
Constructor parameters object for a Material instance.
Deprecated: Use getTemplate instead:
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. |
.NativeComponents: Interface
Native components list
Properties
Name | Type | Description |
---|---|---|
animation | AnimationComponent | |
collision | CollisionComponent | |
input | InputComponent | |
light | LightComponent | |
mesh | MeshComponent | |
physx | PhysXComponent | |
text | TextComponent | |
view | ViewComponent |
.NumberArray: Interface
Represents any object that can be used as an array for read / write.
Properties
Name | Type | Description |
---|---|---|
length | number |
.Options: Interface
Options for the decoder.
Properties
Name | Type | Description |
---|---|---|
dictionary | DictionaryOption | The dictionary type to use. Defaults to object . |
.PropertyCloner: Interface
Cloning interface for component properties.
Used for component initialization and cloning.
Properties
Name | Type | Description |
---|---|---|
clone | Method |
.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. |
dispatchReadyEvent | boolean | If true , dispatches a ready event in the document. |
.UrlLoadOptions: Interface
Options for loading files from a URL.
Properties
Name | Type | Description |
---|---|---|
nocache | boolean | Force to re-download the components bundle, and not use the version from cache. If not set, defaults to false . Note: For now, this setting only affects the main scene loading. |
signal | AbortSignal | Signal to abort the file fetch request. |
streamed | boolean | Whether to load the file as parts of it are fetched. If false , fetches the entire file first before loading. Streamed loading reduces memory usage. If not set, defaults to true . |
url | string | URL to load. |
.XROfferSessionOptions: Interface
1.1.5+Options for xrOfferSession
Properties
Name | Type | Description |
---|---|---|
features | string[] | Required features for the offered XR session |
mode | ‘auto’ | XRSessionMode |
optionalFeatures | string[] | Optional features for the offered XR session |
.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:
1ComponentConstructor<T: extends Component> = (scene: Prefab, manager: number, id: number) ⇒ T & {
2 InheritProperties: boolean;
3 Properties: Record<string, ComponentProperty>;
4 TypeName: string;
5 _isBaseComponent: boolean;
6 _propertyOrder: string[];
7 onRegister: (engine: WonderlandEngine) ⇒ void;
8}
.Constructor: Type Alias
Definition:
1Constructor<T> = (...args: any[][]) ⇒ T
.DictionaryOption: Type Alias
Whether key/value dictionaries should be decoded as objects or as
Map<K, V>
. The latter is useful if non-string keys or iterating in
insertion order are required.
Definition:
1DictionaryOption = 'object' | 'map'
.FirstConstructorParam: Type Alias
Definition:
1FirstConstructorParam<T> = ['undefined']
.GLTFOptions: Type Alias
GLTF-specific loading options.
Definition:
.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
.LoadOptions: Type Alias
Options used during loading.
Definition:
1LoadOptions<Extra> = string | UrlLoadOptions & Partial<Extra>
.ProgressCallback: Type Alias
Definition:
1ProgressCallback = (current: number, total: number) ⇒ 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:
.Tagger: Type Alias
Definition:
1Tagger = (tag: number | bigint, value: any) ⇒ any
.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: