Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
XR: avatar orbit lock toggle with amber active state
nirholas3230b38b53d3
diff --git a/pages/xr.html b/pages/xr.htmlindex 90925309b..9a7e1f4de 100644--- a/pages/xr.html+++ b/pages/xr.html@@ -297,6 +297,25 @@.xr-info-card.show { display: block; }.xr-info-card strong { color: var(--text); }+ /* Lock orbit button */+ .xr-lock-btn {+ appearance: none;+ border: 1px solid var(--border);+ background: rgba(255,255,255,0.04);+ color: var(--text-2);+ font: inherit; font-size: 12px; font-weight: 600;+ padding: 7px 14px; border-radius: 999px; cursor: pointer;+ display: inline-flex; align-items: center; gap: 6px;+ transition: background 0.15s, border-color 0.15s, color 0.15s;+ align-self: flex-start;+ }+ .xr-lock-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }+ .xr-lock-btn.xr-lock--active {+ color: #fbbf24;+ border-color: rgba(251,191,36,0.45);+ background: rgba(251,191,36,0.1);+ }+/* ── Tap hint (shown in XR) ── */#xr-tap-hint {position: fixed; left: 50%; bottom: 200px;@@ -381,6 +400,14 @@<button id="xr-body-half" class="xr-toggle-btn half" type="button">Half body</button></div>+ <button id="xr-lock-btn" type="button" class="xr-lock-btn" aria-pressed="false" aria-label="Lock avatar orbit">+ <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <rect x="3" y="11" width="18" height="11" rx="2"/>+ <path d="M7 11V7a5 5 0 0 1 10 0v4"/>+ </svg>+ <span class="xr-lock-label">Lock</span>+ </button>+<div id="xr-half-info" class="xr-info-card"><strong>Half-body mode</strong> — lower-body bones are collapsed to the hip.Ideal for seated VR, desktop AR, and headset experiences where you don't want floating legs.diff --git a/src/xr.js b/src/xr.jsindex 5ee7e5c30..5ce9e1083 100644--- a/src/xr.js+++ b/src/xr.js@@ -42,6 +42,7 @@ const deviceChip = document.getElementById('xr-device-chip');const avatarLabel = document.getElementById('xr-avatar-label');const changeAvatarBtn = document.getElementById('xr-change-avatar');const loadingEl = document.getElementById('xr-loading');+const lockBtn = document.getElementById('xr-lock-btn');function setStatus(msg, type = 'idle') {if (!statusEl) return;@@ -76,6 +77,21 @@ controls.minPolarAngle = 0.2;controls.maxPolarAngle = Math.PI * 0.65;controls.update();+let orbitLocked = false;++function setOrbitLocked(next) {+ orbitLocked = next;+ controls.enabled = !next;+ if (lockBtn) {+ lockBtn.setAttribute('aria-pressed', String(next));+ lockBtn.classList.toggle('xr-lock--active', next);+ lockBtn.querySelector('.xr-lock-label').textContent = next ? 'Locked' : 'Lock';+ }+ setStatus(next ? 'Avatar pinned — orbit disabled' : 'Orbit unlocked', 'idle');+}++if (lockBtn) lockBtn.addEventListener('click', () => setOrbitLocked(!orbitLocked));+// Lightsconst hemi = new HemisphereLight(0xbcd6ff, 0x202830, 0.7);hemi.position.set(0, 5, 0);