Skip to main content

Integrations

XR Blocks is designed to be modular and lightweight. Many features are enabled only when specific optional dependencies are installed in your project. This approach allows you to keep your bundle size small by including only the features you need.

Optional Dependencies

The following table lists the optional dependencies supported by XR Blocks and the features they unlock.

FeatureDependencyDescription
Physics@dimforge/rapier3dEnables physics simulation for 3D objects, including rigid body dynamics, colliders, and gravity. Required for any physics-based interactions.
Generative AI (Gemini)@google/genaiEnables integration with Google's Gemini models, including Multimodal Live API support for real-time audio/video interaction.
Generative AI (OpenAI)openaiEnables integration with OpenAI's models for text generation and chat capabilities.
UI SystemlitUsed for rendering HTML-based UI overlays and the built-in Simulator UI components when running the simulator.
Text Renderingtroika-three-textProvides high-quality, signed-distance-field (SDF) 3D text rendering. Essential for readable and crisp text in 3D space.
Gaussian Splatting@sparkjsdev/sparkEnables viewing of Gaussian Splatting models, allowing for photorealistic scene rendering.

Installing Integrations

To use any of these features, simply add the corresponding packages and their dependencies to your importmap or install them using npm. XR Blocks will automatically detect and utilize these libraries when you use the corresponding components or features.