From aa7148e8920881712a90592363998200117d8db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jules=20N=C3=A9ny?= Date: Mon, 9 Nov 2026 11:33:08 +0100 Subject: [PATCH] =?UTF-8?q?Retouches=20:=20=3Fmesure=20voit=20les=20v?= =?UTF-8?q?=C3=A9los=20(positions=20=C3=A0=20l'=C3=A9cran,=20vus=20ou=20ca?= =?UTF-8?q?ch=C3=A9s=20par=20une=20couronne)=20pour=20le=20RECAP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PWGVn3Wis5d8ohPS466hHq --- maquette/scene.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/maquette/scene.js b/maquette/scene.js index 3a8d28f..8417abd 100644 --- a/maquette/scene.js +++ b/maquette/scene.js @@ -859,6 +859,8 @@ export function creerScene(canvas, { D, ESSENCES, BULLES, IMG, reduit, petit, on // retouches du 07/11 : le minibus, la maison de maître, le lieu commun, les trajets des vélos (le RECAP les mesure) retouches: { ...objets.retouches, velos: velosSentiers.map(({ L, v, pts }) => ({ L, v, pts })), velosTemoin: velosT ? velosT.temoin : null, commun: grand ? grand.userData.commun || null : null }, velosEcran: () => velosSentiers.filter((o) => o.obj.visible).map((o) => ({ ...versEcran(o.obj.position.x, 1, o.obj.position.z), x3: o.obj.position.x, z3: o.obj.position.z })), + // un vélo des sentiers « vu » : le premier objet que le rayon de la caméra rencontre est le vélo (aucune couronne devant) + velosVus: () => { const { W, H } = taille(); return velosSentiers.filter((o) => o.obj.visible).map((o) => { const e = versEcran(o.obj.position.x, 0.9, o.obj.position.z); ray.setFromCamera(new THREE.Vector2((e.x / W) * 2 - 1, -(e.y / H) * 2 + 1), cam); const h = ray.intersectObjects(G.v2035.children, true)[0]; let x = h && h.object; while (x && x !== o.obj) x = x.parent; return { x: e.x, y: e.y, vu: !!x }; }); }, velosTemoinEcran: () => (temoin ? Object.entries(temoin.meshes).filter(([k]) => k.startsWith('velo')).map(([, o]) => ({ ...versEcran(o.position.x, 1, o.position.z), x3: o.position.x, z3: o.position.z })) : []), temoin: temoin ? temoin.mesure : null, effets: () => [...etat.fxs], ecran(x, y, z) { v.set(x, y, z).project(cam); const { W, H } = taille(); return { x: (v.x + 1) / 2 * W, y: (1 - v.y) / 2 * H }; } };