@iwer/sem v0.2.5
@iwer/sem (Synthetic Environment Module) is an extension for the Immersive Web Emulation Runtime (IWER). It enables advanced Mixed Reality features in IWER by emulating real-world environments with high-fidelity, including video passthrough, plane and mesh detection, semantic labels, and hit testing.
Key Features
- Video Passthrough Emulation: Injects a video passthrough layer, rendering the captured scene behind the emulated app canvas.
- Plane & Mesh Detection: Provides
XRPlaneandXRMeshinformation via theplane-detectionandmesh-detectionAPIs in IWER. - High Fidelity Scene Mesh: Supports emulation of high-fidelity scene meshes exposed on Meta Quest 3 and 3S devices.
- Hit-Test: Enables
hit-testAPIs through IWER by conducting real-time raycasting spatial queries with the loaded environment.
Current Status
@iwer/sem is currently in 0.x status and is under active development. This is an early build, changes may occur before the official v1.0 release.
Installation
To install @iwer/sem, use the following npm command:
npm install @iwer/semUsage
@iwer/sem requires an active IWER runtime. If you are new to IWER, refer to the IWER Getting Started Guide. Here is a quick example:
import { XRDevice, metaQuest3 } from 'iwer';
// Initialize the XR device with a preset configuration (e.g., Meta Quest 3)
const xrDevice = new XRDevice(metaQuest3);
// Install the IWER runtime to enable WebXR emulation
xrDevice.installRuntime();Integrate @iwer/sem:
import { SyntheticEnvironmentModule } from '@iwer/sem';
const sem = new SyntheticEnvironmentModule();
xrDevice.installSyntheticEnvironmentModule(sem);Load an environment using a JSON object:
sem.loadEnvironment(sceneJSON);Or fetch from an external source:
const url = 'path/to/your/scene.json';
fetch(url)
.then((response) => response.json())
.then((data) => {
sem.loadEnvironment(data);
})
.catch((error) => {
console.error('Error loading JSON:', error);
});License
@iwer/sem is licensed under the MIT License. For more details, see the LICENSE file in this repository.
Contributing
Your contributions are welcome! Please feel free to submit issues and pull requests. Before contributing, make sure to review our Contributing Guidelines and Code of Conduct.