Skip to main content

<pc-module>

The <pc-module> tag is used to load a WebAssembly module.

Usage
  • It must be a direct child of <pc-app>.

Attributes

AttributeTypeDefaultDescription
fallbackString-Path to fallback (asm.js) code when WebAssembly is not supported
glueString-Path to the JavaScript glue code for the module
nameString-Module name used to reference it in scripts
wasmString-Path to the WebAssembly (.wasm) file

The name is case-sensitive — the engine looks the module up by exact name. The modules consumed by the engine are Ammo (physics), Basis (texture transcoding) and DracoDecoderModule (mesh decompression).

Example

<pc-app>
<!-- Load the ammo.js module -->
<pc-module name="Ammo" glue="ammo.wasm.js" wasm="ammo.wasm.wasm" fallback="ammo.js"></pc-module>
</pc-app>

JavaScript Interface

You can programmatically create and manipulate <pc-module> elements using the ModuleElement API.