Retouches : ?mesure voit les vélos (positions à l'écran, vus ou cachés par une couronne) pour le RECAP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWGVn3Wis5d8ohPS466hHq
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7ce14b1566
commit
aa7148e892
@@ -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 }; } };
|
||||
|
||||
Reference in New Issue
Block a user