com.phantomsxr.questmodule
v1.0.4
Published
XRMOD QuestModule is a specialized support module for the Meta Quest space operating system. It enables XRMOD Engine to run smoothly on Meta Quest.
Downloads
327
Readme
XR-MOD Quest Module
Overview
The XR-MOD Quest Module provides dedicated support for Meta Quest devices within the XR-MOD ecosystem. It integrates Meta's OpenXR features—such as Passthrough, Scene Capture, Meshing, and Occlusion—directly into the XR-MOD architecture to enable rich Mixed Reality experiences.
This module is designed to "plug and play": it automatically registers itself when running on a Quest device and manages the lifecycle of Quest-specific features based on your runtime experience configuration.
Key Features
Mixed Reality (Passthrough)
- Seamlessly toggle local context passthrough to blend virtual content with the real world.
- Controls camera background and clear flags automatically.
Scene Understanding & Meshing
- Meshing: Generate physics meshes from the environment for collisions and navigation.
- Scene Capture: Integration with Meta's Scene Capture (Spatial Setup) to let users define their room layout.
- Bounding Boxes: Access and visualize semantic scene data (walls, tables, couches).
Advanced Occlusion
- Support for Environment Depth.
- Dynamic Hand Removal from the depth map.
- Temporal Smoothing for stable occlusion edges.
- Configurable alignment with Human Segmentation.
Input & Interaction
- Smart Switching: Automatically switches visualizers and interactors between Controllers and Hand Tracking based on user activity.
- Locomotion: Integrated support for Teleportation, Continuous Turn, and Joystick Movement.
- Visualizers: Automatic management of controller and hand meshes.
Passthrough Camera Access (Requires Horizon OS v74+)
- Low-level access to passthrough camera frames via
WebCamTexture. - Utilities to query camera intrinsics, poses, and capabilities.
- Low-level access to passthrough camera frames via
Usage & Configuration
The module is driven by the XR-MOD Runtime Experience Config. You do not typically need to write code to enable standard features; instead, you configure them in your project settings or incoming data stream.
Configuration Model (XRConfiguresModel)
The module attempts to resolve XRConfiguresModel from the global RuntimeExperienceConfig. Key properties include:
| Property | Description |
| :--- | :--- |
| UseOcclusion | Master switch to enable/disable occlusion. |
| EnableHandRemoval | If true, hands are masked out of the occlusion buffer (prevents self-occlusion artifacts). |
| TemporalSmoothing | Enables time-based smoothing for depth data. |
| EnvironmentDepthMode | Sets the precision (e.g., Medium, High) of environment depth. |
| CustomMeshVisualizerName | Name of a prefab in your package to use for visualizing the environment mesh. |
Scene Capture
To trigger the Scene Capture (Room Setup) flow on the device, send a notification:
ActionNotificationCenter.DefaultCenter.PostNotification("CaptureEnvironment", null);Architecture
The module follows the Interceptor/Decorator pattern common in XR-MOD:
- Registry:
AutoRegisterModule.csdetects the Quest platform at startup and registersMetaQuestModuleinto the IoC container. - Module:
MetaQuestModuleacts as the controller. It listens for configuration updates and builds/activates specific Feature Decorators. - Decorators: Small, focused classes (e.g.,
MetaQuestMeshingDecorator,MetaQuestLocomotionFeatureDecorator) that wrap specific subsystems (likeARMeshManagerorAROcclusionManager) and manage their lifecycle. - Components Model:
ArchitectureComponentsModelis a singleton that caches references to the specific XR hardware, such as theXRRig,ARCamera, andLocomotionSystem, to ensure features can easily find what they need to manipulate.
API Overview
Core
MetaQuestModule: The main entry point. Manages dependencies and orchestration.XRRuntimeContextDataModel: Holds volatile runtime state, such as AR Session status, frame textures, and recognized markers.
Passthrough Camera (Advanced)
Located in Phantom.XRMOD.QuestModule.Runtime.PassthroughCamera:
PassthroughCameraUtils: Helpers for retrieving camera intrinsics and world poses.WebCamTextureManager: A component to manage the lifecycle of aWebCamTexturefor a specific eye (Left/Right).PassthroughCameraPermissions: Handles the Android permission requests (android.permission.CAMERAandhorizonos.permission.HEADSET_CAMERA).
Pitfalls & Best Practices
- Platform Checks: This module is wrapped in
#if QUEST_INSTALL. Ensure your code calling it also respects platform defines or uses the provided Abstractions/Interfaces to avoid build errors on other platforms. - Permissions: Passthrough Camera access requires explicit user permission. The
PassthroughCameraPermissionsscript handles this, but your app must gracefully handle cases where permission is denied. - OS Version: Raw Passthrough Camera access is only available on Quest devices running Horizon OS v74 or later.
- Occlusion Performance: Enabling High-Res Depth and Temporal Smoothing can be expensive. Profile your application performance when these are enabled.
Dependencies
Phantom.XRMOD.CorePhantom.XRMOD.ActionNotification- Unity
ARFoundation - Unity
OneXR/Meta OpenXR Featuregroup
