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
Coincommunities UI/CSS, cosmetics visual, walk room, world objects, and changelog updates
nirholas1de2851090f0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7de28dcd3..52f6af617 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -15,13 +15,18 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **An inbox for your IRL agents — see who tapped, messaged, or paid, and reply** — Your IRL Agents dashboard now has an Inbox: a live, chronological feed of everyone who met your placed agents in real life. Each entry shows what happened — a view, a tap, a message, or a payment — where it happened, and how long ago. Payments show the exact amount and link straight to the block-explorer receipt, and you can reply to anyone who left your agent a message; if they were signed in, your reply lands in their notifications. Unread counts appear on the Inbox button and on each agent's card, the feed refreshes itself every few seconds, and opening the inbox marks everything read. High-signal events (a payment or a message) also ping you in the notification bell, so you find out the moment a stranger across the city engages your agent. (`/dashboard/irl-placements`) `[feature]`- **Animation Gallery — browse, preview, and remix community animations** — Saved and public animations are now playable anywhere three.ws renders an avatar. The new /animations gallery lists every public clip with live previews (hover a card to see the animation on a real avatar), one-click "Open in Studio" to remix any clip, and an "Animate this avatar" shortcut from the avatar gallery. Any page with an avatar panel now also shows your saved and community animations alongside the built-in library. Share a clip by its id — ?anim=<id> plays it directly in the viewer, the embed, or the Studio editor. (`/animations`) `[feature]`- **Avatars from any tool animate perfectly when uploaded** — Avatars exported from Mixamo, Blender, Unreal Engine, and other tools are now canonicalized at upload time — bone names are normalized and the up-axis convention is baked out — so they animate correctly out of the box with no manual fixup. Previously, Mixamo-rigged avatars needed a runtime correction that could leave limbs in unexpected poses on some clips; now the stored model is already in the canonical form every animation clip expects. (`/avatars`) `[improvement, fix]`+- **Avatars now wear hats, glasses, and earrings in every coin world** — Cosmetic accessories — baseball cap, beanie, cowboy hat, round frames, shades, hoop earrings, stud earrings — are now fully rendered on every avatar in the shared worlds. Each GLB is auto-fitted to the avatar's head bone so accessories track movement and animations on any rig. Wear state syncs in real time: equipping an item shows it on your head for everyone, survives avatar swaps, and persists across sessions. A new setCosmetics network call lets the client broadcast a full loadout in one shot; the server re-validates ownership before publishing, so an unowned item can never appear on a player. (`/play`) `[feature]`+- **Build mode — place, rotate, and delete props in every coin world** — Every /play coin world now has a build mode for free-standing props. Press B (or tap the ⛏ button) to open the prop palette: pick from 12 hand-crafted primitives (crate, barrel, planter, lamp, bench, pillar, arch, ramp, sign, crystal, stage, pole) or browse thousands of community gallery models that stream in as you scroll. A translucent ghost preview snaps to the floor grid under your cursor so you always know exactly where a prop will land — green when the placement is valid, red when it's outside the world radius. Press R to quarter-turn the ghost before committing. Click or tap to place; right-click or hold to remove a prop you placed. Props appear for everyone instantly through the shared object channel and survive server restarts. (`/play`) `[feature]`+- **Build structures, snap blocks, and share your coin world creation** — The /play building layer now ships a full structures system: blocks snap to a 1.5m grid and rotation locks to quarter-turns so pieces always line up. A structures toolbar above the block hotbar gives you one-click composite pieces — Wall (4×3), Floor (4×4), Stairs (4-step), and Doorway — that stamp a whole shape at once with a live rotatable footprint preview. Large builds stay smooth because every block type is drawn as a single instanced mesh regardless of how many you place. The share button captures an offscreen screenshot of your build, lets you name it, copy a deep link, download the image, or publish it to this coin's featured builds — a new per-world gallery (with loading skeleton, empty, and error states) that links every shared creation back into the world so others can drop straight in. (`/play`) `[feature, improvement]`- **Buy a skill, get an on-chain NFT receipt in your wallet** — When you purchase an agent's skill, you now receive a real NFT minted straight to your Solana wallet as proof of ownership and a perpetual license to use that skill. Each agent has its own verified on-chain collection, so the skills you buy from an agent group together in your wallet and on explorers like Solscan and Phantom — with the agent's name and avatar. The NFT is minted only after your payment is confirmed on-chain to the creator, it's tied to the wallet linked to your account so it can never be sent to a stranger, and asking again never mints a duplicate. Your purchased skills now show their NFT mint address. (`/marketplace`) `[feature]`- **Change a placed agent's outfit from your dashboard — everyone nearby sees it** — Your IRL Agents dashboard now has a real outfit editor. Open Change outfit on any agent you've placed and a live 3D preview loads with wardrobe controls for the exact layers that avatar has — recolour its hair, skin, and clothing, strip back to the base body and dress it up again, or stack on hats, glasses, and earrings. Because your agents are public, the new look is baked into the agent itself and pushed to its real-world pin, so every person who walks up to that spot sees the updated outfit in their camera — not just you. Save when you're happy; the avatar is re-rendered for real before it confirms, the previous look stays untouched if anything fails, and nearby viewers refresh to the new outfit within seconds. Run a seasonal look, brand your agents as staff for an event, or just keep them fresh — all without walking back to where you pinned them. (`/dashboard/irl-placements`) `[feature]`- **Clearer pricing on every agent's skills in the marketplace** — An agent's detail page now reads cleanly when its skills carry a price. Each skill shows a badge at a glance — green 'Free', a yellow price for paid skills, or an indigo 'Owned' once you've bought it — and when a paid skill offers a free trial or a timed access pass, those now appear as proper buttons styled to match the Purchase button, with hover, focus, and press states. The price badge and action buttons are grouped together on the right of each row instead of spreading out, so a skill with several options stays tidy and easy to scan. (`/marketplace`) `[improvement]`+- **Coin world builds now have ownership, caps, and anti-grief protection** — Every block and prop placed in a coin world is now server-enforced with a full permission model. Only the player who placed a piece can break it; the coin's creator can remove any piece as a moderation tool, or sweep a radius or the entire world with a single action. A per-player block cap (1,200 blocks) prevents any single builder from monopolising the budget; a per-column density limit stops walls from caging the plaza; and protected zones around the spawn point and the coin totem can never be buried or fenced in. All rejections — wrong owner, over cap, protected zone, rate-limited, out of bounds — are surfaced to the builder immediately with a clear message. The build HUD now shows how many of your personal 1,200 blocks you've used, and coin creators see a "Creator" moderation panel with the clear-area tool. (`/play`) `[feature, improvement]`- **Connect your Solana wallet right from the app header** — The main app now has a Connect Wallet button in the top bar — the first step toward buying an agent's paid skills. Click it and your Solana wallet (Phantom, or the built-in wallet on Solana Mobile / Seeker) prompts you to connect; once you do, the button shows your address shortened to something like '7xKq…9fPa' with a green tick so you can see at a glance that you're connected. If you've connected before, it reconnects silently on load, and if you don't have a wallet yet it points you to Phantom. No wallet, no signature, and nothing on-chain happens just from connecting — it only lets the platform know which wallet to use when you choose to pay. (`/app`) `[feature]`- **Connect your Solana wallet right from the marketplace** — The marketplace now carries a persistent Connect Wallet control — in the sidebar on desktop, in the search bar on mobile — so you can link Phantom, Solflare, or Backpack once and arrive at any purchase already connected, instead of waiting until checkout. If you have more than one wallet installed you get a quick picker; if you have none, it points you to install one. Once connected it shows your address as a tidy pill with a menu to copy it, view the account on Solscan, or disconnect, and it quietly reconnects a previously approved wallet when you return — no extra pop-up. Connect from the header and the Buy dialog is ready to go; connect at checkout and the header updates too. It rides the same on-chain USDC purchase flow already in place, so there's nothing new to trust. (`/marketplace`) `[feature]`- **Drop in <agent-3d> and you get just the avatar — chat is now opt-in** — The one-line embed is cleaner by default. A plain <agent-3d> tag now ships only the 3D avatar on a transparent background — no chat box, no input bar, no debug color picker, no name-plate. That makes it perfect for dropping a living avatar onto a landing page, hero section, or card without any extra UI to hide. When you want the full talking agent, add the new chat attribute: <agent-3d chat body="...">. Published agents you embed by agent-id, manifest, or an agent:// link still chat automatically — they carry their own brain and persona — so existing agent embeds are unchanged. The reference docs and examples were updated to match. (`/docs/web-component`) `[feature, sdk]`- **Embedded avatars: polished loading, seamless looping, and smarter framing** — The live 3D avatars dotted around the site — the ones in the home-page feature cards and anywhere an <agent-3d> embed appears — now feel intentional from the first frame. Each one fades in behind a soft skeleton placeholder while its model streams, instead of popping in cold. Animations no longer hard-snap: a one-shot gesture like a wave plays once and settles smoothly back into an idle stance rather than jumping at the loop boundary. A new framing option crops the avatar to head-to-mid-thigh so it fills its card instead of standing tiny and low. If a body ever fails to load, you get a tasteful silhouette rather than a blank or broken box. Avatars pause themselves when scrolled off-screen to save battery, and anyone who's asked their device to reduce motion gets a calm, held pose instead of looping animation. (`/embed`) `[improvement]`+- **Emoji reactions now float above avatars in every coin world** — Tap any of the 6 reaction buttons (🎉 😂 🔥 ❤️ 👏 🤔) to broadcast a floating emoji that rises above your avatar for everyone in the room to see. The 🎉 reaction also triggers a small confetti burst. Reactions are server-rate-limited so the world stays readable when multiple people react at once; the button dims briefly after each tap to signal that the next one is queued. Keyboard- and screen-reader-accessible; works on touch and desktop. (`/play`) `[feature]`- **Every agent now has a dedicated wallet hub** — Each 3D agent's self-custodied Solana wallet now has one home: a tabbed Agent Wallet hub — Balance, Deposit, Trade, Snipe, Pay, and Withdraw — reachable from the agent's profile and right after you create one. The Balance tab is live now, showing the real on-chain SOL balance with a USD estimate and recent activity, refreshing on its own and degrading gracefully if the network is briefly unreachable. Behind the scenes every agent is guaranteed a wallet: older agents that predated automatic wallets are backfilled, and the agent API now reports whether each agent's wallet is ready. The remaining tabs are wired up across the next releases. `[feature]`- **Everyone at a location now sees your IRL agent in the same real spot** — three.ws/irl agents now line up across phones. A placed agent renders from its own saved compass bearing and ground height instead of whichever way your phone happens to face, so two people standing in the same place see it standing in the same place, facing the same way. To keep it steady, your own GPS position is now smoothed so anchored agents stop drifting and swimming as your location jitters, and noisy fixes are ignored. Every agent now sits inside a ground ring whose size reflects the real GPS accuracy — honest about the fact that phone GPS is roughly 5–15 metres, and wider (and amber) when the signal is poor — so it never pretends to be pinpoint-perfect. And if an agent landed a little off, its owner can fine-tune it: long-press your own agent (or tap Calibrate position on its card) and drag to nudge it a few centimetres, twist with two fingers to rotate it, or step its floor height up and down. Saving the nudge updates the spot for everyone nearby. Only the owner can calibrate an agent, nudges are capped to small corrections so this can never be used to drag someone's agent across the map, and a failed save keeps your change on screen with a one-tap retry. (`/irl`) `[feature, improvement]`- **Filter the marketplace by Free or Paid** — The marketplace now has working Free / Paid filters. "Paid" surfaces every agent that charges in any way — a one-time price to own it or per-call pricing on its skills — and "Free" shows the rest. Filtering happens on the server, so the result count and "load more" stay accurate no matter how many pages deep you browse, and your choice is saved in the URL so you can bookmark or share a filtered view. (`/marketplace`) `[feature, improvement]`diff --git a/data/changelog.json b/data/changelog.jsonindex 713d26202..32297772e 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,41 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-06-17",+ "title": "Rarest Fits button styled in the cosmetics shop",+ "summary": "The "Rarest Fits" leaderboard button in the shop header now has full hover, active, and focus states matching the rest of the shop chrome, and collapses to a glyph-only button on mobile so the header doesn't overflow.",+ "tags": ["improvement"],+ "link": "/play"+ },+ {+ "date": "2026-06-17",+ "title": "Build structures, snap blocks, and share your coin world creation",+ "summary": "The /play building layer now ships a full structures system: blocks snap to a 1.5m grid and rotation locks to quarter-turns so pieces always line up. A structures toolbar above the block hotbar gives you one-click composite pieces — Wall (4×3), Floor (4×4), Stairs (4-step), and Doorway — that stamp a whole shape at once with a live rotatable footprint preview. Large builds stay smooth because every block type is drawn as a single instanced mesh regardless of how many you place. The share button captures an offscreen screenshot of your build, lets you name it, copy a deep link, download the image, or publish it to this coin's featured builds — a new per-world gallery (with loading skeleton, empty, and error states) that links every shared creation back into the world so others can drop straight in.",+ "tags": ["feature", "improvement"],+ "link": "/play"+ },+ {+ "date": "2026-06-17",+ "title": "Avatars now wear hats, glasses, and earrings in every coin world",+ "summary": "Cosmetic accessories — baseball cap, beanie, cowboy hat, round frames, shades, hoop earrings, stud earrings — are now fully rendered on every avatar in the shared worlds. Each GLB is auto-fitted to the avatar's head bone so accessories track movement and animations on any rig. Wear state syncs in real time: equipping an item shows it on your head for everyone, survives avatar swaps, and persists across sessions. A new setCosmetics network call lets the client broadcast a full loadout in one shot; the server re-validates ownership before publishing, so an unowned item can never appear on a player.",+ "tags": ["feature"],+ "link": "/play"+ },+ {+ "date": "2026-06-17",+ "title": "Emoji reactions now float above avatars in every coin world",+ "summary": "Tap any of the 6 reaction buttons (🎉 😂 🔥 ❤️ 👏 🤔) to broadcast a floating emoji that rises above your avatar for everyone in the room to see. The 🎉 reaction also triggers a small confetti burst. Reactions are server-rate-limited so the world stays readable when multiple people react at once; the button dims briefly after each tap to signal that the next one is queued. Keyboard- and screen-reader-accessible; works on touch and desktop.",+ "tags": ["feature"],+ "link": "/play"+ },+ {+ "date": "2026-06-17",+ "title": "Build mode — place, rotate, and delete props in every coin world",+ "summary": "Every /play coin world now has a build mode for free-standing props. Press B (or tap the ⛏ button) to open the prop palette: pick from 12 hand-crafted primitives (crate, barrel, planter, lamp, bench, pillar, arch, ramp, sign, crystal, stage, pole) or browse thousands of community gallery models that stream in as you scroll. A translucent ghost preview snaps to the floor grid under your cursor so you always know exactly where a prop will land — green when the placement is valid, red when it's outside the world radius. Press R to quarter-turn the ghost before committing. Click or tap to place; right-click or hold to remove a prop you placed. Props appear for everyone instantly through the shared object channel and survive server restarts.",+ "tags": ["feature"],+ "link": "/play"+ },{"date": "2026-06-17","title": "Coin world builds now have ownership, caps, and anti-grief protection",diff --git a/multiplayer/src/rooms/WalkRoom.js b/multiplayer/src/rooms/WalkRoom.jsindex b873c72fb..89833ae06 100644--- a/multiplayer/src/rooms/WalkRoom.js+++ b/multiplayer/src/rooms/WalkRoom.js@@ -30,7 +30,7 @@ import {HOTBAR_SIZE,} from '../economy.js';import {- serializeLoadout, getCosmetic, canWear,+ serializeLoadout, getCosmetic, canWear, DEFAULT_LOADOUT,} from '../cosmetics-catalog.js';import {itemLabel, fishCatchChance, fishDoubleChance,@@ -130,6 +130,38 @@ const BALL_SETTLE_SPEED = 0.08; // m/s — below this horizontal speed, zero iconst MAX_BATCH_CELLS = 32;const BATCHES_PER_SEC_LIMIT = 4;+// ── R05: server-authoritative beach ball physics ──────────────────────────────+// One ball per room, kind:'ball', ownerId:'server'. Clients send 'ball:kick' with+// an impulse vector; the server validates + caps it, then integrates position each+// physics tick and streams updates through the objects map via the schema delta.+//+// ball:kick { vx, vy, vz }+// Any joined player, BALL_KICKS_PER_SEC rate limit. The server caps impulse+// magnitude and ensures a minimum upward component, then adds it to the+// authoritative velocity. Ball id is fixed (BALL_ID) — one per room.+//+// Velocity kept in _ballVx/y/z server vars, written to the WorldObject schema+// each tick. A settled ball (speed < BALL_IDLE_SPEED_SQ on ground) skips+// integration to avoid micro-drift and unnecessary Colyseus patches.+const BALL_ID = 'ball_0';+const BALL_RADIUS = 0.5;+const BALL_TICK_MS = 1000 / 20; // 20 Hz physics+const BALL_GRAVITY = 9.8;+const BALL_BOUNCE = 0.55; // vertical energy retained on ground bounce+const BALL_WALL_BOUNCE = 0.80; // energy retained on world-edge bounce+const BALL_ROLLING_FRICTION = 2.0; // per-second horizontal speed decay on ground+const BALL_AIR_DRAG = 0.12; // per-second speed decay while airborne+const BALL_MAX_IMPULSE = 12; // m/s — cap on a single client kick+const BALL_POST_KICK_CAP = 18; // m/s — absolute total velocity cap post-kick+const BALL_MIN_UPY = 0.8; // minimum upward component on any kick+const BALL_WORLD_RADIUS = 54; // keep inside the visible arena+const BALL_SPAWN_X = 0;+const BALL_SPAWN_Y = BALL_RADIUS;+const BALL_SPAWN_Z = 5;+const BALL_OOB_Y = -10; // respawn below this y+const BALL_IDLE_SPEED_SQ = 0.04; // (m/s)^2 — skip integration when settled+const BALL_KICKS_PER_SEC = 3;+// --- Build permissions & anti-grief (R19) ---------------------------------// The per-world MAX_BLOCKS budget above protects the room; these caps protect it// from a SINGLE builder. A per-player ceiling stops one user consuming the whole@@ -425,6 +457,9 @@ export class WalkRoom extends Room {// validates ownership, persists the loadout to the account, re-publishes it on// the schema so peers re-render, and echoes the owner a fresh profile.this.onMessage('equip-cosmetic', (client, payload) => this._handleEquipCosmetic(client, payload));+ // Full-loadout broadcast (R03): replaces the player's entire equipped state in+ // one shot, re-validated against ownership — mirrors how `avatar` is sent.+ this.onMessage('set-cosmetics', (client, payload) => this._handleSetCosmetics(client, payload));this.onMessage('profileReq', (client) => this._sendProfile(client));// Quests, jobs & heists (W05, off-schema). The board, accepting/abandoning a// mission, and acting at a quest object all flow through here; the server is the@@ -1024,6 +1059,28 @@ export class WalkRoom extends Room {this._persistEcon(client.sessionId);}+ // Replace the player's entire equipped loadout in one shot (R03). The wire+ // is re-validated against the catalog and account ownership before applying —+ // any unknown id, any id in the wrong slot, and any unowned premium id are+ // silently dropped to the slot default. This is the full-loadout counterpart to+ // equip-cosmetic (which changes one slot); the schema update and persist follow+ // the same path so peers always re-render the authoritative look.+ _handleSetCosmetics(client, payload) {+ const profile = this.econ.get(client.sessionId);+ if (!profile) return;+ if (!this._actionOk(client.sessionId, 'equip')) return;+ const wire = typeof payload?.cosmetics === 'string' ? payload.cosmetics.slice(0, 256) : '';+ if (!profile.cosmetics) profile.cosmetics = { owned: [], equipped: {} };+ // Reset every slot to its bare default, then merge the requested ids.+ // Ownership is re-checked per id so a tampered wire can never put an+ // unowned cosmetic on a player.+ profile.cosmetics.equipped = { ...DEFAULT_LOADOUT };+ this._applyJoinCosmetics(profile, wire);+ const player = this.state.players.get(client.sessionId);+ if (player) player.cosmetics = serializeLoadout(profile.cosmetics.equipped);+ this._persistEcon(client.sessionId);+ }+// Select a hotbar slot (what the player is "holding"). -1 clears the hand._handleEquip(client, payload) {const profile = this.econ.get(client.sessionId);@@ -1503,6 +1560,7 @@ export class WalkRoom extends Room {if (wasPersistent) this._persistObjects();}+// Per-client token bucket for obj:* ops, mirroring the edit limiter._objOk(sessionId) {const now = Date.now();@@ -1771,4 +1829,150 @@ export class WalkRoom extends Room {bucket.count++;return bucket.count <= MOVES_PER_SEC_LIMIT;}++ // ── R05: beach ball physics ──────────────────────────────────────────────────++ // Spawn (or reset) the room's single server-owned ball at world centre.+ // Called on room create and on respawn (out-of-bounds or fallen through floor).+ _spawnBall() {+ const existing = this.state.objects.get(BALL_ID);+ if (existing) {+ existing.x = BALL_SPAWN_X; existing.y = BALL_SPAWN_Y; existing.z = BALL_SPAWN_Z;+ existing.vx = 0; existing.vy = 0; existing.vz = 0;+ existing.ts = Date.now();+ } else {+ const ball = new WorldObject();+ ball.id = BALL_ID;+ ball.kind = 'ball';+ ball.type = 'beach';+ ball.ownerId = SERVER_OBJECT_OWNER;+ ball.x = BALL_SPAWN_X; ball.y = BALL_SPAWN_Y; ball.z = BALL_SPAWN_Z;+ ball.vx = 0; ball.vy = 0; ball.vz = 0;+ ball.yaw = 0; ball.scale = 1;+ ball.ts = Date.now();+ this.state.objects.set(BALL_ID, ball);+ }+ this._ballVx = 0; this._ballVy = 0; this._ballVz = 0;+ }++ // Physics tick at 20 Hz. Integrates gravity, rolling friction, ground bounce,+ // and world-edge reflection. Writes position+velocity into the schema so+ // Colyseus broadcasts only the delta. Settled balls skip integration.+ _tickBall() {+ const ball = this.state.objects.get(BALL_ID);+ if (!ball) { this._spawnBall(); return; }++ // Respawn if out of bounds+ const rSq = ball.x * ball.x + ball.z * ball.z;+ if (ball.y < BALL_OOB_Y || rSq > (BALL_WORLD_RADIUS + 6) * (BALL_WORLD_RADIUS + 6)) {+ console.log(`[walk_world ${this.roomId}] ball out of bounds — respawning`);+ this._spawnBall();+ return;+ }++ // Skip integration when settled on the ground+ const speedSq = this._ballVx * this._ballVx + this._ballVy * this._ballVy + this._ballVz * this._ballVz;+ const onGround = ball.y <= BALL_RADIUS + 0.02;+ if (speedSq < BALL_IDLE_SPEED_SQ && onGround) return;++ const dt = BALL_TICK_MS / 1000;++ // Gravity+ this._ballVy -= BALL_GRAVITY * dt;++ // Drag / rolling friction+ if (onGround) {+ const fric = 1 - BALL_ROLLING_FRICTION * dt;+ this._ballVx *= fric;+ this._ballVz *= fric;+ } else {+ const drag = 1 - BALL_AIR_DRAG * dt;+ this._ballVx *= drag;+ this._ballVz *= drag;+ }++ // Integrate position+ ball.x += this._ballVx * dt;+ ball.y += this._ballVy * dt;+ ball.z += this._ballVz * dt;++ // Ground bounce+ if (ball.y < BALL_RADIUS) {+ ball.y = BALL_RADIUS;+ if (this._ballVy < 0) {+ this._ballVy = -this._ballVy * BALL_BOUNCE;+ // Kill micro-bounces so the ball settles cleanly+ if (Math.abs(this._ballVy) < 0.3) this._ballVy = 0;+ }+ }++ // World-edge reflection (radial normal bounce)+ const r = Math.sqrt(rSq);+ if (r > BALL_WORLD_RADIUS) {+ const k = BALL_WORLD_RADIUS / r;+ ball.x *= k; ball.z *= k;+ const nx = ball.x / BALL_WORLD_RADIUS;+ const nz = ball.z / BALL_WORLD_RADIUS;+ const dot = this._ballVx * nx + this._ballVz * nz;+ if (dot > 0) {+ this._ballVx = (this._ballVx - 2 * dot * nx) * BALL_WALL_BOUNCE;+ this._ballVz = (this._ballVz - 2 * dot * nz) * BALL_WALL_BOUNCE;+ }+ }++ // Write velocity into schema so clients can extrapolate between updates+ ball.vx = this._ballVx;+ ball.vy = this._ballVy;+ ball.vz = this._ballVz;+ ball.ts = Date.now();+ }++ // Handle a kick intent from a client. Server validates and caps the impulse,+ // then applies it to the authoritative ball velocity. Never trusts the client's+ // raw values — only direction + a capped magnitude survive.+ _handleBallKick(client, payload) {+ if (!this.state.players.has(client.sessionId)) return;+ if (!this._kickOk(client.sessionId)) return;+ if (!payload || typeof payload !== 'object') return;+ const ball = this.state.objects.get(BALL_ID);+ if (!ball) return;++ let { vx, vy, vz } = payload;+ if (!Number.isFinite(vx) || !Number.isFinite(vy) || !Number.isFinite(vz)) return;++ // Cap impulse magnitude+ const mag = Math.hypot(vx, vy, vz);+ if (mag > BALL_MAX_IMPULSE) {+ const k = BALL_MAX_IMPULSE / mag;+ vx *= k; vy *= k; vz *= k;+ } else if (mag < 0.1) {+ return; // reject zero-length impulse+ }++ // Ensure a meaningful upward component so the ball always lifts off the ground+ if (vy < BALL_MIN_UPY) vy = BALL_MIN_UPY;++ this._ballVx += vx;+ this._ballVy += vy;+ this._ballVz += vz;++ // Absolute cap on total velocity post-kick to prevent launch exploits+ const totalMag = Math.hypot(this._ballVx, this._ballVy, this._ballVz);+ if (totalMag > BALL_POST_KICK_CAP) {+ const k = BALL_POST_KICK_CAP / totalMag;+ this._ballVx *= k; this._ballVy *= k; this._ballVz *= k;+ }+ }++ // Per-client sliding-window rate limit for ball:kick messages.+ _kickOk(sessionId) {+ const now = Date.now();+ let bucket = this._kickCounters.get(sessionId);+ if (!bucket || now - bucket.windowStart > 1000) {+ bucket = { windowStart: now, count: 0 };+ this._kickCounters.set(sessionId, bucket);+ }+ bucket.count++;+ return bucket.count <= BALL_KICKS_PER_SEC;+ }}diff --git a/public/changelog.json b/public/changelog.jsonindex 1069c424e..6b6b1d69a 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-17T19:15:52.703Z",+ "generated_at": "2026-06-17T19:20:15.166Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -98,6 +98,37 @@"fix"]},+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Avatars now wear hats, glasses, and earrings in every coin world",+ "summary": "Cosmetic accessories — baseball cap, beanie, cowboy hat, round frames, shades, hoop earrings, stud earrings — are now fully rendered on every avatar in the shared worlds. Each GLB is auto-fitted to the avatar's head bone so accessories track movement and animations on any rig. Wear state syncs in real time: equipping an item shows it on your head for everyone, survives avatar swaps, and persists across sessions. A new setCosmetics network call lets the client broadcast a full loadout in one shot; the server re-validates ownership before publishing, so an unowned item can never appear on a player.",+ "link": "/play",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Build mode — place, rotate, and delete props in every coin world",+ "summary": "Every /play coin world now has a build mode for free-standing props. Press B (or tap the ⛏ button) to open the prop palette: pick from 12 hand-crafted primitives (crate, barrel, planter, lamp, bench, pillar, arch, ramp, sign, crystal, stage, pole) or browse thousands of community gallery models that stream in as you scroll. A translucent ghost preview snaps to the floor grid under your cursor so you always know exactly where a prop will land — green when the placement is valid, red when it's outside the world radius. Press R to quarter-turn the ghost before committing. Click or tap to place; right-click or hold to remove a prop you placed. Props appear for everyone instantly through the shared object channel and survive server restarts.",+ "link": "/play",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Build structures, snap blocks, and share your coin world creation",+ "summary": "The /play building layer now ships a full structures system: blocks snap to a 1.5m grid and rotation locks to quarter-turns so pieces always line up. A structures toolbar above the block hotbar gives you one-click composite pieces — Wall (4×3), Floor (4×4), Stairs (4-step), and Doorway — that stamp a whole shape at once with a live rotatable footprint preview. Large builds stay smooth because every block type is drawn as a single instanced mesh regardless of how many you place. The share button captures an offscreen screenshot of your build, lets you name it, copy a deep link, download the image, or publish it to this coin's featured builds — a new per-world gallery (with loading skeleton, empty, and error states) that links every shared creation back into the world so others can drop straight in.",+ "link": "/play",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-06-17","type": "update",@@ -128,6 +159,17 @@"improvement"]},+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Coin world builds now have ownership, caps, and anti-grief protection",+ "summary": "Every block and prop placed in a coin world is now server-enforced with a full permission model. Only the player who placed a piece can break it; the coin's creator can remove any piece as a moderation tool, or sweep a radius or the entire world with a single action. A per-player block cap (1,200 blocks) prevents any single builder from monopolising the budget; a per-column density limit stops walls from caging the plaza; and protected zones around the spawn point and the coin totem can never be buried or fenced in. All rejections — wrong owner, over cap, protected zone, rate-limited, out of bounds — are surfaced to the builder immediately with a clear message. The build HUD now shows how many of your personal 1,200 blocks you've used, and coin creators see a \"Creator\" moderation panel with the clear-area tool.",+ "link": "/play",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-06-17","type": "update",@@ -169,6 +211,16 @@"improvement"]},+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Emoji reactions now float above avatars in every coin world",+ "summary": "Tap any of the 6 reaction buttons (🎉 😂 🔥 ❤️ 👏 🤔) to broadcast a floating emoji that rises above your avatar for everyone in the room to see. The 🎉 reaction also triggers a small confetti burst. Reactions are server-rate-limited so the world stays readable when multiple people react at once; the button dims briefly after each tap to signal that the next one is queued. Keyboard- and screen-reader-accessible; works on touch and desktop.",+ "link": "/play",+ "tags": [+ "feature"+ ]+ },{"date": "2026-06-17","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 0dc950128..ff0af971e 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -78,6 +78,30 @@<category>improvement</category><description>Avatars exported from Mixamo, Blender, Unreal Engine, and other tools are now canonicalized at upload time — bone names are normalized and the up-axis convention is baked out — so they animate correctly out of the box with no manual fixup. Previously, Mixamo-rigged avatars needed a runtime correction that could leave limbs in unexpected poses on some clips; now the stored model is already in the canonical form every animation clip expects.</description></item>+ <item>+ <title>Avatars now wear hats, glasses, and earrings in every coin world</title>+ <link>https://three.ws/play</link>+ <guid isPermaLink="false">2026-06-17:Avatars now wear hats, glasses, and earrings in every coin world</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Cosmetic accessories — baseball cap, beanie, cowboy hat, round frames, shades, hoop earrings, stud earrings — are now fully rendered on every avatar in the shared worlds. Each GLB is auto-fitted to the avatar's head bone so accessories track movement and animations on any rig. Wear state syncs in real time: equipping an item shows it on your head for everyone, survives avatar swaps, and persists across sessions. A new setCosmetics network call lets the client broadcast a full loadout in one shot; the server re-validates ownership before publishing, so an unowned item can never appear on a player.</description>+ </item>+ <item>+ <title>Build mode — place, rotate, and delete props in every coin world</title>+ <link>https://three.ws/play</link>+ <guid isPermaLink="false">2026-06-17:Build mode — place, rotate, and delete props in every coin world</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Every /play coin world now has a build mode for free-standing props. Press B (or tap the ⛏ button) to open the prop palette: pick from 12 hand-crafted primitives (crate, barrel, planter, lamp, bench, pillar, arch, ramp, sign, crystal, stage, pole) or browse thousands of community gallery models that stream in as you scroll. A translucent ghost preview snaps to the floor grid under your cursor so you always know exactly where a prop will land — green when the placement is valid, red when it's outside the world radius. Press R to quarter-turn the ghost before committing. Click or tap to place; right-click or hold to remove a prop you placed. Props appear for everyone instantly through the shared object channel and survive server restarts.</description>+ </item>+ <item>+ <title>Build structures, snap blocks, and share your coin world creation</title>+ <link>https://three.ws/play</link>+ <guid isPermaLink="false">2026-06-17:Build structures, snap blocks, and share your coin world creation</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The /play building layer now ships a full structures system: blocks snap to a 1.5m grid and rotation locks to quarter-turns so pieces always line up. A structures toolbar above the block hotbar gives you one-click composite pieces — Wall (4×3), Floor (4×4), Stairs (4-step), and Doorway — that stamp a whole shape at once with a live rotatable footprint preview. Large builds stay smooth because every block type is drawn as a single instanced mesh regardless of how many you place. The share button captures an offscreen screenshot of your build, lets you name it, copy a deep link, download the image, or publish it to this coin's featured builds — a new per-world gallery (with loading skeleton, empty, and error states) that links every shared creation back into the world so others can drop straight in.</description>+ </item><item><title>Buy a skill, get an on-chain NFT receipt in your wallet</title><link>https://three.ws/marketplace</link>@@ -102,6 +126,14 @@<category>improvement</category><description>An agent's detail page now reads cleanly when its skills carry a price. Each skill shows a badge at a glance — green 'Free', a yellow price for paid skills, or an indigo 'Owned' once you've bought it — and when a paid skill offers a free trial or a timed access pass, those now appear as proper buttons styled to match the Purchase button, with hover, focus, and press states. The price badge and action buttons are grouped together on the right of each row instead of spreading out, so a skill with several options stays tidy and easy to scan.</description></item>+ <item>+ <title>Coin world builds now have ownership, caps, and anti-grief protection</title>+ <link>https://three.ws/play</link>+ <guid isPermaLink="false">2026-06-17:Coin world builds now have ownership, caps, and anti-grief protection</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Every block and prop placed in a coin world is now server-enforced with a full permission model. Only the player who placed a piece can break it; the coin's creator can remove any piece as a moderation tool, or sweep a radius or the entire world with a single action. A per-player block cap (1,200 blocks) prevents any single builder from monopolising the budget; a per-column density limit stops walls from caging the plaza; and protected zones around the spawn point and the coin totem can never be buried or fenced in. All rejections — wrong owner, over cap, protected zone, rate-limited, out of bounds — are surfaced to the builder immediately with a clear message. The build HUD now shows how many of your personal 1,200 blocks you've used, and coin creators see a "Creator" moderation panel with the clear-area tool.</description>+ </item><item><title>Connect your Solana wallet right from the app header</title><link>https://three.ws/app</link>@@ -134,6 +166,14 @@<category>improvement</category><description>The live 3D avatars dotted around the site — the ones in the home-page feature cards and anywhere an <agent-3d> embed appears — now feel intentional from the first frame. Each one fades in behind a soft skeleton placeholder while its model streams, instead of popping in cold. Animations no longer hard-snap: a one-shot gesture like a wave plays once and settles smoothly back into an idle stance rather than jumping at the loop boundary. A new framing option crops the avatar to head-to-mid-thigh so it fills its card instead of standing tiny and low. If a body ever fails to load, you get a tasteful silhouette rather than a blank or broken box. Avatars pause themselves when scrolled off-screen to save battery, and anyone who's asked their device to reduce motion gets a calm, held pose instead of looping animation.</description></item>+ <item>+ <title>Emoji reactions now float above avatars in every coin world</title>+ <link>https://three.ws/play</link>+ <guid isPermaLink="false">2026-06-17:Emoji reactions now float above avatars in every coin world</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Tap any of the 6 reaction buttons (🎉 😂 🔥 ❤️ 👏 🤔) to broadcast a floating emoji that rises above your avatar for everyone in the room to see. The 🎉 reaction also triggers a small confetti burst. Reactions are server-rate-limited so the world stays readable when multiple people react at once; the button dims briefly after each tap to signal that the next one is queued. Keyboard- and screen-reader-accessible; works on touch and desktop.</description>+ </item><item><title>Every agent now has a dedicated wallet hub</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex cb740192f..679e1b1b1 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-17T19:15:52.621Z",+ "generated_at": "2026-06-17T19:20:15.127Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/game/coincommunities-ui.js b/src/game/coincommunities-ui.jsindex f236d9c10..90197cc52 100644--- a/src/game/coincommunities-ui.js+++ b/src/game/coincommunities-ui.js@@ -1182,12 +1182,23 @@ export class CommunityUI {this.voiceLabel,]);+ // Dance floor button — hidden until the player steps onto the pad.+ this.danceBtnLabel = el('span', { class: 'cc-dance-label', text: 'Dance' });+ this.danceBtn = el('button', {+ class: 'cc-dance-btn', type: 'button', hidden: true,+ 'aria-label': 'Dance on the floor', title: 'Sync-dance with everyone on the floor',+ onclick: () => this.h.onDance?.(),+ }, [+ el('span', { class: 'cc-dance-ico', 'aria-hidden': 'true', text: '🪩' }),+ this.danceBtnLabel,+ ]);+const hint = el('div', { id: 'cc-hint', html:'<kbd>W A S D</kbd> / drag-joystick to move · <kbd>drag</kbd> to look · scroll zoom · <kbd>Enter</kbd> chat' });this.joystick = el('div', { id: 'cc-joystick' });- this.hud = el('div', { id: 'cc-hud', hidden: true }, [banner, leave, this.statusPill, this.voiceBtn, chat, this.emoteTray, this.reactionBar, hint, this.joystick]);+ this.hud = el('div', { id: 'cc-hud', hidden: true }, [banner, leave, this.statusPill, this.voiceBtn, this.danceBtn, chat, this.emoteTray, this.reactionBar, hint, this.joystick]);document.body.appendChild(this.hud);}@@ -1568,7 +1579,6 @@ export class CommunityUI {}closeFeatured() {- this._featuredOpen = false;if (this._featuredKeydown) { document.removeEventListener('keydown', this._featuredKeydown); this._featuredKeydown = null; }if (this.featuredPanel) { this.featuredPanel.remove(); this.featuredPanel = null; }this.h.onFeaturedClosed?.();diff --git a/src/game/coincommunities.css b/src/game/coincommunities.cssindex 8bd622ece..769aff19a 100644--- a/src/game/coincommunities.css+++ b/src/game/coincommunities.css@@ -851,6 +851,54 @@ html, body {transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease, filter 0.15s ease;}.cc-emote:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--cc-edge); transform: translateY(-3px); filter: grayscale(0); }+.cc-emote:active { transform: translateY(-1px) scale(0.9); }+.cc-emote:focus-visible { outline: 1px solid var(--cc-accent); outline-offset: 2px; }++/* reaction bar (R04) — sits just above the emote tray */+#cc-reactions {+ position: fixed; left: 50%; bottom: 82px; transform: translateX(-50%); z-index: 22;+ display: flex; gap: 4px; background: var(--cc-panel); border: 1px solid var(--cc-edge);+ border-radius: var(--cc-radius); padding: 5px 6px; box-shadow: var(--cc-shadow); backdrop-filter: blur(10px);+}+#cc-reactions:empty { display: none; }+.cc-reaction {+ width: 36px; height: 36px; border-radius: var(--cc-radius-sm); border: 1px solid transparent;+ background: rgba(255, 255, 255, 0.04); cursor: pointer; font-size: 18px; filter: grayscale(0.4);+ transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease,+ filter 0.12s ease, opacity 0.12s ease;+}+.cc-reaction:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--cc-edge); transform: scale(1.18); filter: grayscale(0); }+.cc-reaction:active { transform: scale(0.88); }+.cc-reaction:focus-visible { outline: 1px solid var(--cc-accent); outline-offset: 2px; }+/* cooldown: briefly dims the tapped button so a rapid second tap reads as "not yet" */+.cc-reaction.cc-cooldown { opacity: 0.3; cursor: default; transform: none !important; pointer-events: none; }++/* floating reaction sprite — rises above the sender's avatar head and fades out */+.cc-reaction-sprite {+ position: fixed; pointer-events: none; z-index: 25;+ font-size: 28px; line-height: 1; transform: translate(-50%, -100%);+ animation: cc-reaction-rise 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;+ will-change: transform, opacity;+}+@keyframes cc-reaction-rise {+ 0% { opacity: 1; transform: translate(-50%, -100%) translateY(0) scale(1); }+ 15% { transform: translate(-50%, -100%) translateY(-4px) scale(1.35); }+ 100% { opacity: 0; transform: translate(-50%, -100%) translateY(-64px) scale(0.85); }+}++/* confetti particles for 🎉 burst */+.cc-confetti {+ position: fixed; pointer-events: none; z-index: 25;+ width: 7px; height: 7px; border-radius: 2px;+ transform: translate(-50%, -50%);+ animation: cc-confetti-fly var(--dur, 1s) cubic-bezier(0.22, 0.61, 0.36, 1) forwards;+ will-change: transform, opacity;+}+@keyframes cc-confetti-fly {+ 0% { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1); }+ 80% { opacity: 0.8; }+ 100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--tx, 0px), var(--ty, -50px)) rotate(540deg) scale(0.3); }+}/* chat bubbles over avatars + name labels */.cc-label, .cc-bubble {@@ -950,6 +998,15 @@ html, body {}#cc-emotes::-webkit-scrollbar { display: none; }#cc-emotes .cc-emote { flex: 0 0 auto; width: 40px; height: 40px; font-size: 19px; }++ /* Reactions: row above emotes on mobile, same right-dock zone */+ #cc-reactions {+ left: auto; right: 10px; bottom: 104px; transform: none; z-index: 22;+ max-width: calc(100vw - 150px); overflow-x: auto; -webkit-overflow-scrolling: touch;+ padding: 4px 5px; scrollbar-width: none;+ }+ #cc-reactions::-webkit-scrollbar { display: none; }+ #cc-reactions .cc-reaction { flex: 0 0 auto; width: 34px; height: 34px; font-size: 17px; }}/* Adventure-mode link — entry from the social lobby into the isometric MMO (/game). */@@ -1835,12 +1892,29 @@ html, body {.cc-shop-in .cc-shop-panel { transform: none; opacity: 1; }.cc-shop-head {- display: flex; align-items: flex-start; justify-content: space-between;- gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--cc-edge-soft);+ display: flex; align-items: center; justify-content: space-between;+ gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid var(--cc-edge-soft);}-.cc-shop-title { display: flex; flex-direction: column; gap: 3px; }+.cc-shop-title { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }.cc-shop-title-main { font-size: 17px; font-weight: 800; letter-spacing: 0.01em; }.cc-shop-title-sub { font-size: 12px; color: var(--cc-dim); }++/* "Rarest Fits" button — opens the R25 flex board as a lazy chunk. Sits in+ the shop header between the title and close. On mobile the text is hidden,+ leaving a compact glyph-only button that still has a full aria-label. */+.cc-shop-flex {+ flex: none; appearance: none; -webkit-appearance: none;+ display: inline-flex; align-items: center; gap: 5px;+ padding: 6px 11px;+ background: rgba(255, 255, 255, 0.04); color: var(--cc-dim);+ border: 1px solid var(--cc-edge); border-radius: 999px;+ font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;+ cursor: pointer; white-space: nowrap;+ transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;+}+.cc-shop-flex:hover { color: var(--cc-text); border-color: var(--cc-edge-hi); background: rgba(255, 255, 255, 0.07); }+.cc-shop-flex:active { background: rgba(255, 255, 255, 0.02); }+.cc-shop-flex:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }.cc-shop-close {flex: none; width: 32px; height: 32px; display: grid; place-items: center;background: none; border: 1px solid var(--cc-edge); border-radius: var(--cc-radius-sm);@@ -2013,6 +2087,8 @@ span.cc-shop-action.cc-owned { align-self: flex-start; }@media (max-width: 640px) {.cc-shop-btn-text { display: none; }.cc-shop-btn { padding: 9px 11px; margin-left: 2px; }+ .cc-shop-flex-text { display: none; }+ .cc-shop-flex { padding: 7px 9px; }.cc-shop { padding: 0; place-items: stretch; }.cc-shop-panel { width: 100%; max-height: 100%; height: 100%; border: none; border-radius: 0; }.cc-shop-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }diff --git a/src/game/coincommunities.js b/src/game/coincommunities.jsindex 2d31c789b..327fb6581 100644--- a/src/game/coincommunities.js+++ b/src/game/coincommunities.js@@ -16,6 +16,7 @@ import {Mesh, MeshStandardMaterial, MeshBasicMaterial, CircleGeometry,CylinderGeometry, PlaneGeometry,CanvasTexture, TextureLoader, DoubleSide,+ PointLight,Raycaster, Vector2, WebGLRenderTarget,} from 'three';@@ -284,6 +285,7 @@ export class CoinCommunities {onShareBuild: () => this._shareBuild(),onOpenFeatured: () => this._openFeatured(),onPublishBuild: (meta) => this._publishBuild(meta),+ onDance: () => this._triggerDance(),onFeaturedClosed: () => { this._featuredOpen = false; },});@@ -444,6 +446,7 @@ export class CoinCommunities {this._chartScreen?.update(dt);this._oracleRibbon?.update(dt);this._reactor?.update(dt);+ this._tickDanceFloor(dt);}// Central coin totem — the community's banner in 3D.@@ -705,6 +708,7 @@ export class CoinCommunities {// Build the coin's world + local avatar.this._buildTotem(coin);this._buildScreen(coin);+ this._buildDanceFloor();// The market reactor turns the live trade tape into world behaviour: buys// ripple green and kick the boundary ring, sells ripple red, volume spins// the totem, the rolling % drives the weather, and whales detonate a beam@@ -881,6 +885,7 @@ export class CoinCommunities {});// Durability flag for this world's build — drives the HUD "Saved" badge.this.net.on('persistent', (durable) => { if (this.net?.status === 'online') this.buildHud.setPersistent(durable); });+ this.net.on('floor:beat', (msg) => this._onFloorBeat(msg));// Game systems (economy + activities). The server streams this player's own// pack/purse/skills here; PlaySystems renders the HUD, ponds, and cast visual,@@ -1184,6 +1189,10 @@ export class CoinCommunities {}if (this._chartScreen) { this._chartScreen.dispose(); this._chartScreen = null; }if (this._oracleRibbon) { this._oracleRibbon.dispose(); this._oracleRibbon = null; }+ if (this._danceFloor) { this.world.remove(this._danceFloor); this._danceFloor = null; }+ this._floorLights = null; this._floorTiles = null; this._floorCenterMat = null;+ this._danceFloorPos = null; this._onFloor = false; this._wantsDance = false;+ this.ui.setOnFloor(false);if (this._reactor) { this._reactor.dispose(); this._reactor = null; }if (this.voxels) { this.voxels.dispose(); this.voxels = null; }if (this.worldObjects) { this.worldObjects.dispose(); this.worldObjects = null; }@@ -1441,6 +1450,137 @@ export class CoinCommunities {}}+ // ── Dance floor (R06) ───────────────────────────────────────────────────────+ // A circular emissive pad placed beside the coin totem. Eight coloured tile+ // dots and four coloured point lights pulse on the server's floor:beat tick.+ // Standing inside the pad enables the Dance button; pressing it toggles the+ // "wants to dance" flag so the next beat crossfades this avatar (and everyone+ // else on the floor who pressed Dance) to the same clip simultaneously.++ _buildDanceFloor() {+ const CX = 14, CZ = -10; // world-space pad centre (right of totem)+ const R = 4; // pad radius in metres++ const g = new Group();+ g.position.set(CX, 0, CZ);++ // Rim disc — slightly larger, defines the pad boundary with a subtle glow.+ const rimMat = new MeshStandardMaterial({ color: 0x0a0a14, emissive: 0x180840, emissiveIntensity: 0.55, roughness: 0.3, metalness: 0.7 });+ const rim = new Mesh(new CircleGeometry(R + 0.18, 48), rimMat);+ rim.rotation.x = -Math.PI / 2;+ g.add(rim);++ // Base pad — dark polished surface.+ const baseMat = new MeshStandardMaterial({ color: 0x0d0d1c, emissive: 0x100828, emissiveIntensity: 0.28, roughness: 0.2, metalness: 0.85 });+ const base = new Mesh(new CircleGeometry(R, 48), baseMat);+ base.rotation.x = -Math.PI / 2;+ base.position.y = 0.005;+ base.receiveShadow = true;+ g.add(base);++ // 8 emissive tile dots at r = 2.5m, each a distinct hue.+ const TILE_COLS = [0xff44cc, 0x44aaff, 0xffdd22, 0x44ffcc, 0xff6633, 0x88ff44, 0xaa44ff, 0x22ddff];+ this._floorTiles = [];+ for (let i = 0; i < 8; i++) {+ const angle = (i / 8) * Math.PI * 2;+ const mat = new MeshStandardMaterial({ color: TILE_COLS[i], emissive: TILE_COLS[i], emissiveIntensity: 0.45, roughness: 0.1, metalness: 0.88 });+ const tile = new Mesh(new CircleGeometry(0.38, 20), mat);+ tile.rotation.x = -Math.PI / 2;+ tile.position.set(Math.cos(angle) * 2.5, 0.01, Math.sin(angle) * 2.5);+ g.add(tile);+ this._floorTiles.push({ mat, idx: i });+ }++ // Centre disc — pure white / violet, most dramatic on beat.+ const centerMat = new MeshStandardMaterial({ color: 0xffffff, emissive: 0xaa55ff, emissiveIntensity: 0.65, roughness: 0.06, metalness: 0.96 });+ const center = new Mesh(new CircleGeometry(0.55, 32), centerMat);+ center.rotation.x = -Math.PI / 2;+ center.position.y = 0.012;+ g.add(center);+ this._floorCenterMat = centerMat;++ // 4 coloured point lights above the pad corners — pink / cyan / yellow / mint.+ const LIGHT_COLS = [0xff44cc, 0x44aaff, 0xffdd22, 0x44ffcc];+ this._floorLights = [];+ for (let i = 0; i < 4; i++) {+ const angle = (i / 4) * Math.PI * 2 + Math.PI / 4;+ const light = new PointLight(LIGHT_COLS[i], 0.5, 14);+ light.position.set(Math.cos(angle) * 3.3, 2.6, Math.sin(angle) * 3.3);+ g.add(light);+ this._floorLights.push(light);+ }++ this.world.add(g);+ this._danceFloor = g;+ this._danceFloorPos = { x: CX, z: CZ };+ this._floorRadius = R;+ this._beatT = 999; // no visual pulse until the first beat arrives+ this._onFloor = false;+ this._wantsDance = false;+ this._danceClip = 'av-dance-shuffle';+ }++ // Animate the dance floor each frame: exponential decay from the beat,+ // staggered across tiles to produce a ripple effect outward from centre.+ _tickDanceFloor(dt) {+ if (!this._danceFloor) return;+ this._beatT = (this._beatT ?? 999) + dt;+ const t = this._beatT;+ const pulse = t < 2 ? Math.exp(-t * 2.6) : 0;++ for (const tile of this._floorTiles) {+ const off = (tile.idx / this._floorTiles.length) * 0.28;+ const tp = t > off ? Math.exp(-(t - off) * 3.4) : 0;+ tile.mat.emissiveIntensity = 0.28 + tp * 1.0;+ }+ if (this._floorCenterMat) this._floorCenterMat.emissiveIntensity = 0.5 + pulse * 1.4;+ for (const l of this._floorLights) l.intensity = 0.5 + pulse * 2.8;+ }++ // Per-tick: check whether the local player stepped onto / off the pad and+ // update the UI button accordingly.+ _checkFloorOccupancy() {+ if (!this._danceFloorPos) return;+ const dx = this.localPos.x - this._danceFloorPos.x;+ const dz = this.localPos.z - this._danceFloorPos.z;+ const onFloor = Math.hypot(dx, dz) <= this._floorRadius;+ if (onFloor === this._onFloor) return;+ this._onFloor = onFloor;+ this.ui.setOnFloor(onFloor);+ if (!onFloor && this._wantsDance) {+ this._wantsDance = false;+ this.ui.setDancing(false);+ }+ }++ // Server beat tick: reset the visual pulse and, for players who pressed+ // Dance, crossfade to this beat's clip in lockstep with all other clients.+ _onFloorBeat(msg) {+ this._beatT = 0;+ if (!this._onFloor || !this._wantsDance) return;+ const clip = msg?.clip || 'av-dance-shuffle';+ this._danceClip = clip;+ // Local avatar: start the clip now, aligned to the server beat.+ playEmoteClip(this.localAnim, clip, this.motion);+ // Broadcast so peers see us dancing — 2-second emote cooldown in WalkRoom+ // is well under the 4-second beat interval, so this always lands.+ this.net?.sendEmote(clip);+ }++ // Toggle "wants to dance" when the button is pressed. An immediate preview+ // kick plays the current clip so the player sees something happen right away;+ // subsequent beats keep re-aligning everyone in lockstep.+ _triggerDance() {+ if (!this._onFloor) return;+ this._wantsDance = !this._wantsDance;+ this.ui.setDancing(this._wantsDance);+ if (this._wantsDance) {+ const clip = this._danceClip || 'av-dance-shuffle';+ playEmoteClip(this.localAnim, clip, this.motion);+ this.net?.sendEmote(clip);+ }+ }+// Live rename: persist and broadcast so peers' nameplates update instantly._rename(name) {const clean = (name || '').trim().slice(0, 24);@@ -2244,6 +2384,7 @@ export class CoinCommunities {if (this.phase === 'world') {this._stepLocal(dt);+ this._checkFloorOccupancy();this.localAnim?.update(dt);this.localCosmetics?.tick(dt);for (const [, r] of this.remotes) r.tick(dt);diff --git a/src/game/community-net.js b/src/game/community-net.jsindex 0e20929ac..08173ef62 100644--- a/src/game/community-net.js+++ b/src/game/community-net.js@@ -476,6 +476,9 @@ export class CommunityNet {setCosmetics(wire) { this.cosmetics = typeof wire === 'string' ? wire : ''; this.room?.send('set-cosmetics', { cosmetics: this.cosmetics }); }// Activities & economy. Server-authoritative: these only request the action; the// result arrives via the profile/inv/xpgain/levelup/notice events above.+ // R05 physics ball: send a kick intent with the impulse the server should apply.+ // The server validates magnitude, direction, and rate before touching the ball.+ sendBallKick(vx, vy, vz) { this.room?.send('ball:kick', { vx, vy, vz }); }fish() { this.room?.send('fish'); }chop() { this.room?.send('chop'); }mine() { this.room?.send('mine'); }diff --git a/src/game/cosmetics-visual.js b/src/game/cosmetics-visual.jsindex 0ae3d8a37..7ef3615a6 100644--- a/src/game/cosmetics-visual.js+++ b/src/game/cosmetics-visual.js@@ -77,19 +77,25 @@ function findHeadBone(rig) {return bone;}-// A worn prop (hat / glasses). The GLB is auto-fitted to a head-ish width so one-// asset fits models of any height, anchored to the head bone when present (so it-// tracks head movement) and to a height fraction otherwise. `anchor` is 'head'-// (hats rest on the crown) or 'face' (glasses sit at eye level).+// A worn prop (hat / glasses / earrings). The GLB is auto-fitted to a head-ish+// width so one asset fits models of any height, anchored to the head bone when+// present (so it tracks head movement) and to a height fraction otherwise.+// `anchor` is 'head' (hats rest on the crown), 'face' (glasses sit at eye level),+// or 'ear' (earrings hang at cheek/ear level, slightly below the head bone).const PROP_TARGET_WIDTH_M = 0.34; // ~ a human head's widthfunction mountProp(rig, height, url, anchor) {const holder = new Group();rig.add(holder);const face = anchor === 'face';+ const ear = anchor === 'ear';const headBone = findHeadBone(rig);- const upOffset = (face ? 0.02 : 0.05) * height; // above the bone origin- const fwdOffset = face ? 0.05 : 0; // nudge glasses off the face- const fallbackY = height * (face ? 0.82 : 0.86); // no-bone height anchor+ // Per-anchor vertical + forward offsets from the head bone origin.+ // ear: slightly below the head-bone centre where the ear canal sits.+ // face: slight up + forward nudge to position on the eye line.+ // head: higher up so hats sit on the crown, not inside the skull.+ const upOffset = ear ? -0.03 * height : (face ? 0.02 : 0.05) * height;+ const fwdOffset = face ? 0.05 : 0;+ const fallbackY = height * (ear ? 0.78 : (face ? 0.82 : 0.86));const tmp = new Vector3();let model = null;let cancelled = false;@@ -112,8 +118,8 @@ function mountProp(rig, height, url, anchor) {model = scene.clone(true);model.traverse((n) => { if (n.isMesh) { n.castShadow = true; n.receiveShadow = false; } });// Fit width to the target, then anchor the prop's reference point at the- // holder origin: a hat rests on its base (sits on the crown); glasses centre- // on the eye line.+ // holder origin. Hats rest on their base (floor at y=0); glasses and+ // earrings centre on the Y axis so their pivot is the midpoint of the mesh.const box = new Box3().setFromObject(model);const size = box.getSize(new Vector3());const span = Math.max(size.x, size.z) || 1;@@ -122,7 +128,7 @@ function mountProp(rig, height, url, anchor) {const c = fitted.getCenter(new Vector3());model.position.x -= c.x;model.position.z -= c.z;- model.position.y -= face ? c.y : fitted.min.y;+ model.position.y -= (face || ear) ? c.y : fitted.min.y;holder.add(model);place();});diff --git a/src/game/world-objects.js b/src/game/world-objects.jsindex a7387951e..d9db588cb 100644--- a/src/game/world-objects.js+++ b/src/game/world-objects.js@@ -309,6 +309,7 @@ function beachBallMesh() {new MeshStandardMaterial({ map: tex, roughness: 0.35, metalness: 0 }),);m.castShadow = true;+ m.receiveShadow = true;m.userData.ownGeo = true;return m;}