# Holodeck XR

![Holodeck XR icon](pwa-192x192.png)

**Holodeck XR** is a voice-controlled 3D AI creation space for virtual reality headsets, augmented reality passthrough, and standard web browsers. Speak to the assistant to materialize, modify, move, animate, and save 3D objects right in front of you — synced live across browsers in the same RCWeb virtual room.

![Holodeck XR room view](screenshot.png)

## Features

- **Unified full-scale Holodeck room across VR, AR & Browser:** Both **VR Holodeck** and **Open in Browser** place you inside an iconic 12 m × 12 m × 5 m matte-black Star Trek–style Holodeck room with yellow wireframe walls, floor, ceiling, and rear exit arch. **AR Holodeck** switches to transparent passthrough so life-size 3D creations appear directly inside your real room at 1:1 scale. Position objects anywhere in the visible 3D space—on the floor, near walls, or floating up to the ceiling.
- **Hands-free voice loop (Desktop & Meta Quest 3):** Press **Talk** (or **A** on a VR controller) to dictate your request; while listening, **Talk** becomes **Go** with **Cancel** right beside it (mapped to **A** and **B** on VR controllers). Desktop browsers stream live speech recognition directly, while headsets without browser speech recognition (such as Meta Quest 3 Browser) automatically record microphone audio with a live voice level meter and transcribe it through Gemini 4 Hydrogen when you press **Go**.
- **Spoken assistant replies & 3D spatial object audio:** The assistant responds aloud using browser speech synthesis on desktop and automatically switches to Gemini neural voice playback over Web Audio on headsets without system TTS voices (such as Meta Quest 3). Created 3D objects can emit true 3D positional audio—using built-in ambiences (crackling fire, flowing water, music boxes, humming starships, chimes, birdsong) or bespoke procedural Web Audio synthesis created on the fly—originating directly from each object's location in 3D space as you turn your head, walk around, or move the object, with one-tap **Voice** and **Audio** mute toggles and automatic ducking while you talk.
- **3D spatial pointing:** Click anywhere in the Holodeck room (floor, walls, ceiling, or an existing 3D object) in a browser — or aim your XR controller laser and pull **Trigger** — so the assistant knows the exact 3D position or object you are pointing at when placing or editing items.
- **Save, share, and recreate experiences:** Save your favorite Holodeck creations to browser local storage and reload them instantaneously anytime, try built-in starter presets, or scan the QR code / click **Copy Address** right inside the **Saved** window to invite another headset, phone, or browser into your live room.
- **Physical AI Assistant Avatar:** A friendly brushed silver-white **Holodeck AI** hover-robot wearing a crimson bow tie hovers inside the virtual room with you—maintaining eye contact as you move around, glancing at objects you point at or create, glowing emerald while listening, spinning a golden halo while materializing creations, and speaking and gesturing as it responds. You can also select and move the AI assistant anywhere in the room (horizontal position and hover height), synced across devices in the same room.
- **Live RCWeb room sync & shared avatars:** Open Holodeck XR in the same RCWeb room on multiple devices to share every newly materialized 3D scene in real time and see stylized 3D avatars showing where other participants are positioned, where they are looking, their RCWeb display name (`rcwebName`), and where their hands are (when tracked in VR or AR).

## How to Use

1. Open `/holodeck-xr/` and choose **Enter VR Holodeck**, **Enter AR Holodeck**, or **Open in Browser**. Allow microphone permission when prompted so voice input works smoothly.
2. Press **Talk** (or the **A** button on a VR controller) and describe a 3D object or scene you want to create — for example, *"Create a glowing campfire with two tall pine trees"* or *"Build a spinning solar system"*.
3. Watch your words transcribe in front of you, then press **Go** (or **A**) to materialize the 3D creation, or press **Cancel** (or **B**) to discard it.
4. To place a new item somewhere specific or change an existing item, point at that location or object first and say things like *"Put a wooden cabin right here"* or *"Make this taller and change the color to blue"*.
5. Open **Saved** to save your current Holodeck creation to local storage, reload a previously saved experience, scan the room **QR code**, or click **Copy Address** to share this live Holodeck room.

## Controls

- **VR / AR Controllers:** **A / X** starts **Talk** and confirms **Go**; **B / Y** activates **Cancel** or stops speech; **Trigger** clicks 3D console buttons, selects a 3D object or the **Holodeck AI**, grabs the window frame to move it, or pins your 3D pointer target anywhere in the room; **Grip** grabs and moves whatever you point at—the **3D info window**, any **3D object**, or the **Holodeck AI** assistant—freely anywhere in 3D space (push/pull thumbstick for depth, left/right to rotate objects); **Left Thumbstick** walks in VR; **Right Thumbstick** snap-turns in VR; **Thumbstick Click** recenters the 3D window.
- **Desktop & Browser:** Click any 3D object or the **Holodeck AI** assistant to select it, then drag it anywhere across the room, drag its green **↑ lift handle** (or hold **Shift** while dragging) to adjust height, or use **Arrow keys** (**Shift+Up/Down** for height) to nudge; click the floor, walls, or ceiling to set your 3D point; drag empty space (or right-drag) to orbit around the room; scroll to zoom; press **R** to reset the camera; press **M** to mute spoken replies; press **Escape** to deselect or cancel; click the keyboard icon next to **Talk** if you prefer typing a prompt.
