1445 lines
98 KiB
PHP
1445 lines
98 KiB
PHP
{{-- PL0XI0N space-cubion 🛸 — LE VAISSEAU, v2 « mille fois mieux » (directive RS-7).
|
||
Décisions RS-7 du 11.08 : nom « space-cubion », arête 4 m = 2⁸ bions de 16 mm,
|
||
merge désynchronisé = FORK VISIBLE / Multi-Value Register, icône 🛸.
|
||
v2 : SCÈNE 3D CINÉMATIQUE (caméra narrative par palier + visite guidée ▶, mitose à
|
||
inertie, absorption animée — des cubions isolés rejoignent la couche externe —,
|
||
croûte propulsive qui pulse + traînées additives, anneau magsail à l'essaim, Dyson
|
||
en rotation lente + corridor de voyageurs en flux, starfield 2 couches parallaxe,
|
||
grading fog/fond du bleu profond au violet TURFU, labels sprites noyau/manteau/croûte)
|
||
+ ONGLET 🛠 « MON CUBION » : configurateur par sous-système (nomenclature
|
||
resources/papers/cubion-nomenclature-v0.md), budgets EN DIRECT (masse, puissance,
|
||
Δv Tsiolkovsky v_e=25 km/s → rayon de fork = LA stat de consentement), aperçu 3D
|
||
avec SES couleurs (MÊME contexte WebGL que la scène des paliers — le canvas migre),
|
||
brouillon jOSBoxion + publication au registre des visions (/px/space-cubion/vision).
|
||
Toujours : three self-hosted /vendor/three.min.js (AUCUN CDN), textures canvas only,
|
||
N adaptatif (1200/3000), pixelRatio≤2, rAF en pause si hidden, 1 InstancedMesh
|
||
principal + Points/Sprites, teardown WebGL complet. 3 calculateurs conservés.
|
||
Contenus : resources/papers/space-cubion.md. Régimes RÉEL / PRÉSENT / TURFU.
|
||
Contrat jOSApps. Zéro dépendance hors three (tout dégrade proprement sans). --}}
|
||
<style>
|
||
.sc{position:absolute;inset:0;display:flex;flex-direction:column;overflow:hidden;background:#04060c;color:#c9d4e3;font-family:ui-monospace,'Cascadia Code','JetBrains Mono',Menlo,Consolas,monospace}
|
||
.sc *{box-sizing:border-box;-webkit-tap-highlight-color:transparent;min-width:0}
|
||
.sc__h{flex:0 0 auto;padding:calc(env(safe-area-inset-top,0px) + 10px) 14px 4px;display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap}
|
||
.sc__t{font-weight:700;letter-spacing:.28em;font-size:.92rem;color:#e6eef8;white-space:nowrap}
|
||
.sc__t span{color:#5fd0e6}
|
||
.sc__s{font-size:.6rem;letter-spacing:.14em;color:#6f7d92;text-transform:uppercase}
|
||
.sc__tabs{flex:0 0 auto;display:flex;gap:6px;padding:8px 12px;overflow-x:auto;scrollbar-width:none}
|
||
.sc__tabs::-webkit-scrollbar{display:none}
|
||
.sc__tab{cursor:pointer;white-space:nowrap;background:none;border:1px solid rgba(120,150,190,.25);color:#8ea2bd;font:inherit;font-size:.73rem;padding:6px 12px;border-radius:16px}
|
||
.sc__tab.on{background:#5fd0e6;color:#04222c;font-weight:700;border-color:transparent}
|
||
.sc__bd{flex:1;min-height:0;position:relative}
|
||
.sc__content{position:absolute;inset:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:12px 14px calc(env(safe-area-inset-bottom,0px) + 18px);display:none}
|
||
.sc__content.on{display:block}
|
||
.sc__card{border:1px solid rgba(120,150,190,.18);border-radius:6px;padding:12px 14px;margin-bottom:10px;background:rgba(8,13,24,.6)}
|
||
.sc__ct{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:.84rem;font-weight:700;color:#eef4fb;letter-spacing:.05em;margin-bottom:7px}
|
||
.sc__p{font-size:.76rem;line-height:1.65;color:#c9d4e3;margin:0 0 6px}
|
||
.sc__p em{color:#5fd0e6;font-style:normal}
|
||
.sc__p b{color:#eef4fb}
|
||
.sc__badge{font-size:9px;letter-spacing:.16em;padding:3px 8px;border-radius:2px;text-transform:uppercase;border:1px solid;white-space:nowrap}
|
||
.sc__badge.reel{color:#7fd6a0;border-color:#7fd6a0}
|
||
.sc__badge.present{color:#d78f3c;border-color:#d78f3c}
|
||
.sc__badge.turfu{color:#a98df0;border-color:#a98df0}
|
||
.sc__sl{display:flex;align-items:center;gap:9px;margin:8px 0}
|
||
.sc__sl label{flex:0 0 auto;font-size:.63rem;letter-spacing:.08em;color:#6f7d92;text-transform:uppercase;min-width:88px}
|
||
.sc__sl input{flex:1;accent-color:#5fd0e6;min-width:60px}
|
||
.sc__sl output{flex:0 0 auto;font-size:.7rem;color:#5fd0e6;min-width:96px;text-align:right}
|
||
.sc__big{font-size:1rem;color:#7fd6a0;margin:7px 0 2px}
|
||
.sc__big small{color:#6f7d92;font-size:.64rem;letter-spacing:.08em;text-transform:uppercase;display:block;margin-bottom:2px}
|
||
.sc__note{font-size:.65rem;color:#6f7d92;line-height:1.55;margin-top:8px;border-top:1px solid rgba(120,150,190,.14);padding-top:8px}
|
||
.sc__pre{display:flex;gap:6px;flex-wrap:wrap;margin:4px 0 8px}
|
||
.sc__pre button{font:inherit;font-size:.67rem;color:#5fd0e6;background:rgba(10,16,28,.7);border:1px solid rgba(95,208,230,.35);border-radius:14px;padding:5px 11px;cursor:pointer}
|
||
.sc__scroll{overflow-x:auto}
|
||
.sc__tbl{border-collapse:collapse;font-size:.69rem;width:100%}
|
||
.sc__tbl.wide{min-width:640px}
|
||
.sc__tbl th{color:#5fd0e6;text-transform:uppercase;font-size:.6rem;letter-spacing:.1em;text-align:left;padding:5px 8px;border-bottom:1px solid rgba(120,150,190,.25)}
|
||
.sc__tbl td{padding:5px 8px;border-bottom:1px solid rgba(120,150,190,.1);color:#c9d4e3;vertical-align:top;line-height:1.5}
|
||
.sc__tbl td:first-child{color:#eef4fb;white-space:nowrap}
|
||
.sc__a{color:#5fd0e6;text-decoration:none;border-bottom:1px dotted rgba(95,208,230,.5)}
|
||
.sc__lnk{background:none;border:0;border-bottom:1px dotted rgba(95,208,230,.5);padding:0;font:inherit;cursor:pointer;min-height:44px;display:inline-flex;align-items:center}
|
||
.sc__li{font-size:.76rem;line-height:1.65;color:#c9d4e3;margin:0 0 7px}
|
||
.sc__li b{color:#eef4fb}
|
||
/* ---------- 3D : l'artefact RS-7, scopé .scx, positions ABSOLUES dans le pane ---------- */
|
||
.sc__pane3d{position:absolute;inset:0;display:none;background:#04060c;overflow:hidden;touch-action:none}
|
||
.sc__pane3d.on{display:block}
|
||
.scx__cv{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
|
||
.scx__head{position:absolute;top:0;left:0;right:0;padding:12px 16px;display:flex;justify-content:space-between;align-items:baseline;pointer-events:none;z-index:5}
|
||
.scx__ht{font-size:12px;letter-spacing:.34em;font-weight:600;color:#e6eef8}
|
||
.scx__ht span{color:#5fd0e6}
|
||
.scx__hs{font-size:9px;letter-spacing:.16em;color:#6f7d92;text-transform:uppercase}
|
||
.scx__panel{position:absolute;left:16px;bottom:92px;width:340px;max-width:calc(100% - 32px);background:rgba(8,13,24,.86);border:1px solid rgba(120,150,190,.18);border-radius:4px;padding:14px 16px;z-index:6;backdrop-filter:blur(8px)}
|
||
.scx__row{display:flex;align-items:center;gap:10px;margin-bottom:8px}
|
||
.scx__pt{font-size:13px;letter-spacing:.22em;font-weight:600;color:#eef4fb;margin:0}
|
||
.scx__badge{font-size:9px;letter-spacing:.16em;padding:3px 8px;border-radius:2px;text-transform:uppercase;border:1px solid}
|
||
.scx__badge.reel{color:#7fd6a0;border-color:#7fd6a0}
|
||
.scx__badge.present{color:#d78f3c;border-color:#d78f3c}
|
||
.scx__badge.turfu{color:#a98df0;border-color:#a98df0}
|
||
.scx__pd{font-size:10px;letter-spacing:.14em;color:#5fd0e6;margin-bottom:9px;text-transform:uppercase}
|
||
.scx__px{font-size:11.5px;line-height:1.62;color:#c9d4e3;margin:0}
|
||
.scx__px em{color:#5fd0e6;font-style:normal}
|
||
.scx__cut{margin-top:12px;display:none;align-items:center;gap:10px}
|
||
.scx__cut.on{display:flex}
|
||
.scx__cut label{font-size:9px;letter-spacing:.16em;color:#6f7d92;text-transform:uppercase;white-space:nowrap}
|
||
.scx__cut input{flex:1;accent-color:#5fd0e6;height:14px}
|
||
.scx__nav{position:absolute;left:0;right:0;bottom:0;z-index:6;display:flex;gap:6px;padding:12px 16px 14px;overflow-x:auto;scrollbar-width:none;background:linear-gradient(transparent,rgba(4,6,12,.92) 40%)}
|
||
.scx__nav::-webkit-scrollbar{display:none}
|
||
.scx__nav button{flex:0 0 auto;font-family:inherit;font-size:10px;letter-spacing:.14em;color:#6f7d92;background:rgba(10,16,28,.7);border:1px solid rgba(120,150,190,.18);border-radius:3px;padding:8px 12px;cursor:pointer;text-transform:uppercase;transition:color .2s,border-color .2s}
|
||
.scx__nav button:hover{color:#c9d4e3}
|
||
.scx__nav button.on{color:#5fd0e6;border-color:#5fd0e6}
|
||
.scx__nav button:focus-visible{outline:1px solid #5fd0e6;outline-offset:2px}
|
||
.scx__nav button .k{display:block;font-size:8px;color:#6f7d92;letter-spacing:.1em;margin-top:2px}
|
||
.scx__hint{position:absolute;right:16px;bottom:92px;font-size:9px;letter-spacing:.16em;color:#6f7d92;text-transform:uppercase;z-index:5;text-align:right;line-height:1.9;pointer-events:none}
|
||
.scx__load{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#5fd0e6;font-size:.78rem;z-index:4;pointer-events:none;text-align:center;padding:0 20px}
|
||
@media(max-width:700px){
|
||
.scx__panel{left:10px;right:10px;width:auto;bottom:84px;padding:12px 13px}
|
||
.scx__px{font-size:11px}
|
||
.scx__hint{display:none}
|
||
.scx__hs{display:none}
|
||
}
|
||
@media(prefers-reduced-motion:reduce){ .scx__badge{transition:none} }
|
||
/* ---------- v2 : visite guidée, safe-area, configurateur « mon cubion » ---------- */
|
||
.scx__nav{padding-bottom:calc(env(safe-area-inset-bottom,0px) + 14px)}
|
||
.scx__panel{bottom:calc(env(safe-area-inset-bottom,0px) + 96px)}
|
||
@media(max-width:700px){ .scx__panel{bottom:calc(env(safe-area-inset-bottom,0px) + 88px)} }
|
||
.scx__tour{color:#a98df0 !important;border-color:rgba(169,141,240,.5) !important}
|
||
.scx__tour.on{color:#120a24 !important;background:#a98df0 !important;border-color:#a98df0 !important;font-weight:700}
|
||
.scx__prev{position:relative;height:300px;max-height:46vh;border:1px solid rgba(120,150,190,.2);border-radius:6px;overflow:hidden;background:#05070f;touch-action:none;margin:4px 0 8px}
|
||
.scx__grp{font-size:.62rem;letter-spacing:.14em;color:#5fd0e6;text-transform:uppercase;margin:12px 0 5px;border-top:1px solid rgba(120,150,190,.12);padding-top:9px}
|
||
.scx__pills{display:flex;gap:6px;flex-wrap:wrap;margin:4px 0 6px}
|
||
.scx__pill{font:inherit;font-size:.68rem;color:#8ea2bd;background:rgba(10,16,28,.7);border:1px solid rgba(120,150,190,.25);border-radius:14px;padding:6px 11px;cursor:pointer}
|
||
.scx__pill.on{color:#04222c;background:#5fd0e6;border-color:transparent;font-weight:700}
|
||
.scx__pill:focus-visible,.scx__gi:focus-visible,.scx__pub:focus-visible{outline:1px solid #5fd0e6;outline-offset:2px}
|
||
.scx__chk{display:flex;align-items:center;gap:8px;font-size:.72rem;color:#c9d4e3;margin:7px 0;cursor:pointer;line-height:1.5}
|
||
.scx__chk input{accent-color:#5fd0e6;width:15px;height:15px;flex:0 0 auto}
|
||
.scx__name{display:flex;align-items:center;gap:9px;margin:4px 0 10px}
|
||
.scx__name label{font-size:.63rem;letter-spacing:.08em;color:#6f7d92;text-transform:uppercase}
|
||
.scx__name input{flex:1;font:inherit;font-size:.8rem;color:#eef4fb;background:rgba(10,16,28,.7);border:1px solid rgba(120,150,190,.3);border-radius:4px;padding:7px 10px;min-width:80px}
|
||
.scx__name input:focus{outline:1px solid #5fd0e6}
|
||
.scx__cols{display:flex;gap:14px;flex-wrap:wrap}
|
||
.scx__col{display:flex;align-items:center;gap:7px;font-size:.68rem;color:#8ea2bd;cursor:pointer;text-transform:uppercase;letter-spacing:.08em}
|
||
.scx__col input{width:36px;height:27px;border:1px solid rgba(120,150,190,.3);border-radius:4px;background:none;padding:1px;cursor:pointer}
|
||
.scx__bad{color:#e07f7f !important}
|
||
.scx__pub{font:inherit;font-size:.78rem;font-weight:700;color:#04222c;background:#5fd0e6;border:none;border-radius:18px;padding:9px 18px;cursor:pointer;margin:2px 0 4px}
|
||
.scx__pub:disabled{opacity:.55;cursor:default}
|
||
.scx__pubst{font-size:.68rem;color:#7fd6a0;margin-left:10px}
|
||
.scx__gal{margin-top:10px;display:flex;flex-direction:column;gap:6px}
|
||
.scx__gi{display:flex;align-items:center;gap:7px;flex-wrap:wrap;text-align:left;font:inherit;font-size:.7rem;color:#c9d4e3;background:rgba(10,16,28,.55);border:1px solid rgba(120,150,190,.16);border-radius:5px;padding:8px 10px;cursor:pointer;width:100%}
|
||
.scx__gi:hover{border-color:rgba(95,208,230,.5)}
|
||
.scx__sw{width:13px;height:13px;border-radius:3px;flex:0 0 auto;border:1px solid rgba(255,255,255,.15)}
|
||
.scx__gin{font-weight:700;color:#eef4fb}
|
||
.scx__gim{color:#6f7d92;font-size:.62rem}
|
||
</style>
|
||
@include('partials._astres_bion')
|
||
<script>
|
||
(function(){
|
||
'use strict';
|
||
var ID='space-cubion';
|
||
var C_LY=299792458; /* m/s */
|
||
|
||
function loadThree(cb){ if(window.THREE) return cb(window.THREE);
|
||
var s=document.querySelector('script[data-three]');
|
||
if(s){ s.addEventListener('load',function(){cb(window.THREE||null);}); s.addEventListener('error',function(){cb(null);}); return; }
|
||
s=document.createElement('script'); s.src='/vendor/three.min.js'; s.setAttribute('data-three','1');
|
||
s.onload=function(){ cb(window.THREE||null); }; s.onerror=function(){ cb(null); }; document.head.appendChild(s); }
|
||
|
||
function grp(s){ return String(s).replace(/\B(?=(\d{3})+(?!\d))/g,' '); }
|
||
function fr(x,dec){
|
||
if(x==null||!isFinite(x)) return '∞';
|
||
if(x!==0&&(Math.abs(x)>=1e7||Math.abs(x)<1e-4)){ var e=x.toExponential(2).split('e'); return e[0].replace('.',',')+'×10^'+(+e[1]); }
|
||
var s=Math.abs(x).toFixed(dec==null?2:dec), p=s.split('.');
|
||
return (x<0?'−':'')+grp(p[0])+(p[1]?','+p[1]:'');
|
||
}
|
||
function ratioStr(dv,ve){ var x=dv/ve; if(x>50) return 'exp('+fr(x,0)+') — impossible'; var r=Math.exp(x); return fr(r, r<100?2:0); }
|
||
|
||
|
||
function esc(s) { return window.jOSb.esc(s); }
|
||
|
||
function mount(container, ctx){
|
||
var alive=true, tab='3d';
|
||
var uid=Math.random().toString(36).slice(2,7);
|
||
container.innerHTML =
|
||
'<div class="sc">'
|
||
+'<div class="sc__h"><div class="sc__t">🛸 SPACE <span>CUBION</span></div>'
|
||
+'<div class="sc__s">de l’unité de consentement au corps galactique · réel / présent / turfu</div></div>'
|
||
+'<div class="sc__tabs" role="tablist">'
|
||
+'<button class="sc__tab on" role="tab" aria-selected="true" data-t="3d">🌌 3D</button>'
|
||
+'<button class="sc__tab" role="tab" aria-selected="false" data-t="config">🛠 Mon cubion</button>'
|
||
+'<button class="sc__tab" role="tab" aria-selected="false" data-t="concept">💡 Concept</button>'
|
||
+'<button class="sc__tab" role="tab" aria-selected="false" data-t="phys">🔢 Physique</button>'
|
||
+'<button class="sc__tab" role="tab" aria-selected="false" data-t="paliers">🪜 Paliers</button>'
|
||
+'<button class="sc__tab" role="tab" aria-selected="false" data-t="nomen">🧩 Nomenclature</button>'
|
||
+'<button class="sc__tab" role="tab" aria-selected="false" data-t="papier">📖 Papier</button>'
|
||
+'</div>'
|
||
+'<div class="sc__bd">'
|
||
+'<div class="sc__pane3d" data-p3d></div>'
|
||
+'<div class="sc__content" data-content></div>'
|
||
+'</div></div>';
|
||
var root=container.querySelector('.sc'),
|
||
pane3d=root.querySelector('[data-p3d]'),
|
||
content=root.querySelector('[data-content]');
|
||
|
||
/* ============================================================
|
||
MOTEUR 3D PARTAGÉ — UN SEUL contexte WebGL pour la scène des
|
||
7 paliers ET l'aperçu « mon cubion » : le canvas migre entre
|
||
le pane 3D et le holder de l'onglet configurateur.
|
||
============================================================ */
|
||
var E={THREE:null,renderer:null,canvas:null,clock:null,raf:0,ro:null,winResize:null,onVis:null,
|
||
host:null,failed:false,pending:[],stage:null,mine:null,stageDisp:[],mineDisp:[]};
|
||
|
||
function shouldRun(){ return alive&&!document.hidden&&(tab==='3d'||tab==='config'); }
|
||
function frame(){
|
||
E.raf=0;
|
||
if(!shouldRun()||!E.renderer) return;
|
||
var t=E.clock.getElapsedTime();
|
||
if(tab==='3d'&&E.stage) E.stage.frame(t);
|
||
else if(tab==='config'&&E.mine) E.mine.frame(t);
|
||
E.raf=requestAnimationFrame(frame);
|
||
}
|
||
function startLoop(){ if(!E.raf&&E.renderer&&shouldRun()) E.raf=requestAnimationFrame(frame); }
|
||
function stopLoop(){ if(E.raf){ cancelAnimationFrame(E.raf); E.raf=0; } }
|
||
function resizeNow(){
|
||
if(!E.renderer||!E.host) return;
|
||
var w=E.host.clientWidth||1,h=E.host.clientHeight||1;
|
||
E.renderer.setSize(w,h,false);
|
||
if(E.stage){ E.stage.camera.aspect=w/h; E.stage.camera.updateProjectionMatrix(); }
|
||
if(E.mine){ E.mine.camera.aspect=w/h; E.mine.camera.updateProjectionMatrix(); }
|
||
}
|
||
function attachTo(host){
|
||
if(!E.canvas||!host) return;
|
||
if(E.canvas.parentNode!==host) host.appendChild(E.canvas);
|
||
E.host=host;
|
||
try{ if(E.ro){ E.ro.disconnect(); E.ro.observe(host); } }catch(e){}
|
||
resizeNow();
|
||
}
|
||
function ensureEngine(cb){
|
||
if(E.renderer) return cb(true);
|
||
if(E.failed) return cb(false);
|
||
E.pending.push(cb);
|
||
if(E.pending.length>1) return;
|
||
loadThree(function(THREE){
|
||
var cbs=E.pending; E.pending=[];
|
||
if(!alive) return;
|
||
if(!THREE){ E.failed=true; cbs.forEach(function(f){f(false);}); return; }
|
||
var cv,rd;
|
||
try{
|
||
cv=document.createElement('canvas'); cv.className='scx__cv';
|
||
cv.setAttribute('aria-label','scène 3D space cubion');
|
||
rd=new THREE.WebGLRenderer({canvas:cv,antialias:true});
|
||
}catch(e){ E.failed=true; cbs.forEach(function(f){f(false);}); return; }
|
||
rd.setPixelRatio(Math.min(window.devicePixelRatio||1,2));
|
||
rd.localClippingEnabled=true;
|
||
E.THREE=THREE; E.renderer=rd; E.canvas=cv; E.clock=new THREE.Clock();
|
||
try{ E.ro=new ResizeObserver(resizeNow); }
|
||
catch(e){ E.winResize=resizeNow; window.addEventListener('resize',resizeNow); }
|
||
E.onVis=function(){ if(document.hidden) stopLoop(); else startLoop(); };
|
||
document.addEventListener('visibilitychange',E.onVis);
|
||
/* pointeurs : dispatch vers la scène active (orbite paliers / rotation aperçu) */
|
||
var dragging=false,px0=0,py0=0,pinchD=0;
|
||
cv.addEventListener('pointerdown',function(e){ dragging=true; px0=e.clientX; py0=e.clientY; try{cv.setPointerCapture(e.pointerId);}catch(x){} });
|
||
cv.addEventListener('pointermove',function(e){
|
||
if(!dragging) return;
|
||
var dx=e.clientX-px0,dy=e.clientY-py0; px0=e.clientX; py0=e.clientY;
|
||
if(tab==='3d'&&E.stage) E.stage.drag(dx,dy);
|
||
else if(tab==='config'&&E.mine) E.mine.drag(dx,dy);
|
||
});
|
||
function up(){ dragging=false; }
|
||
cv.addEventListener('pointerup',up); cv.addEventListener('pointercancel',up);
|
||
cv.addEventListener('wheel',function(e){ e.preventDefault();
|
||
var f=1+Math.sign(e.deltaY)*0.09;
|
||
if(tab==='3d'&&E.stage) E.stage.zoom(f); else if(tab==='config'&&E.mine) E.mine.zoom(f);
|
||
},{passive:false});
|
||
cv.addEventListener('touchmove',function(e){
|
||
if(e.touches.length===2){
|
||
var d2=Math.hypot(e.touches[0].clientX-e.touches[1].clientX,e.touches[0].clientY-e.touches[1].clientY);
|
||
if(pinchD){ var f2=pinchD/d2;
|
||
if(tab==='3d'&&E.stage) E.stage.zoom(f2); else if(tab==='config'&&E.mine) E.mine.zoom(f2); }
|
||
pinchD=d2; dragging=false;
|
||
}
|
||
},{passive:true});
|
||
cv.addEventListener('touchend',function(){ pinchD=0; });
|
||
cbs.forEach(function(f){f(true);});
|
||
});
|
||
}
|
||
|
||
/* ---------- onglet 🌌 : overlays + moteur ---------- */
|
||
function init3D(){
|
||
if(pane3d.getAttribute('data-init')){
|
||
if(E.stage) attachTo(pane3d);
|
||
return;
|
||
}
|
||
pane3d.setAttribute('data-init','1');
|
||
pane3d.innerHTML =
|
||
'<div class="scx__head"><div class="scx__ht">SPACE <span>CUBION</span></div>'
|
||
+'<div class="scx__hs">un seul essaim · la masse conservée · la topologie libre</div></div>'
|
||
+'<div class="scx__panel"><div class="scx__row"><h3 class="scx__pt" data-pt></h3><span class="scx__badge" data-pb></span></div>'
|
||
+'<div class="scx__pd" data-pd></div><p class="scx__px" data-px></p>'
|
||
+'<div class="scx__cut" data-cutrow><label for="scx-cut-'+uid+'">coupe géologique</label>'
|
||
+'<input type="range" id="scx-cut-'+uid+'" data-cut min="-11" max="12" step="0.1" value="12" aria-label="coupe géologique — position du plan de coupe"></div></div>'
|
||
+'<div class="scx__hint">glisser · orbiter<br>molette / pincer · zoom</div>'
|
||
+'<div class="scx__nav" data-snav role="tablist" aria-label="les 7 étapes"></div>'
|
||
+'<div class="scx__load" data-load>chargement du moteur 3D…</div>';
|
||
ensureEngine(function(ok){
|
||
if(!alive) return;
|
||
var load=pane3d.querySelector('[data-load]');
|
||
if(!ok){ if(load) load.textContent='moteur 3D indisponible (/vendor/three.min.js non chargé) — les autres onglets restent complets'; return; }
|
||
if(load) load.style.display='none';
|
||
buildStage();
|
||
if(tab==='3d'){ attachTo(pane3d); startLoop(); }
|
||
});
|
||
}
|
||
|
||
/* ============================================================
|
||
SCÈNE DES PALIERS v2 — un essaim, une caméra qui RACONTE.
|
||
============================================================ */
|
||
function buildStage(){
|
||
if(E.stage) return;
|
||
var THREE=E.THREE;
|
||
var reduced=false, coarse=false;
|
||
try{ reduced=matchMedia('(prefers-reduced-motion: reduce)').matches; }catch(e){}
|
||
try{ coarse=matchMedia('(pointer: coarse)').matches; }catch(e){}
|
||
var N=(coarse||window.innerWidth<800)?1200:3000; /* N adaptatif */
|
||
var RB=Math.cbrt(3*N/(4*Math.PI))*1.18; /* rayon réel de la boule de N cubions */
|
||
function keep(o){ E.stageDisp.push(o); return o; }
|
||
|
||
var scene=new THREE.Scene();
|
||
scene.background=new THREE.Color(0x04070d);
|
||
scene.fog=new THREE.FogExp2(0x04070d,0.0038);
|
||
var camera=new THREE.PerspectiveCamera(50,1,0.1,2000);
|
||
|
||
scene.add(new THREE.AmbientLight(0x2a3446,1.4));
|
||
var kl=new THREE.DirectionalLight(0xdfe8ff,1.15); kl.position.set(3,4,5); scene.add(kl);
|
||
var rim=new THREE.DirectionalLight(0x3a6a8a,0.6); rim.position.set(-4,-2,-3); scene.add(rim);
|
||
var starLight=new THREE.PointLight(0xffc27a,0,400); scene.add(starLight);
|
||
|
||
/* rng déterministe (mêmes formes à chaque visite) */
|
||
var rng=(function(s){ return function(){ s=(s*16807)%2147483647; return (s-1)/2147483646; }; })(42);
|
||
function jitter(a){ return (rng()-.5)*a; }
|
||
|
||
/* starfield 2 couches — la couche proche parallaxe plus vite à l'orbite */
|
||
function stars(M,dmin,dspan,size,op,col){
|
||
var g=keep(new THREE.BufferGeometry()), p=new Float32Array(M*3);
|
||
for(var i=0;i<M;i++){
|
||
var u=rng()*2-1,a2=rng()*Math.PI*2,r2=Math.sqrt(1-u*u),d2=dmin+rng()*dspan;
|
||
p[i*3]=Math.cos(a2)*r2*d2; p[i*3+1]=u*d2; p[i*3+2]=Math.sin(a2)*r2*d2;
|
||
}
|
||
g.setAttribute('position',new THREE.BufferAttribute(p,3));
|
||
var pts=new THREE.Points(g,keep(new THREE.PointsMaterial({color:col,size:size,sizeAttenuation:true,transparent:true,opacity:op})));
|
||
scene.add(pts); return pts;
|
||
}
|
||
var sfFar=stars(1100,520,380,1.4,0.7,0x8fa8c8);
|
||
var sfNear=stars(650,170,220,0.9,0.45,0xa9b4de);
|
||
|
||
/* l'essaim : LE draw call principal (InstancedMesh + coupe par clippingPlanes) */
|
||
var clipPlane=new THREE.Plane(new THREE.Vector3(-1,0,0),1e6);
|
||
var cubeMat=keep(new THREE.MeshStandardMaterial({metalness:.35,roughness:.55,clippingPlanes:[clipPlane],clipShadows:true}));
|
||
var boxGeo=keep(new THREE.BoxGeometry(1,1,1));
|
||
var mesh=new THREE.InstancedMesh(boxGeo,cubeMat,N);
|
||
mesh.instanceMatrix.setUsage(THREE.DynamicDrawUsage);
|
||
scene.add(mesh);
|
||
|
||
/* croûte propulsive — points additifs qui PULSENT */
|
||
var glowGeo=keep(new THREE.BufferGeometry());
|
||
glowGeo.setAttribute('position',new THREE.BufferAttribute(new Float32Array(3),3));
|
||
var glowMat=keep(new THREE.PointsMaterial({color:0x9fe8ff,size:1.5,transparent:true,opacity:0,blending:THREE.AdditiveBlending,depthWrite:false}));
|
||
scene.add(new THREE.Points(glowGeo,glowMat));
|
||
var glowB=0;
|
||
|
||
/* traînées de poussée — points additifs qui filent radialement */
|
||
var TR=reduced?0:420, q;
|
||
var trGeo=keep(new THREE.BufferGeometry());
|
||
trGeo.setAttribute('position',new THREE.BufferAttribute(new Float32Array(Math.max(TR,1)*3),3));
|
||
var trMat=keep(new THREE.PointsMaterial({color:0x6fd8ff,size:0.7,transparent:true,opacity:0,blending:THREE.AdditiveBlending,depthWrite:false}));
|
||
scene.add(new THREE.Points(trGeo,trMat));
|
||
var trPh=new Float32Array(Math.max(TR,1)); for(q=0;q<TR;q++) trPh[q]=rng();
|
||
|
||
/* anneau magsail (freinage suggéré au palier essaim) */
|
||
var ringMat=keep(new THREE.MeshBasicMaterial({color:0xa9c8ff,transparent:true,opacity:0,blending:THREE.AdditiveBlending,depthWrite:false,side:THREE.DoubleSide}));
|
||
var ring=new THREE.Mesh(keep(new THREE.TorusGeometry(24,0.3,8,80)),ringMat);
|
||
ring.position.set(58,0,0); ring.rotation.y=Math.PI/2; scene.add(ring);
|
||
|
||
/* atmosphère du sphérion (échelle asservie à RB) */
|
||
var atmo=new THREE.Mesh(keep(new THREE.SphereGeometry(13.2,48,48)),
|
||
keep(new THREE.MeshBasicMaterial({color:0x5fb8e6,transparent:true,opacity:0,side:THREE.BackSide,blending:THREE.AdditiveBlending,depthWrite:false})));
|
||
atmo.scale.setScalar(RB/10.5); scene.add(atmo);
|
||
var atmo2=new THREE.Mesh(keep(new THREE.SphereGeometry(12.4,48,48)),
|
||
keep(new THREE.MeshBasicMaterial({color:0x7fd0f0,transparent:true,opacity:0,blending:THREE.AdditiveBlending,depthWrite:false})));
|
||
atmo2.scale.setScalar(RB/10.5); scene.add(atmo2);
|
||
|
||
/* étoile (Dyson) + halo pulsant */
|
||
var star=new THREE.Mesh(keep(new THREE.SphereGeometry(4.2,32,32)),keep(new THREE.MeshBasicMaterial({color:0xffd9a0,transparent:true,opacity:0})));
|
||
scene.add(star);
|
||
var haloTex=keep((function(){ var c=document.createElement('canvas'); c.width=c.height=128;
|
||
var x=c.getContext('2d'); var g=x.createRadialGradient(64,64,0,64,64,64);
|
||
g.addColorStop(0,'rgba(255,220,160,.9)'); g.addColorStop(.35,'rgba(255,180,110,.35)'); g.addColorStop(1,'rgba(255,160,80,0)');
|
||
x.fillStyle=g; x.fillRect(0,0,128,128); return new THREE.CanvasTexture(c); })());
|
||
var halo=new THREE.Sprite(keep(new THREE.SpriteMaterial({map:haloTex,transparent:true,opacity:0,blending:THREE.AdditiveBlending,depthWrite:false})));
|
||
halo.scale.set(34,34,1); scene.add(halo);
|
||
|
||
/* faisceau du highway + corridor de voyageurs (points en FLUX) */
|
||
var beamMat=keep(new THREE.LineBasicMaterial({color:0x5fd0e6,transparent:true,opacity:0}));
|
||
scene.add(new THREE.Line(keep(new THREE.BufferGeometry().setFromPoints([new THREE.Vector3(6,0,0),new THREE.Vector3(150,14,-32)])),beamMat));
|
||
var CN=300;
|
||
var corGeo=keep(new THREE.BufferGeometry());
|
||
corGeo.setAttribute('position',new THREE.BufferAttribute(new Float32Array(CN*3),3));
|
||
var corMat=keep(new THREE.PointsMaterial({color:0x7fdff0,size:0.9,transparent:true,opacity:0,blending:THREE.AdditiveBlending,depthWrite:false}));
|
||
scene.add(new THREE.Points(corGeo,corMat));
|
||
var corJ=new Float32Array(CN*3), corT=new Float32Array(CN);
|
||
for(q=0;q<CN;q++){ corT[q]=rng(); corJ[q*3]=jitter(3); corJ[q*3+1]=jitter(2.5); corJ[q*3+2]=jitter(2.5); }
|
||
|
||
/* labels flottants discrets (sprites canvas) */
|
||
function mkLabel(txt,color){
|
||
var c=document.createElement('canvas'); c.width=256; c.height=64;
|
||
var x=c.getContext('2d');
|
||
x.font='600 24px ui-monospace,Menlo,Consolas,monospace'; x.textAlign='center'; x.textBaseline='middle';
|
||
x.shadowColor='rgba(0,0,0,.95)'; x.shadowBlur=7;
|
||
x.fillStyle=color; x.fillText(txt,128,32);
|
||
var tx=keep(new THREE.CanvasTexture(c));
|
||
var sp=new THREE.Sprite(keep(new THREE.SpriteMaterial({map:tx,transparent:true,opacity:0,depthTest:false,depthWrite:false})));
|
||
sp.scale.set(7.2,1.8,1); scene.add(sp); return sp;
|
||
}
|
||
var labNoyau=mkLabel('noyau','#f0b46a'), labManteau=mkLabel('manteau','#aeb9cc'), labCroute=mkLabel('croûte propulsive','#8fd8ea'),
|
||
labSail=mkLabel('magsail','#a9c8ff'), labStar=mkLabel('étoile-collecteur','#ffd9a0');
|
||
labNoyau.position.set(1.5,0.8,0); labManteau.position.set(1.5,RB*0.62,0); labCroute.position.set(1.5,RB*1.16,0);
|
||
labSail.position.set(58,26.5,0); labStar.position.set(0,7.6,0);
|
||
|
||
/* ------------- génération des états ------------- */
|
||
function ball(count,spacing){
|
||
var pts=[], R=Math.ceil(Math.cbrt(count))+3,x,y,z;
|
||
for(x=-R;x<=R;x++)for(y=-R;y<=R;y++)for(z=-R;z<=R;z++) pts.push([x,y,z,x*x+y*y+z*z]);
|
||
pts.sort(function(a,b){return a[3]-b[3];});
|
||
return pts.slice(0,count).map(function(p){ return [p[0]*spacing,p[1]*spacing,p[2]*spacing]; });
|
||
}
|
||
function fib(i,n,R){
|
||
var g=Math.PI*(3-Math.sqrt(5)), y=1-2*(i+.5)/n, r=Math.sqrt(Math.max(0,1-y*y)), th=g*i;
|
||
return [Math.cos(th)*r*R,y*R,Math.sin(th)*r*R];
|
||
}
|
||
function C(h){ return new THREE.Color(h); }
|
||
var cNoyau=C(0xc77f35),cManteau=C(0x6e7b8f),cCroute=C(0x3f7484),cEngine=C(0x9fe8ff),
|
||
cMetal=C(0xaab4c4),cRock=C(0x8a8f96),cWin=C(0x7fdff0),cSwarm=C(0x6fa8bc);
|
||
function mkState(){ return {pos:new Float32Array(N*3),scl:new Float32Array(N),col:new Float32Array(N*3),glow:null,glowDir:null}; }
|
||
function setI(st,i,x,y,z,s,c,vary){
|
||
st.pos[i*3]=x; st.pos[i*3+1]=y; st.pos[i*3+2]=z; st.scl[i]=s;
|
||
var v=1+(vary?(rng()-.5)*vary:0);
|
||
st.col[i*3]=Math.min(1,c.r*v); st.col[i*3+1]=Math.min(1,c.g*v); st.col[i*3+2]=Math.min(1,c.b*v);
|
||
}
|
||
var vaisseauBall=ball(N,1.18), halfBall=ball(N>>1,1.18), i,f,c2,p;
|
||
var OXM=RB*1.38; /* écartement des deux moitiés de la mitose */
|
||
|
||
/* — 1 · CUBION — */
|
||
var stCubion=mkState();
|
||
setI(stCubion,0,0,0,0,3.0,cMetal,0);
|
||
for(i=1;i<N;i++) setI(stCubion,i,vaisseauBall[i][0],vaisseauBall[i][1],vaisseauBall[i][2],0,cMetal,0);
|
||
|
||
/* — 2 · AGRÉGAT — */
|
||
var stAgg=mkState();
|
||
(function(){ var k=0,x,y,z;
|
||
for(x=0;x<4;x++)for(y=0;y<4;y++)for(z=0;z<4;z++){
|
||
var gen=(x+y+z)%2?cMetal:C(0x8fb8c4);
|
||
setI(stAgg,k,(x-1.5)*1.32,(y-1.5)*1.32,(z-1.5)*1.32,1,gen,.18); k++;
|
||
}
|
||
for(var j=64;j<N;j++) setI(stAgg,j,vaisseauBall[j][0],vaisseauBall[j][1],vaisseauBall[j][2],0,cManteau,0);
|
||
})();
|
||
|
||
/* — 3 · VAISSEAU-MÈRE (strates) — */
|
||
var stShip=mkState(); stShip.glow=[]; stShip.glowDir=[];
|
||
for(i=0;i<N;i++){
|
||
f=i/N;
|
||
if(f<0.22) c2=cNoyau; else if(f<0.68) c2=cManteau; else c2=cCroute;
|
||
if(f>0.96){ c2=cEngine; p=vaisseauBall[i];
|
||
var L1=Math.hypot(p[0],p[1],p[2])||1;
|
||
stShip.glow.push(p[0]*1.12,p[1]*1.12,p[2]*1.12);
|
||
stShip.glowDir.push(p[0]/L1,p[1]/L1,p[2]/L1); }
|
||
setI(stShip,i,vaisseauBall[i][0],vaisseauBall[i][1],vaisseauBall[i][2],1,c2,.22);
|
||
}
|
||
|
||
/* — 4 · MITOSE (deux moitiés qui s'écartent avec inertie) — */
|
||
var stMit=mkState(); stMit.glow=[]; stMit.glowDir=[];
|
||
for(i=0;i<N;i++){
|
||
var h=i%2, j2=i>>1; p=halfBall[j2%halfBall.length];
|
||
var ox=h?OXM:-OXM;
|
||
f=j2/halfBall.length;
|
||
if(f<0.22) c2=cNoyau; else if(f<0.68) c2=cManteau; else c2=cCroute;
|
||
if(f>0.95){ c2=cEngine;
|
||
var L2=Math.hypot(p[0],p[1],p[2])||1;
|
||
stMit.glow.push(p[0]*1.12+ox,p[1]*1.12,p[2]*1.12);
|
||
stMit.glowDir.push(p[0]/L2,p[1]/L2,p[2]/L2); }
|
||
setI(stMit,i,p[0]+ox,p[1],p[2],1,c2,.22);
|
||
}
|
||
|
||
/* — 5 · ESSAIM — */
|
||
var stSw=mkState();
|
||
for(i=0;i<N;i++){
|
||
var t2=rng();
|
||
setI(stSw,i,(t2-.5)*110+jitter(8),jitter(30)*(1-Math.abs(t2-.5)),jitter(30)*(1-Math.abs(t2-.5)),.8,cSwarm,.4);
|
||
}
|
||
|
||
/* — 6 · SPHÉRION — */
|
||
var stSph=mkState();
|
||
for(i=0;i<N;i++){
|
||
p=vaisseauBall[i]; f=i/N;
|
||
var lit=f>0.82&&rng()<0.09;
|
||
setI(stSph,i,p[0],p[1],p[2],1,lit?cWin:cRock,lit?0:.18);
|
||
}
|
||
|
||
/* — 7 · GALAXY HIGHWAY (coquille Dyson complète en rotation lente ; le corridor
|
||
est un flux de Points séparé — les voyageurs CIRCULENT) — */
|
||
var stDy=mkState();
|
||
for(i=0;i<N;i++){
|
||
var pp=fib(i,N,27), gap=rng()<0.13;
|
||
setI(stDy,i,pp[0],pp[1],pp[2],gap?0:.95,cManteau,.25);
|
||
}
|
||
|
||
/* ------------- étapes : récit + caméra signature + grading ------------- */
|
||
var stages=[
|
||
{id:'cubion',name:'CUBION',badge:['présent','present'],data:'1 unité · arête 4 m = 2⁸ bions · détachable',
|
||
st:stCubion,bg:0x04070d,fogD:0.0038,
|
||
cam:{r:9.5,th:0.65,ph:1.22,look:[0.9,0.5,0],drift:0.0012},
|
||
text:'Chaque personne possède son vaisseau. Faces planes, amarrage standard, détachable à tout moment: le cube est <em>l’unité de consentement</em>. Fork(∞) sans lock(), rendu physique dans la coque.'},
|
||
{id:'agregat',name:'AGRÉGAT',badge:['présent','present'],data:'64 unités · absorption incessante',
|
||
st:stAgg,absorb:'agg',bg:0x050a14,fogD:0.0034,
|
||
cam:{r:21,th:2.35,ph:1.0,look:[-1.6,0.9,0],drift:-0.0009},
|
||
text:'Les cubions s’amarrent, l’agrégat grandit en continu. Le successeur ne dépasse pas: il rejoint et devient la nouvelle couche externe. <em>L’obsolescence est digérée</em>, pas subie — regarde-les arriver.'},
|
||
{id:'vaisseau',name:'VAISSEAU-MÈRE',badge:['turfu','turfu'],data:'noyau · manteau · croûte propulsive',cut:true,absorb:'ship',
|
||
st:stShip,bg:0x060a17,fogD:0.0028,
|
||
cam:{r:40,th:3.9,ph:1.28,look:[2.2,1.2,-1],drift:0.0007},
|
||
text:'Les couches sont l’historique physique du voyage: creuser vers le centre, c’est lire le passé. <em>Event-sourcing géologique</em> — chaque strate est un tsoin matérialisé. Utilise la coupe pour lire les strates.'},
|
||
{id:'mitose',name:'MITOSE',badge:['turfu','turfu'],data:'poussée ∝ r² · masse ∝ r³',cut:true,easeBack:true,
|
||
st:stMit,bg:0x090a19,fogD:0.0024,
|
||
cam:{r:60,th:1.5708,ph:1.42,look:[0,0.5,0],drift:0.0006},
|
||
text:'Au-delà d’un seuil, le ratio poussée/masse s’effondre et le vaisseau se divise. Récursif: couper en deux ne réduit le rayon que de <em>1,26</em> — une division ne suffit jamais longtemps.'},
|
||
{id:'essaim',name:'ESSAIM',badge:['turfu','turfu'],data:'masse conservée · topologie libre · magsail',
|
||
st:stSw,anim:true,bg:0x0a0c1e,fogD:0.0018,
|
||
cam:{r:92,th:0.35,ph:0.95,look:[12,0,0],drift:0.0008},
|
||
text:'<em>La forme est une variable d’état.</em> Division complète, accélération en petites unités, refusion aux étapes. Le vaisseau-mère n’est pas un objet, c’est un état de l’essaim. L’anneau devant: le frein magsail.'},
|
||
{id:'spherion',name:'SPHÉRION',badge:['turfu','turfu'],data:'potato radius ~400–600 km · atmosphère fabriquée',
|
||
st:stSph,bg:0x0e0b20,fogD:0.0022,
|
||
cam:{r:44,th:5.6,ph:1.08,look:[-3,2,0],drift:-0.0006},
|
||
text:'Au-delà du seuil de sphéricité, la gravité impose la sphère. Le Sphérion est la <em>planète construite</em>: entièrement en cubions, atmosphère propre, et elle se déplace. On ne cherche plus de planètes habitables — on les fabrique.'},
|
||
{id:'highway',name:'GALAXY HIGHWAY',badge:['turfu profond','turfu'],data:'dyson mobile · corridors · cyclers · waypoints',
|
||
st:stDy,bg:0x140b26,fogD:0.0014,
|
||
cam:{r:120,th:5.5,ph:1.18,look:[26,4,-8],drift:0.0004},
|
||
text:'L’infrastructure reste sur place et pousse les voyageurs: l’étoile devient collecteur, les corridors accélèrent les essaims. La civilisation ne voyage plus, elle <em>s’étend</em> — voyager devient circuler dans son propre corps.'}
|
||
];
|
||
|
||
/* transition d'état (dirty-flags conservés) */
|
||
var cur=mkState(); cur.pos.set(stCubion.pos); cur.scl.set(stCubion.scl); cur.col.set(stCubion.col);
|
||
var from=mkState(), target=stCubion, transT0=-1e9, transBack=false;
|
||
var DUR=reduced?0.01:1.35, STAG=reduced?0:0.5;
|
||
var delay=new Float32Array(N); for(i=0;i<N;i++) delay[i]=rng()*STAG;
|
||
function easeC(t){ return t<0?0:t>1?1:1-Math.pow(1-t,3); }
|
||
function easeB(t){ if(t<0)return 0; if(t>1)return 1; var c1=1.25,c3=c1+1,u=t-1; return 1+c3*u*u*u+c1*u*u; }
|
||
function easeIO(t){ return t<0?0:t>1?1:(t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2); }
|
||
var stageIdx=0;
|
||
|
||
/* caméra cinématique : chaque palier a son plan, l'orbite manuelle reprend au drag */
|
||
var cam={r:16,th:0.2,ph:1.3,lx:0,ly:0,lz:0,rT:9.5,drift:0.0012};
|
||
var camFrom=null,camTo=null,camT0=-1e9,CAMD=reduced?0.01:2.6,userCam=false,dragActive=false;
|
||
|
||
/* absorption : des cubions isolés REJOIGNENT la couche externe */
|
||
var FLY=reduced?0:12, flyers=[];
|
||
function mkFlyer(stg,idx,delay0){
|
||
var u=rng()*2-1,a2=rng()*Math.PI*2,r2=Math.sqrt(1-u*u);
|
||
var far=stg.absorb==='agg'?26:RB*3.1;
|
||
var to;
|
||
if(stg.absorb==='agg'){
|
||
var ax=Math.floor(rng()*3), sgn=rng()<.5?-1:1, o=0, pos=[0,0,0];
|
||
pos[ax]=sgn*2.64;
|
||
for(var d3=0;d3<3;d3++) if(d3!==ax){ pos[d3]=((rng()*4|0)-1.5)*1.32; o++; }
|
||
to=pos;
|
||
} else {
|
||
var uu=rng()*2-1,aa=rng()*Math.PI*2,rr=Math.sqrt(1-uu*uu);
|
||
to=[Math.cos(aa)*rr*RB*1.06,uu*RB*1.06,Math.sin(aa)*rr*RB*1.06];
|
||
}
|
||
return {i:idx,from:[Math.cos(a2)*r2*far,u*far,Math.sin(a2)*r2*far],to:to,
|
||
t0:E.clock.getElapsedTime()+delay0,dur:3.4+rng()*2.6,rest:1.7};
|
||
}
|
||
function flyReset(stg){
|
||
flyers.length=0;
|
||
if(!FLY||!stg.absorb) return;
|
||
for(var k2=0;k2<FLY;k2++) flyers.push(mkFlyer(stg,N-1-k2,k2*0.55));
|
||
}
|
||
|
||
var elPT=pane3d.querySelector('[data-pt]'), elPB=pane3d.querySelector('[data-pb]'),
|
||
elPD=pane3d.querySelector('[data-pd]'), elPX=pane3d.querySelector('[data-px]'),
|
||
elCutRow=pane3d.querySelector('[data-cutrow]'), cutSlider=pane3d.querySelector('[data-cut]'),
|
||
snav=pane3d.querySelector('[data-snav]');
|
||
|
||
/* visite guidée ▶ : enchaîne les 7 paliers, panneau descriptif affiché, stoppable */
|
||
var tour=false, tourT0=0, TOUR_S=12, tourBtn=null;
|
||
function tourStop(){
|
||
if(!tour) return;
|
||
tour=false;
|
||
if(tourBtn){ tourBtn.classList.remove('on'); tourBtn.setAttribute('aria-pressed','false'); }
|
||
}
|
||
|
||
function goStage(idx){
|
||
stageIdx=idx;
|
||
var s=stages[idx], t0=E.clock.getElapsedTime();
|
||
from.pos.set(cur.pos); from.scl.set(cur.scl); from.col.set(cur.col);
|
||
target=s.st; transT0=t0; transBack=!!s.easeBack; tourT0=t0;
|
||
/* le plan caméra du palier : travelling d'approche vers l'angle signature */
|
||
var dth=(s.cam.th-cam.th)%(Math.PI*2);
|
||
if(dth>Math.PI) dth-=Math.PI*2; if(dth<-Math.PI) dth+=Math.PI*2;
|
||
camFrom={r:cam.r,th:cam.th,ph:cam.ph,lx:cam.lx,ly:cam.ly,lz:cam.lz};
|
||
camTo={r:s.cam.r,th:cam.th+dth,ph:s.cam.ph,look:s.cam.look};
|
||
camT0=t0; userCam=false; cam.drift=s.cam.drift; cam.rT=s.cam.r;
|
||
elPT.textContent=s.name;
|
||
elPB.textContent=s.badge[0]; elPB.className='scx__badge '+s.badge[1];
|
||
elPD.textContent=s.data;
|
||
elPX.innerHTML=s.text;
|
||
elCutRow.className='scx__cut'+(s.cut?' on':'');
|
||
if(!s.cut){ cutSlider.value=12; clipPlane.constant=1e6; }
|
||
navBtns.forEach(function(el,k){ var on=k===idx; el.className=on?'on':''; el.setAttribute('aria-selected',on?'true':'false'); });
|
||
if(s.st.glow){
|
||
glowGeo.setAttribute('position',new THREE.BufferAttribute(new Float32Array(s.st.glow),3));
|
||
glowGeo.attributes.position.needsUpdate=true;
|
||
}
|
||
flyReset(s);
|
||
startLoop();
|
||
}
|
||
|
||
/* nav : ▶ visite + les 7 étapes */
|
||
tourBtn=document.createElement('button');
|
||
tourBtn.type='button'; tourBtn.className='scx__tour';
|
||
tourBtn.setAttribute('aria-pressed','false');
|
||
tourBtn.setAttribute('aria-label','visite guidée — enchaîne les 7 paliers en mode narratif');
|
||
tourBtn.innerHTML='▶ VISITE<span class="k">guidée</span>';
|
||
tourBtn.addEventListener('click',function(){
|
||
if(tour){ tourStop(); return; }
|
||
tour=true; tourBtn.classList.add('on'); tourBtn.setAttribute('aria-pressed','true');
|
||
goStage((stageIdx+1)%stages.length);
|
||
});
|
||
snav.appendChild(tourBtn);
|
||
var navBtns=[];
|
||
stages.forEach(function(s,k){
|
||
var b=document.createElement('button');
|
||
b.type='button'; b.setAttribute('role','tab');
|
||
b.setAttribute('aria-label','étape '+(k+1)+' sur 7 — '+s.name+' ('+s.badge[0]+')');
|
||
b.innerHTML=s.name+'<span class="k">'+String(k+1).padStart(2,'0')+'</span>';
|
||
b.addEventListener('click',function(){ tourStop(); goStage(k); });
|
||
snav.appendChild(b); navBtns.push(b);
|
||
});
|
||
|
||
cutSlider.addEventListener('input',function(){
|
||
var v=parseFloat(cutSlider.value);
|
||
clipPlane.constant=v>=11.8?1e6:v;
|
||
startLoop();
|
||
});
|
||
|
||
function dragCam(dx,dy){
|
||
userCam=true; dragActive=true; tourStop();
|
||
cam.th-=dx*0.005;
|
||
cam.ph=Math.max(0.15,Math.min(Math.PI-0.15,cam.ph-dy*0.005));
|
||
}
|
||
function zoomCam(f){ cam.rT=Math.max(5,Math.min(300,cam.rT*f)); startLoop(); }
|
||
|
||
var M4=new THREE.Matrix4(),Q=new THREE.Quaternion(),V=new THREE.Vector3(),S=new THREE.Vector3(),TC=new THREE.Color(),TC2=new THREE.Color();
|
||
|
||
function stageFrame(t){
|
||
var stg=stages[stageIdx], isSwarm=stg.id==='essaim', isDy=stg.id==='highway';
|
||
var transitioning=(t-transT0)<(DUR+STAG+0.08);
|
||
dragActive=false;
|
||
|
||
/* visite guidée : auto-avance */
|
||
if(tour&&t-tourT0>TOUR_S) goStage((stageIdx+1)%stages.length);
|
||
|
||
/* interpolation des N instances — SEULEMENT en transition ou en essaim animé */
|
||
if(transitioning||(isSwarm&&!reduced)){
|
||
var eFn=transBack?easeB:easeC;
|
||
for(var k=0;k<N;k++){
|
||
var dl=transBack?((k%2)*0.22+delay[k]*0.4):delay[k];
|
||
var e2=eFn((t-transT0-dl)/DUR), i3=k*3;
|
||
var x=from.pos[i3]+(target.pos[i3]-from.pos[i3])*e2;
|
||
var y=from.pos[i3+1]+(target.pos[i3+1]-from.pos[i3+1])*e2;
|
||
var z=from.pos[i3+2]+(target.pos[i3+2]-from.pos[i3+2])*e2;
|
||
var s2=from.scl[k]+(target.scl[k]-from.scl[k])*e2;
|
||
if(isSwarm&&!reduced){ var ph2=k*0.7; x+=Math.sin(t*0.8+ph2)*0.5; y+=Math.cos(t*0.6+ph2)*0.4; s2*=1+0.06*Math.sin(t*1.3+ph2); }
|
||
cur.pos[i3]=x; cur.pos[i3+1]=y; cur.pos[i3+2]=z; cur.scl[k]=s2;
|
||
M4.compose(V.set(x,y,z),Q,S.set(s2,s2,s2));
|
||
mesh.setMatrixAt(k,M4);
|
||
var r2=from.col[i3]+(target.col[i3]-from.col[i3])*e2,
|
||
g2=from.col[i3+1]+(target.col[i3+1]-from.col[i3+1])*e2,
|
||
b2=from.col[i3+2]+(target.col[i3+2]-from.col[i3+2])*e2;
|
||
cur.col[i3]=r2; cur.col[i3+1]=g2; cur.col[i3+2]=b2;
|
||
mesh.setColorAt(k,TC.setRGB(r2,g2,b2));
|
||
}
|
||
mesh.instanceMatrix.needsUpdate=true;
|
||
if(mesh.instanceColor) mesh.instanceColor.needsUpdate=true;
|
||
}
|
||
|
||
/* absorption : les cubions isolés rejoignent la couche externe */
|
||
if(flyers.length&&!transitioning){
|
||
for(var fk=0;fk<flyers.length;fk++){
|
||
var F=flyers[fk], phF=t-F.t0, fx,fy,fz,fs;
|
||
if(phF<0){ fx=F.from[0]; fy=F.from[1]; fz=F.from[2]; fs=0; }
|
||
else if(phF<F.dur){
|
||
var fe=easeC(phF/F.dur);
|
||
fx=F.from[0]+(F.to[0]-F.from[0])*fe; fy=F.from[1]+(F.to[1]-F.from[1])*fe; fz=F.from[2]+(F.to[2]-F.from[2])*fe;
|
||
fs=0.9;
|
||
} else if(phF<F.dur+F.rest){ fx=F.to[0]; fy=F.to[1]; fz=F.to[2]; fs=1; }
|
||
else if(phF<F.dur+F.rest+0.6){ fx=F.to[0]; fy=F.to[1]; fz=F.to[2]; fs=Math.max(0,1-(phF-F.dur-F.rest)/0.6); }
|
||
else { flyers[fk]=mkFlyer(stages[stageIdx],F.i,0); continue; }
|
||
var fi3=F.i*3;
|
||
cur.pos[fi3]=fx; cur.pos[fi3+1]=fy; cur.pos[fi3+2]=fz; cur.scl[F.i]=fs;
|
||
M4.compose(V.set(fx,fy,fz),Q,S.set(fs,fs,fs));
|
||
mesh.setMatrixAt(F.i,M4);
|
||
}
|
||
mesh.instanceMatrix.needsUpdate=true;
|
||
}
|
||
|
||
/* Dyson : rotation lente réelle de la coquille autour de l'étoile */
|
||
if(isDy&&!reduced) mesh.rotation.y+=0.00045;
|
||
else if(mesh.rotation.y!==0){
|
||
mesh.rotation.y%=(Math.PI*2);
|
||
if(Math.abs(mesh.rotation.y)<0.002) mesh.rotation.y=0; else mesh.rotation.y*=0.9;
|
||
}
|
||
|
||
/* extras — fondus + pulsations */
|
||
function want(id){ return stg.id===id; }
|
||
function fade(m,on,max){ m.opacity+=((on?max:0)-m.opacity)*0.06; }
|
||
var wantGlow=!!target.glow&&(want('vaisseau')||want('mitose'));
|
||
glowB+=((wantGlow?0.85:0)-glowB)*0.06;
|
||
glowMat.opacity=glowB*(reduced?1:(0.8+0.2*Math.sin(t*2.4)));
|
||
glowMat.size=1.5+(reduced?0:0.35*Math.sin(t*2.4));
|
||
fade(trMat,wantGlow&&TR>0,0.5);
|
||
if(TR&&trMat.opacity>0.02&&target.glow){
|
||
var ta=trGeo.attributes.position.array, GA=target.glow, GD=target.glowDir, L=GA.length/3;
|
||
if(L){
|
||
for(q=0;q<TR;q++){
|
||
var bi=q%L, pph=(trPh[q]+t*0.35)%1, qi=q*3, bi3=bi*3;
|
||
ta[qi]=GA[bi3]+GD[bi3]*pph*2.6; ta[qi+1]=GA[bi3+1]+GD[bi3+1]*pph*2.6; ta[qi+2]=GA[bi3+2]+GD[bi3+2]*pph*2.6;
|
||
}
|
||
trGeo.attributes.position.needsUpdate=true;
|
||
}
|
||
}
|
||
fade(ringMat,isSwarm,0.4);
|
||
if(isSwarm&&!reduced){ ring.rotation.x=t*0.25; ring.scale.setScalar(1+0.03*Math.sin(t*1.6)); }
|
||
fade(labSail.material,isSwarm,0.8);
|
||
fade(atmo.material,want('spherion'),0.10);
|
||
fade(atmo2.material,want('spherion'),0.05);
|
||
fade(star.material,isDy,1);
|
||
fade(halo.material,isDy,0.9);
|
||
fade(beamMat,isDy,0.5);
|
||
fade(corMat,isDy,0.85);
|
||
fade(labStar.material,isDy,0.75);
|
||
starLight.intensity+=((isDy?2.2:0)-starLight.intensity)*0.06;
|
||
if(!reduced&&isDy){ halo.scale.setScalar(34+Math.sin(t*1.4)*1.9); halo.scale.z=1; }
|
||
if(corMat.opacity>0.02){
|
||
var ca=corGeo.attributes.position.array;
|
||
for(q=0;q<CN;q++){
|
||
var tt=(corT[q]+t*0.05)%1, qj=q*3;
|
||
ca[qj]=8+tt*130+corJ[qj]; ca[qj+1]=tt*13+corJ[qj+1]; ca[qj+2]=-tt*30+corJ[qj+2];
|
||
}
|
||
corGeo.attributes.position.needsUpdate=true;
|
||
}
|
||
/* labels de strates : palier vaisseau-mère, coupe ouverte */
|
||
var cutOpen=want('vaisseau')&&clipPlane.constant<1e5;
|
||
fade(labNoyau.material,cutOpen,0.9);
|
||
fade(labManteau.material,cutOpen,0.9);
|
||
fade(labCroute.material,cutOpen,0.9);
|
||
|
||
/* grading : fog + fond glissent du bleu profond au violet TURFU */
|
||
TC2.setHex(stg.bg);
|
||
scene.fog.color.lerp(TC2,0.045);
|
||
scene.background.lerp(TC2,0.045);
|
||
scene.fog.density+=(stg.fogD-scene.fog.density)*0.045;
|
||
|
||
/* starfield : légère dérive différentielle (parallaxe vivante) */
|
||
if(!reduced){ sfNear.rotation.y=t*0.004; sfFar.rotation.y=t*0.0012; }
|
||
|
||
/* caméra : travelling narratif, puis orbite (drift signature / main de l'utilisateur) */
|
||
var cp=(t-camT0)/CAMD;
|
||
if(!userCam&&cp<=1){
|
||
var e3=easeIO(cp);
|
||
cam.th=camFrom.th+(camTo.th-camFrom.th)*e3;
|
||
cam.ph=camFrom.ph+(camTo.ph-camFrom.ph)*e3;
|
||
cam.r=camFrom.r+(camTo.r-camFrom.r)*e3;
|
||
cam.lx=camFrom.lx+(camTo.look[0]-camFrom.lx)*e3;
|
||
cam.ly=camFrom.ly+(camTo.look[1]-camFrom.ly)*e3;
|
||
cam.lz=camFrom.lz+(camTo.look[2]-camFrom.lz)*e3;
|
||
} else {
|
||
if(!reduced) cam.th+=cam.drift;
|
||
cam.r+=(cam.rT-cam.r)*0.05;
|
||
if(camTo){
|
||
cam.lx+=(camTo.look[0]-cam.lx)*0.02;
|
||
cam.ly+=(camTo.look[1]-cam.ly)*0.02;
|
||
cam.lz+=(camTo.look[2]-cam.lz)*0.02;
|
||
}
|
||
}
|
||
camera.position.set(cam.r*Math.sin(cam.ph)*Math.cos(cam.th),cam.r*Math.cos(cam.ph),cam.r*Math.sin(cam.ph)*Math.sin(cam.th));
|
||
camera.lookAt(cam.lx,cam.ly,cam.lz);
|
||
|
||
E.renderer.render(scene,camera);
|
||
}
|
||
|
||
E.stage={scene:scene,camera:camera,mesh:mesh,frame:stageFrame,drag:dragCam,zoom:zoomCam,goStage:goStage};
|
||
goStage(0);
|
||
}
|
||
|
||
/* ============================================================
|
||
APERÇU « MON CUBION » — le vaisseau de la personne, SES couleurs,
|
||
ses choix visibles. Même renderer que la scène des paliers.
|
||
============================================================ */
|
||
function buildMine(){
|
||
if(E.mine) return;
|
||
var THREE=E.THREE;
|
||
var reducedM=false;
|
||
try{ reducedM=matchMedia('(prefers-reduced-motion: reduce)').matches; }catch(e){}
|
||
function km(o){ E.mineDisp.push(o); return o; }
|
||
var scene=new THREE.Scene(); scene.background=new THREE.Color(0x05070f);
|
||
var camera=new THREE.PerspectiveCamera(46,1,0.1,300);
|
||
scene.add(new THREE.AmbientLight(0x39445a,1.5));
|
||
var k1=new THREE.DirectionalLight(0xe8f0ff,1.2); k1.position.set(4,6,5); scene.add(k1);
|
||
var k2=new THREE.DirectionalLight(0x3a6a8a,0.7); k2.position.set(-5,-3,-4); scene.add(k2);
|
||
(function(){ var g=km(new THREE.BufferGeometry()),M=260,p=new Float32Array(M*3);
|
||
for(var i=0;i<M;i++){ var u=Math.random()*2-1,a=Math.random()*Math.PI*2,r=Math.sqrt(1-u*u),d=60+Math.random()*90;
|
||
p[i*3]=Math.cos(a)*r*d; p[i*3+1]=u*d; p[i*3+2]=Math.sin(a)*r*d; }
|
||
g.setAttribute('position',new THREE.BufferAttribute(p,3));
|
||
scene.add(new THREE.Points(g,km(new THREE.PointsMaterial({color:0x8fa8c8,size:0.55,transparent:true,opacity:0.6}))));
|
||
})();
|
||
var grp=new THREE.Group(); scene.add(grp);
|
||
var rotY=0.7, rotX=0.3, dist=11.5, fusionRing=null;
|
||
var tmp=[];
|
||
function kt(o){ tmp.push(o); return o; }
|
||
function clearGrp(){
|
||
while(grp.children.length) grp.remove(grp.children[0]);
|
||
for(var i=0;i<tmp.length;i++){ try{ if(tmp[i].dispose) tmp[i].dispose(); }catch(e){} }
|
||
tmp.length=0; fusionRing=null;
|
||
}
|
||
function rebuild(){
|
||
clearGrp();
|
||
var cq=new THREE.Color(CFG.coque), ac=new THREE.Color(CFG.accent);
|
||
/* coque + ossature */
|
||
var hull=new THREE.Mesh(kt(new THREE.BoxGeometry(4,4,4)),kt(new THREE.MeshStandardMaterial({color:cq,metalness:.45,roughness:.5})));
|
||
grp.add(hull);
|
||
grp.add(new THREE.LineSegments(kt(new THREE.EdgesGeometry(hull.geometry)),kt(new THREE.LineBasicMaterial({color:ac,transparent:true,opacity:.95}))));
|
||
/* 6 bions-amarre (IDSS) — sauf face serre */
|
||
var ringG=kt(new THREE.TorusGeometry(1.05,0.09,8,40)), ringM=kt(new THREE.MeshStandardMaterial({color:ac,metalness:.6,roughness:.35}));
|
||
[[0,0,2.03,0,0],[0,0,-2.03,0,0],[2.03,0,0,0,Math.PI/2],[-2.03,0,0,0,Math.PI/2],[0,2.03,0,Math.PI/2,0],[0,-2.03,0,Math.PI/2,0]].forEach(function(d){
|
||
if(CFG.serre>0&&d[1]>2) return;
|
||
var m=new THREE.Mesh(ringG,ringM); m.position.set(d[0],d[1],d[2]); m.rotation.x=d[3]; m.rotation.y=d[4]; grp.add(m);
|
||
});
|
||
/* hublots */
|
||
var hb=Math.max(0,Math.min(8,Math.round(CFG.hublots||0)));
|
||
if(hb){
|
||
var hG=kt(new THREE.CylinderGeometry(0.3,0.3,0.1,20)), hM=kt(new THREE.MeshBasicMaterial({color:0xbfe9ff}));
|
||
var hs=[[-1.15,0.75,2.03,'z'],[0,0.75,2.03,'z'],[1.15,0.75,2.03,'z'],[2.03,0.75,1.0,'x'],[2.03,0.75,-1.0,'x'],[-2.03,0.75,0.5,'x'],[-2.03,0.75,-1.0,'x'],[1.15,-0.95,2.03,'z']];
|
||
for(var i2=0;i2<hb;i2++){
|
||
var s=hs[i2], m2=new THREE.Mesh(hG,hM);
|
||
m2.position.set(s[0],s[1],s[2]);
|
||
if(s[3]==='z') m2.rotation.x=Math.PI/2; else m2.rotation.z=Math.PI/2;
|
||
grp.add(m2);
|
||
}
|
||
}
|
||
/* énergie : panneaux déployés (solaire) ou réacteur sur mât (atome) */
|
||
if(CFG.energie==='atome'){
|
||
var mast=new THREE.Mesh(kt(new THREE.CylinderGeometry(0.09,0.09,1.6,8)),kt(new THREE.MeshStandardMaterial({color:0x4a5568,metalness:.7,roughness:.4})));
|
||
mast.position.set(0,-2.8,0); grp.add(mast);
|
||
var core=new THREE.Mesh(kt(new THREE.CylinderGeometry(0.5,0.7,1.3,12)),kt(new THREE.MeshStandardMaterial({color:0x353b46,metalness:.75,roughness:.35})));
|
||
core.position.set(0,-4.2,0); grp.add(core);
|
||
var gl2=new THREE.Mesh(kt(new THREE.SphereGeometry(0.3,12,12)),kt(new THREE.MeshBasicMaterial({color:0xffb46a})));
|
||
gl2.position.set(0,-5.05,0); grp.add(gl2);
|
||
} else {
|
||
var pG=kt(new THREE.BoxGeometry(3.4,0.08,1.7)), pM=kt(new THREE.MeshStandardMaterial({color:0x16305c,metalness:.3,roughness:.4,emissive:0x0a1c3a}));
|
||
var armG=kt(new THREE.BoxGeometry(1.4,0.1,0.1)), armM=kt(new THREE.MeshStandardMaterial({color:ac,metalness:.5,roughness:.4}));
|
||
[1,-1].forEach(function(sg){
|
||
var a2=new THREE.Mesh(armG,armM); a2.position.set(sg*2.7,0,0); grp.add(a2);
|
||
var p2=new THREE.Mesh(pG,pM); p2.position.set(sg*5.1,0,0); grp.add(p2);
|
||
});
|
||
}
|
||
/* radiateurs déployés (plus grands avec le bion-atome) */
|
||
var rs=CFG.energie==='atome'?1.45:1.0;
|
||
var rG=kt(new THREE.BoxGeometry(1.6*rs,2.5*rs,0.06)), rM=kt(new THREE.MeshStandardMaterial({color:0xcfd8e4,metalness:.2,roughness:.7}));
|
||
[1,-1].forEach(function(sg){ var m3=new THREE.Mesh(rG,rM); m3.position.set(0,0,sg*3.2); grp.add(m3); });
|
||
/* serre : la face +y verdit */
|
||
if(CFG.serre>0){
|
||
var s3=new THREE.Mesh(kt(new THREE.BoxGeometry(3.6,0.14,3.6)),
|
||
kt(new THREE.MeshStandardMaterial({color:0x3fae62,transparent:true,opacity:CFG.serre>0.5?0.9:0.55,roughness:.3,metalness:.1,emissive:0x0d3a1c})));
|
||
s3.position.set(0,2.1,0); grp.add(s3);
|
||
}
|
||
/* blindage : ceinture d'eau (épaisseur = tonnes) */
|
||
var bh=0.5+((Math.max(3,Math.min(8,CFG.blindage))-3)/5)*1.1;
|
||
var b3=new THREE.Mesh(kt(new THREE.BoxGeometry(4.14,bh,4.14)),
|
||
kt(new THREE.MeshStandardMaterial({color:0x3a6ea8,transparent:true,opacity:0.42,roughness:.2,metalness:.1})));
|
||
b3.position.set(0,-0.5,0); grp.add(b3);
|
||
/* propulsion : tuyère Hall + réservoirs d'ergol dimensionnés */
|
||
var th4=new THREE.Mesh(kt(new THREE.CylinderGeometry(0.26,0.48,0.55,14)),kt(new THREE.MeshStandardMaterial({color:0x4a5568,metalness:.8,roughness:.3})));
|
||
th4.rotation.x=Math.PI/2; th4.position.set(0,-1.35,-2.35); grp.add(th4);
|
||
var jet=new THREE.Mesh(kt(new THREE.SphereGeometry(0.16,10,10)),kt(new THREE.MeshBasicMaterial({color:0x9fe8ff})));
|
||
jet.position.set(0,-1.35,-2.72); grp.add(jet);
|
||
if(CFG.ergol>0.05){
|
||
var er=0.32+CFG.ergol*0.13;
|
||
var tG=kt(new THREE.SphereGeometry(er,14,14)), tM=kt(new THREE.MeshStandardMaterial({color:0x9fb2c8,metalness:.75,roughness:.3}));
|
||
[1,-1].forEach(function(sg){ var m4=new THREE.Mesh(tG,tM); m4.position.set(sg*1.15,1.1,-2.4-er*0.4); grp.add(m4); });
|
||
}
|
||
/* slot bion-fusion réservé (anneau violet pulsant) */
|
||
if(CFG.fusion){
|
||
fusionRing=new THREE.Mesh(kt(new THREE.TorusGeometry(0.72,0.09,8,36)),kt(new THREE.MeshBasicMaterial({color:0xa98df0,transparent:true,opacity:0.9})));
|
||
fusionRing.position.set(0,0.6,-2.12); grp.add(fusionRing);
|
||
}
|
||
/* bion-soin (croix) et bion-forme (volant d'inertie) */
|
||
if(CFG.soin){
|
||
var cM=kt(new THREE.MeshBasicMaterial({color:0xe8eef6}));
|
||
var c1=new THREE.Mesh(kt(new THREE.BoxGeometry(0.55,0.14,0.06)),cM); c1.position.set(1.25,1.25,2.05); grp.add(c1);
|
||
var cc2=new THREE.Mesh(kt(new THREE.BoxGeometry(0.14,0.55,0.06)),cM); cc2.position.set(1.25,1.25,2.05); grp.add(cc2);
|
||
}
|
||
if(CFG.forme){
|
||
var fw=new THREE.Mesh(kt(new THREE.TorusGeometry(0.32,0.08,8,24)),kt(new THREE.MeshStandardMaterial({color:0x2c3442,metalness:.7,roughness:.35})));
|
||
fw.position.set(-1.25,1.25,2.06); grp.add(fw);
|
||
}
|
||
/* la plaque du nom, à SES couleurs */
|
||
var cnv=document.createElement('canvas'); cnv.width=512; cnv.height=96;
|
||
var cx=cnv.getContext('2d');
|
||
cx.font='700 40px ui-monospace,Menlo,Consolas,monospace'; cx.textAlign='center'; cx.textBaseline='middle';
|
||
cx.shadowColor='rgba(0,0,0,.9)'; cx.shadowBlur=8;
|
||
cx.fillStyle=CFG.accent;
|
||
var nm=(CFG.nom||'').trim()||'sans nom';
|
||
cx.fillText(nm.length>26?nm.slice(0,25)+'…':nm,256,48);
|
||
var npl=new THREE.Sprite(kt(new THREE.SpriteMaterial({map:kt(new THREE.CanvasTexture(cnv)),transparent:true,opacity:.95,depthTest:false})));
|
||
npl.scale.set(8.4,1.6,1); npl.position.set(0,4.3,0); grp.add(npl);
|
||
}
|
||
function frameM(t){
|
||
if(!reducedM) rotY+=0.0035;
|
||
grp.rotation.y=rotY; grp.rotation.x=rotX;
|
||
if(fusionRing) fusionRing.material.opacity=0.55+0.35*Math.sin(t*2.2);
|
||
camera.position.set(0,1.4,dist); camera.lookAt(0,-0.2,0);
|
||
E.renderer.render(scene,camera);
|
||
}
|
||
function dragM(dx,dy){ rotY+=dx*0.007; rotX=Math.max(-1.2,Math.min(1.2,rotX+dy*0.007)); }
|
||
function zoomM(f){ dist=Math.max(6.5,Math.min(26,dist*f)); startLoop(); }
|
||
E.mine={scene:scene,camera:camera,frame:frameM,drag:dragM,zoom:zoomM,rebuild:rebuild,clear:clearGrp};
|
||
}
|
||
|
||
function initConfig3D(){
|
||
var holder=content.querySelector('[data-prev]');
|
||
if(!holder) return;
|
||
ensureEngine(function(ok){
|
||
if(!alive||tab!=='config') return;
|
||
var ld=content.querySelector('[data-prevload]');
|
||
if(!ok){ if(ld) ld.textContent='aperçu 3D indisponible (/vendor/three.min.js) — budgets et registre restent complets'; return; }
|
||
if(ld) ld.style.display='none';
|
||
buildMine();
|
||
E.mine.rebuild();
|
||
var h2=content.querySelector('[data-prev]');
|
||
if(h2){ attachTo(h2); startLoop(); }
|
||
});
|
||
}
|
||
/* ============================================================
|
||
CONTENU — Concept · Physique · Paliers · Nomenclature · Papier
|
||
============================================================ */
|
||
var B={reel:'<span class="sc__badge reel">réel</span>',present:'<span class="sc__badge present">présent</span>',turfu:'<span class="sc__badge turfu">turfu</span>'};
|
||
|
||
function vConcept(){
|
||
return ''
|
||
+'<div class="sc__card"><div class="sc__ct">🧊 Le cube = l’unité de consentement '+B.reel+'</div>'
|
||
+'<p class="sc__p">Chaque personne possède son <em>space-cubion</em> : un vaisseau cubique d’arête <b>4 m = 2⁸ bions</b> (16 mm × 2⁸ = 4 096 mm), faces planes, amarrage standard androgyne, détachable à tout moment. La <em>forkabilité devient une propriété physique de la coque</em> : « ne pas nuire » + « droit au silence », rendus mécaniques.</p>'
|
||
+'<p class="sc__p">Ce droit se <b>dimensionne</b> : partir d’un agrégat de taille lunaire coûte v_esc ≈ 2,4 km/s. Règle : chaque cubion garde en permanence une réserve de delta-v ≥ la vitesse de libération du plus gros agrégat auquel il consent à s’amarrer — le <em>delta-v de consentement</em> (→ calculateur B, onglet 🔢).</p>'
|
||
+'<div class="sc__note">Registre séparé : le mot <b>cubion</b> garde AUSSI son sens logiciel existant (composition de ploxions) — les deux sens coexistent, le vaisseau est l’incarnation physique du même pattern.</div></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🌊 L’absorption incessante (contre Kennedy) '+B.reel+'</div>'
|
||
+'<p class="sc__p">Kennedy (JBIS 2006, « wait calculation ») : si la vitesse des vaisseaux croît, il vaut rationnellement mieux <b>attendre</b> — le piège d’incitation inhibe le départ. Space Cubion inverse le postulat : le successeur plus rapide ne dépasse pas le vaisseau-mère, <em>il le rejoint, freine, s’amarre et devient la nouvelle couche externe</em>. Plus de date de départ optimale parce que plus de départ unique : un flux permanent d’agrégation. L’obsolescence est digérée, pas subie. (Déplacement de cadre — les maths de Kennedy restent valides dans leur hypothèse de lancements discrets en compétition.)</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🪨 Géologie event-sourcée '+B.turfu+'</div>'
|
||
+'<p class="sc__p">Un vaisseau qui grandit par accrétion acquiert une structure géologique : <b>noyau</b> (les cubions fondateurs, habitat pur) · <b>manteau</b> (générations intermédiaires : industrie, agriculture, stockage) · <b>croûte propulsive</b> (la dernière génération, réacteurs vers l’extérieur). Chaque couche est l’enregistrement physique d’une époque : <em>le vaisseau-mère est un log append-only fait de coques</em>. Creuser vers le centre = lire le passé (→ la coupe géologique de l’onglet 🌌).</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🧬 La forme est une variable d’état '+B.reel+'</div>'
|
||
+'<p class="sc__p">Seule la croûte pousse (surface ∝ r²), la masse est un volume (∝ r³) : <em>a = 3F_s/(ρ·r)</em> — un agrégat deux fois plus gros accélère deux fois moins. Au-delà de r_crit : <b>mitose</b>. Couper en deux ne réduit le rayon que de 2^(1/3) ≈ 1,26 — la mitose est un mode de fonctionnement permanent, pas un événement rare. Mode de croisière probable : voyager dispersé (chaque cubion garde son excellent rapport poussée/masse), fusionner aux étapes (blindage, gravité par rotation, vie sociale).</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">⧗ XI0N relativiste : le fork visible '+B.reel+'</div>'
|
||
+'<p class="sc__p">Pas d’horloge universelle en relativité : deux cubions aux trajectoires différentes ont vécu des durées propres différentes, et <b>aucun n’a raison contre l’autre</b>. L’informatique distribuée a déjà résolu la structure du problème : ordre causal (Lamport 1978), vector clocks, CRDT. Deux cubions qui se retrouvent ne comparent pas leurs montres : ils <em>mergent leurs logs</em>, au sens git.</p>'
|
||
+'<p class="sc__p"><b>Décision RS-7 (11.08)</b> : le merge de deux historiques désynchronisés = <em>FORK VISIBLE</em> (Multi-Value Register) — on garde les deux branches et on les expose comme un fork, jamais d’écrasement silencieux. Honnêteté : le CRDT ordonne la causalité et rend le désaccord <b>gérable</b> ; il ne l’annule pas.</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">⚖️ Les trois régimes de certitude</div>'
|
||
+'<p class="sc__p">'+B.reel+' physique établie et vérifiable (relativité à 1 g, carré-cube, Tsiolkovsky, Lamport/CRDT) · '+B.present+' ingénierie 2026 plausible non aboutie (fusion propulsive, magsail, Kilopower) · '+B.turfu+' spéculatif lointain (Sphérion, Dyson mobile, black hole engine). Et au-dessus de tout : <b>ne pas nuire</b> — on ne motorise qu’un corps stérile, la stérilité est une condition d’admissibilité, pas une variable d’optimisation.</p></div>';
|
||
}
|
||
|
||
/* --- physique : 3 calculateurs déterministes (zéro lib) --- */
|
||
var PH={d:26000, fs:1e5, rho:2000, r:1000, amin:0.1, dv:3e7, ve:1e7};
|
||
var AG=window.jOSSpaceCubion.AG; /* 1 g en al/an², c = 1 al/an (bion partagé) */
|
||
|
||
function slider(label,key,min,max,step,val,out){
|
||
return '<div class="sc__sl"><label>'+label+'</label>'
|
||
+'<input type="range" data-s="'+key+'" min="'+min+'" max="'+max+'" step="'+step+'" value="'+val+'" aria-label="'+label+'">'
|
||
+'<output data-o="'+out+'"></output></div>';
|
||
}
|
||
|
||
// les destinations viennent du bion jOSAstres (une seule source : Véga = 25,04 al partout), plus de distance en dur
|
||
function presets(){
|
||
var A=window.jOSAstres, R0=A&&A._?A._.R0:26670;
|
||
function d(id,def){ var o=A&&A.get?A.get(id):null; return o&&o.d>0?o.d:def; }
|
||
function f(x){ return x>=1e6?(x/1e6).toLocaleString('fr-CH',{maximumFractionDigits:1})+'×10⁶':x.toLocaleString('fr-CH',{maximumFractionDigits:2}).replace(/[’'\u202f\u00a0]/g,' '); }
|
||
return [['proxima','Proxima',4.2465],['vega','Véga',25.04],[null,'Centre galactique',R0],['m31','Andromède',2500000]].map(function(p){
|
||
var x=p[0]?d(p[0],p[2]):p[2]; return '<button type="button" data-preset="'+x+'">'+p[1]+' '+f(x)+' al</button>'; }).join('');
|
||
}
|
||
function vPhys(){
|
||
return ''
|
||
+'<div class="sc__card"><div class="sc__ct">🕰 A · Temps relativiste à 1 g '+B.reel+'</div>'
|
||
+'<p class="sc__p">Accélération propre constante 1 g, retournement à mi-parcours, arrivée à l’arrêt : <em>τ = (2c/a)·acosh(1 + a·d/2c²)</em>. Le temps vécu croît comme le <b>log</b> de la distance.</p>'
|
||
+'<div class="sc__pre">'
|
||
+presets()
|
||
+'</div>'
|
||
+slider('distance','d',Math.log10(4).toFixed(4),Math.log10(2.5e6).toFixed(4),0.001,Math.log10(PH.d),'dval')
|
||
+'<div class="sc__big"><small>temps propre à bord (τ)</small><span data-o="tau"></span></div>'
|
||
+'<div class="sc__big"><small>temps externe (référentiel de départ)</small><span data-o="text"></span></div>'
|
||
+'<div class="sc__note"><button class="sc__a sc__lnk" data-openpx="etoiles" aria-label="Ouvrir le ploxion étoiles">✦ toutes les étoiles, l’itinéraire et le calendrier de Terra → étoiles</button> (le même calcul, ton cubion et ceux du registre comme vaisseaux).</div>'
|
||
+'<div class="sc__note">×10 la distance ≈ +4,5 ans vécus. Le temps vécu n’est jamais le facteur limitant du voyage interstellaire à 1 g — l’énergie l’est.</div></div>'
|
||
|
||
+'<div class="sc__card"><div class="sc__ct">🧫 B · Carré-cube & mitose '+B.reel+'</div>'
|
||
+'<p class="sc__p">Seule la croûte pousse : <em>a = 3F_s/(ρ·r)</em> · seuil de mitose <em>r_crit = 3F_s/(ρ·a_min)</em> · vitesse de libération <em>v_esc = √(2·(4/3)πGρr·r)</em> = le <b>delta-v de consentement</b>.</p>'
|
||
+slider('F_s (poussée surf.)','fs',3,6,0.01,Math.log10(PH.fs),'fsval')
|
||
+slider('ρ (densité)','rho',500,3500,50,PH.rho,'rhoval')
|
||
+slider('r (rayon)','r',1,6.301,0.005,Math.log10(PH.r),'rval')
|
||
+slider('a_min (accél. min)','amin',-3,1,0.01,Math.log10(PH.amin),'aminval')
|
||
+'<div class="sc__big"><small>accélération de l’agrégat</small><span data-o="acc"></span></div>'
|
||
+'<div class="sc__big"><small>rayon critique de mitose</small><span data-o="rcrit"></span></div>'
|
||
+'<div class="sc__big"><small>v_esc — delta-v de consentement</small><span data-o="vesc"></span></div>'
|
||
+'<div class="sc__scroll"><table class="sc__tbl"><thead><tr><th>rayon (F_s = 10⁵ N/m², ρ = 2 000)</th><th>a = 3F_s/(ρr)</th></tr></thead><tbody>'
|
||
+'<tr><td>100 m</td><td>1,5 m/s²</td></tr><tr><td>1 km</td><td>0,15 m/s²</td></tr>'
|
||
+'<tr><td>10 km</td><td>0,015 m/s²</td></tr><tr><td>100 km</td><td>0,0015 m/s²</td></tr>'
|
||
+'</tbody></table></div>'
|
||
+'<div class="sc__note">Table §5.1 aux valeurs CORRIGÉES v1 (l’original affichait ×3 trop haut). Plus l’agrégat grossit, plus il devient poussif — d’où la mitose récursive (2^(1/3) ≈ 1,26 par division en deux).</div></div>'
|
||
|
||
+'<div class="sc__card"><div class="sc__ct">🚀 C · Tsiolkovsky '+B.reel+'</div>'
|
||
+'<p class="sc__p">Le rapport de masse : <em>m₀/m_f = exp(Δv/v_e)</em> — la « tyrannie de l’équation de la fusée » à l’échelle relativiste.</p>'
|
||
+slider('Δv','dv',3,Math.log10(0.2*C_LY).toFixed(4),0.005,Math.log10(PH.dv),'dvval')
|
||
+slider('v_e (éjection)','ve',3,8,0.01,Math.log10(PH.ve),'veval')
|
||
+'<div class="sc__big"><small>m₀/m_f pour ce couple (Δv, v_e)</small><span data-o="ratio"></span></div>'
|
||
+'<div class="sc__scroll"><table class="sc__tbl"><thead><tr><th>technologie</th><th>v_e</th><th>m₀/m_f pour ce Δv</th></tr></thead><tbody>'
|
||
+'<tr><td>chimique</td><td>4,5 km/s</td><td data-o="rchim"></td></tr>'
|
||
+'<tr><td>ionique / Hall</td><td>50 km/s</td><td data-o="rion"></td></tr>'
|
||
+'<tr><td>fusion (haut de gamme)</td><td>10⁴ km/s</td><td data-o="rfus"></td></tr>'
|
||
+'</tbody></table></div>'
|
||
+'<div class="sc__note">Seule la fusion à très haute v_e rend 0,1 c crédible en carburant embarqué (rapport ~20 ; 0,2 c → ~400). Deux contournements : la collecte en route et surtout la propulsion par faisceau → la Galaxy Highway.</div></div>';
|
||
}
|
||
|
||
function updPhys(){
|
||
function W(k,v){ var el=content.querySelector('[data-o="'+k+'"]'); if(el) el.textContent=v; }
|
||
/* A */
|
||
W('dval',fr(PH.d,PH.d<100?2:0)+' al');
|
||
var tau=(2/AG)*Math.acosh(1+AG*PH.d/2);
|
||
var tx=2*Math.sqrt(PH.d/AG+(PH.d/2)*(PH.d/2));
|
||
W('tau',fr(tau,1)+' ans vécus');
|
||
W('text',fr(tx,tx<100?1:0)+' ans');
|
||
/* B */
|
||
var G=6.674e-11;
|
||
W('fsval',fr(PH.fs,0)+' N/m²');
|
||
W('rhoval',fr(PH.rho,0)+' kg/m³');
|
||
W('rval',PH.r>=1000?fr(PH.r/1000,PH.r<1e4?1:0)+' km':fr(PH.r,0)+' m');
|
||
W('aminval',fr(PH.amin,PH.amin<0.01?4:3)+' m/s²');
|
||
var acc=3*PH.fs/(PH.rho*PH.r);
|
||
W('acc',fr(acc,acc<0.01?4:3)+' m/s²'+(acc>=9.81?' (≥ 1 g)':''));
|
||
var rc=3*PH.fs/(PH.rho*PH.amin);
|
||
W('rcrit',rc>=1000?fr(rc/1000,rc<1e4?1:0)+' km':fr(rc,1)+' m');
|
||
var vesc=PH.r*Math.sqrt(8/3*Math.PI*G*PH.rho);
|
||
W('vesc',vesc>=1000?fr(vesc/1000,2)+' km/s':fr(vesc,2)+' m/s');
|
||
/* C */
|
||
W('dvval',fr(PH.dv/1000,0)+' km/s ('+fr(PH.dv/C_LY*100,PH.dv/C_LY<0.01?2:1)+' % c)');
|
||
W('veval',fr(PH.ve/1000,PH.ve<1e4?1:0)+' km/s');
|
||
W('ratio',ratioStr(PH.dv,PH.ve));
|
||
W('rchim',ratioStr(PH.dv,4500));
|
||
W('rion',ratioStr(PH.dv,5e4));
|
||
W('rfus',ratioStr(PH.dv,1e7));
|
||
}
|
||
|
||
function vPaliers(){
|
||
function pal(t,badge,body,crit,extra){
|
||
return '<div class="sc__card"><div class="sc__ct">'+t+' '+badge+'</div>'
|
||
+'<p class="sc__p">'+body+'</p>'
|
||
+'<p class="sc__p"><b>Critère de passage :</b> <em>'+crit+'</em></p>'+(extra||'')+'</div>';
|
||
}
|
||
var scB='<div class="sc__card"><div class="sc__ct">🕰 Les trois horloges du projet</div>'
|
||
+'<p class="sc__p">Trois scénarios, une seule architecture — seules les dates changent. <b>A · La Cathédrale</b> (lent, institutionnel : arrivée à Alpha du Centaure ~2250-2300, personne de vivant ne la voit — et ça tient quand même). <b>B · Linux orbital</b> (médian, le scénario de travail : standard adopté par le NewSpace, départ ~2095-2110, arrivée ~2160-2180 d’un vaisseau-mère composite). <b>C · Exponentiel</b> (si la fusion et la boucle d’auto-réplication s’alignent : arrivée ~2125-2135 — des gens nés aujourd’hui la voient ; à raconter, jamais à promettre).</p>'
|
||
+'<p class="sc__p"><a class="sc__a" href="/wiki/paper/space-cubion-scenarios">→ le papier scénarios complet</a> — timelines détaillées, vagues d’absorption chiffrées, budgets, société, psychologie.</p></div>';
|
||
return scB
|
||
+'<p class="sc__li">La feuille de route (§14 du papier). Les horizons temporels sont des <b>ordres de grandeur, pas des promesses</b> — chaque palier définit son critère de passage au suivant.</p>'
|
||
+pal('🪜 Palier 0 · le standard',B.reel+' <span class="sc__badge" style="color:#5fd0e6;border-color:#5fd0e6">EN COURS — SPECS PUBLIÉES</span>',
|
||
'Définir et publier en open-source la spécification d’amarrage universel et le cycle de vie ploxion du cubion, plus le protocole XI0N relativiste (horloges logiques, merge d’historiques = fork visible).',
|
||
'deux cubions prototypes s’amarrent, se séparent proprement et mergent leurs logs.',
|
||
'<div class="sc__note">Les specs : <a class="sc__a" href="/wiki/paper/cubion-docking-standard-v0">cubion-docking-standard-v0</a> (6 faces, mount = amarrage / unmount = fork, caloduc inter-cubion obligatoire) · <a class="sc__a" href="/wiki/paper/xion-relativiste-v0">xion-relativiste-v0</a> (vector clocks sur chaque tsoin, merge Multi-Value Register, transport DTN/Bundle Protocol RFC 9171) · <a class="sc__a" href="/wiki/paper/cubion-nomenclature-v0">cubion-nomenclature-v0</a> (les 14 bions).</div>')
|
||
+pal('🪜 Palier 1 · l’orbite',B.present,
|
||
'Cubions habitables en orbite terrestre, agrégation et mitose démontrées, gravité artificielle par rotation d’agrégat.',
|
||
'un agrégat maintient un environnement vivable et exécute une mitose contrôlée.')
|
||
+pal('🪜 Palier 2 · le système solaire',B.present,
|
||
'Fabrication à partir de matériaux astéroïdaux (boucle auto-répliquante à la Freitas), propulsion fusion (héritière de DFD/Sunbird) sur les cubions, cyclers internes.',
|
||
'un cubion se fabrique majoritairement à partir de ressources non terrestres.')
|
||
+pal('🪜 Palier 3 · l’essaim interstellaire',B.present+' → '+B.turfu,
|
||
'Essaim capable de 0,1 c par propulsion embarquée plus corridors à faisceau, freinage par magsail validé.',
|
||
'un essaim atteint et freine à une vitesse de croisière soutenue.')
|
||
+pal('🪜 Palier 4 · le vaisseau-planète et le Sphérion',B.turfu,
|
||
'Motorisation d’un corps stérile (« ne pas nuire » : la stérilité est une condition d’admissibilité), atmosphère fabriquée, sphère de Dyson mobile comme source d’énergie.',
|
||
'un corps de masse lunaire modifie durablement sa trajectoire héliocentrique par propulsion contrôlée.');
|
||
}
|
||
|
||
function vNomen(){
|
||
function row(n,role,ref,m,p2,reg){ return '<tr><td>'+n+'</td><td>'+role+'</td><td>'+ref+'</td><td>'+m+'</td><td>'+p2+'</td><td>'+reg+'</td></tr>'; }
|
||
return ''
|
||
+'<div class="sc__card"><div class="sc__ct">🧩 Le space-cubion : arête 4 m = 2⁸ bions '+B.reel+'</div>'
|
||
+'<p class="sc__p"><b>4 m = 2⁸ × 16 mm</b> (le Bion, l’unité hardware atomique) → <b>64 m³</b>, ~35–45 m³ habitables — un module ISS court. Budget réaliste : <b>15–30 t</b> ; les 100 t = l’enveloppe « gréé grand voyage » (ergols + blindage). Un cubion = <b>UNE charge utile Starship</b>. Masses/puissances ci-dessous = ordres de grandeur, référencés sur du matériel volant.</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🔩 Les 14 bions matériels</div>'
|
||
+'<div class="sc__scroll"><table class="sc__tbl wide"><thead><tr><th>bion</th><th>rôle</th><th>référence volante</th><th>masse ~</th><th>puissance ~</th><th>régime</th></tr></thead><tbody>'
|
||
+row('bion-coque','structure primaire pressurisée, arête 4 m','module ISS court / structure CubeSat étendue','4–8 t','—',B.reel)
|
||
+row('bion-amarre','amarrage androgyne, 6 faces','IDSS (spec publique — tout port s’amarre à tout port)','0,3 t / face','0,1 kW',B.reel)
|
||
+row('bion-souffle','air : O₂ / capture CO₂','ECLSS ISS (OGA + CDRA)','1,5 t','4 kW',B.reel)
|
||
+row('bion-eau','recyclage de l’eau à 98 %','WRS/UPA ISS','1,5 t','1 kW',B.reel)
|
||
+row('bion-vivres','stock + boucle alimentaire fermée','stock : logistique ISS · boucle : aucune référence volante','1–3 t','—',B.reel+' / '+B.turfu)
|
||
+row('bion-solaire (+ pile)','énergie primaire + stockage','ROSA + Li-ion ISS','1–2 t','20–30 kW',B.reel)
|
||
+row('bion-atome','fission compacte (loin du Soleil)','KRUSTY / Kilopower (essai au sol 2018)','1,5 t','1–10 kW',B.present)
|
||
+row('bion-radiateur','rejet thermique + caloduc inter-cubion (obligatoire — la 2ᵉ loi carré-cube, thermique)','ATCS ISS','1 t','dissipe 10 kW+',B.reel)
|
||
+row('bion-poussée (hall → fusion)','propulsion : Hall vole par milliers · slot fusion réservé','propulseurs Hall / DFD-Starfire, Sunbird','0,5–2 t','1–10 kW (Hall)',B.reel+' / '+B.present)
|
||
+row('bion-cap','navigation : star trackers, IMU','matériel de vol standard','0,1 t','0,1 kW',B.reel)
|
||
+row('bion-cerveau','calcul + xion causal embarqué','avionique durcie','0,1 t','0,3 kW',B.reel)
|
||
+row('bion-lien / laser','comm optique + DTN/Bundle Protocol RFC 9171 (« tsoin over Bundle Protocol »)','DSOC (2023) · BP tourne sur l’ISS','0,1 t','0,1 kW',B.reel)
|
||
+row('bion-bouclier','Whipple + eau · GCR : sans solution légère → argument PRO-agrégation','blindage ISS','2–10 t (gréé)','—',B.reel)
|
||
+row('bion-nid / forme / soin','habitat, couchage, médical — la vie dedans','aménagements ISS','1–2 t','1 kW',B.reel)
|
||
+'</tbody></table></div>'
|
||
+'<div class="sc__note">Tout est RÉEL sauf : la boucle alimentaire fermée (TURFU), la fusion (PRÉSENT, slot réservé), Kilopower (PRÉSENT). Vigilances assumées : GCR sans solution légère · psychologie du solo long (le cubion solo = transit, l’agrégat = la vie) · cube pressurisé = +20–40 % de masse vs cylindre, le prix assumé du pavage.</div></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">📣 Les 5 messages du pitch</div>'
|
||
+'<p class="sc__li"><b>1 ·</b> Le cube modulaire standardisé vole déjà par milliers : le <b>CubeSat</b>.</p>'
|
||
+'<p class="sc__li"><b>2 ·</b> Le docking universel androgyne existe : l’<b>IDSS</b>, spec publique — la forkabilité mécanique est déjà spécifiée.</p>'
|
||
+'<p class="sc__li"><b>3 ·</b> L’agrégat modulaire habité existe depuis 1998 : l’<b>ISS</b> (~420 t), mitoses déjà pratiquées.</p>'
|
||
+'<p class="sc__li"><b>4 ·</b> Chaque brique vole ou est démontrée (ECLSS 98 % d’eau, KRUSTY 2018, DSOC 2023, Hall par milliers) — et le protocole réseau du XI0N causal EXISTE : <b>DTN/Bundle Protocol RFC 9171</b>, conçu pour l’interplanétaire, tourne sur l’ISS.</p>'
|
||
+'<p class="sc__li"><b>5 ·</b> Un cubion = <b>UNE charge utile Starship</b>.</p></div>';
|
||
}
|
||
|
||
function vPapier(){
|
||
return ''
|
||
+'<div class="sc__card"><div class="sc__ct">📄 Le papier fondateur</div>'
|
||
+'<p class="sc__p"><a class="sc__a" href="/wiki/paper/space-cubion">/wiki/paper/space-cubion</a> — 16 chapitres : le concept, la forkabilité physique, l’absorption incessante, la géologie event-sourcée, carré-cube & mitose, l’état de l’art propulsif 2026, les budgets relativistes, le XI0N relativiste, la Galaxy Highway, le test Fermi, l’intégration XERB0XI0N, les paliers, les problèmes ouverts. Corrections v1 intégrées, régimes RÉEL/PRÉSENT/TURFU systématiques.</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🧩 La nomenclature matérielle</div>'
|
||
+'<p class="sc__p"><a class="sc__a" href="/wiki/paper/cubion-nomenclature-v0">/wiki/paper/cubion-nomenclature-v0</a> — les 14 bions matériels avec leur techno volante de référence, l’arête 4 m = 2⁸ bions, les budgets de masse, les 5 messages du pitch.</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">📐 Les 2 specs du Palier 0</div>'
|
||
+'<p class="sc__li"><b>· <a class="sc__a" href="/wiki/paper/cubion-docking-standard-v0">cubion-docking-standard-v0</a></b> — l’amarrage universel : 6 faces, extension cubionlink/IDSS, mount = amarrage / unmount = fork, handshake = échange + alignement du triplet, caloduc inter-cubion obligatoire.</p>'
|
||
+'<p class="sc__li"><b>· <a class="sc__a" href="/wiki/paper/xion-relativiste-v0">xion-relativiste-v0</a></b> — la synchronisation causale : vector clocks sur chaque tsoin, merge commutatif, divergence = branche / retrouvaille = merge, <b>fork visible</b> (Multi-Value Register, décision RS-7 11.08), transport DTN/Bundle Protocol RFC 9171.</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🎭 Scénarios, société, psychologie</div>'
|
||
+'<p class="sc__p"><a class="sc__a" href="/wiki/paper/space-cubion-scenarios">/wiki/paper/space-cubion-scenarios</a> — les trois horloges (Cathédrale · Linux orbital · Exponentiel), les budgets par palier et l’inversion fiat→joules, les coopératives, l’anti-culte par design, les sept portes. « Le rêve n’est pas la décoration du projet, c’est son mécanisme de bootstrap. »</p></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🌐 Le cluster spatial du xerboxion</div>'
|
||
+'<p class="sc__li">· <button class="sc__a sc__lnk" data-openpx="space" aria-label="Ouvrir le hub space">🚀 le hub space</button> — observation, ISS en direct, astres, missions.</p>'
|
||
+'<p class="sc__li">· <button class="sc__a sc__lnk" data-openpx="carte-espace" aria-label="Ouvrir la carte de l’espace">🌌 la carte de l’espace</button> — 9 niveaux, vraies éphémérides, catalogue d’étoiles (Proxima, Véga, Andromède y sont).</p>'
|
||
+'<p class="sc__li">· <button class="sc__a sc__lnk" data-openpx="shipyard" aria-label="Ouvrir le chantier shipyard">🎮 le chantier (shipyard)</button> — assemble tes bions, calcule ton Δv, vise Véga.</p></div>'
|
||
+'<div class="sc__note">Source dans le repo : resources/papers/space-cubion.md · le vaisseau s’appelle « space-cubion » — le mot cubion garde aussi son sens logiciel (composition de ploxions), registre séparé pour les vaisseaux.</div>';
|
||
}
|
||
|
||
/* ============================================================
|
||
🛠 MON CUBION — le configurateur : choisis tes bions, vois les
|
||
budgets EN DIRECT, publie ta vision au registre.
|
||
Chiffres : resources/papers/cubion-nomenclature-v0.md.
|
||
============================================================ */
|
||
var CFG={nom:'Mon space-cubion',energie:'solaire',ergol:2,fusion:false,blindage:4,serre:0.3,hublots:2,forme:true,soin:true,coque:'#6e7b8f',accent:'#5fd0e6'};
|
||
var LS_KEY=window.jOSSpaceCubion.LS_KEY;
|
||
|
||
function calcBudget(c){ return window.jOSSpaceCubion.budget(c); } /* le bion partagé (_bion) : le même budget dans étoiles */
|
||
|
||
function pill(key,val,txt){
|
||
var on=String(CFG[key])===String(val);
|
||
return '<button type="button" class="scx__pill'+(on?' on':'')+'" data-cp="'+key+'" data-cv="'+val+'" role="radio" aria-checked="'+(on?'true':'false')+'">'+txt+'</button>';
|
||
}
|
||
function cslider(label,key,min,max,step,val){
|
||
return '<div class="sc__sl"><label>'+label+'</label>'
|
||
+'<input type="range" data-c="'+key+'" min="'+min+'" max="'+max+'" step="'+step+'" value="'+val+'" aria-label="'+label+'">'
|
||
+'<output data-o="c_'+key+'"></output></div>';
|
||
}
|
||
|
||
function vConfig(){
|
||
return ''
|
||
+'<p class="sc__li" style="color:#8ea2bd">« Dans 40 ans on construira ces vaisseaux. Dessine le tien maintenant — le registre des visions est la mémoire de ce qu’on veut. »</p>'
|
||
+'<div class="sc__card"><div class="sc__ct">🛰 Mon vaisseau</div>'
|
||
+'<div class="scx__name"><label for="scx-nom-'+uid+'">nom</label><input id="scx-nom-'+uid+'" type="text" maxlength="64" data-c="nom" value="'+esc(CFG.nom)+'" aria-label="nom du vaisseau"></div>'
|
||
+'<div class="scx__cols">'
|
||
+'<label class="scx__col">coque <input type="color" data-c="coque" value="'+esc(CFG.coque)+'" aria-label="couleur de coque"></label>'
|
||
+'<label class="scx__col">accent <input type="color" data-c="accent" value="'+esc(CFG.accent)+'" aria-label="couleur d’accent"></label>'
|
||
+'</div></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">👁 Aperçu</div>'
|
||
+'<div class="scx__prev" data-prev><div class="scx__load" data-prevload>chargement de l’aperçu 3D…</div></div>'
|
||
+'<div class="sc__note">glisser · tourner — molette / pincer · zoom. Panneaux solaires ou réacteur, radiateurs, hublots, serre, ceinture d’eau, réservoirs : tout ce que tu choisis se voit.</div></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🔩 Sous-systèmes</div>'
|
||
+'<div class="scx__grp" style="border-top:none;margin-top:2px;padding-top:0">énergie</div>'
|
||
+'<div class="scx__pills" role="radiogroup" aria-label="énergie">'
|
||
+pill('energie','solaire','☀ bion-solaire · 0,5 t · 5 kW · RÉEL')
|
||
+pill('energie','atome','⚛ bion-atome · 2 t · 10 kW · PRÉSENT')
|
||
+'</div>'
|
||
+'<div class="scx__grp">propulsion — bion-hall 0,5 t · v_e = 25 km/s</div>'
|
||
+cslider('ergol (Xe/Kr/Ar)','ergol',0,4,0.1,CFG.ergol)
|
||
+'<label class="scx__chk"><input type="checkbox" data-c="fusion"'+(CFG.fusion?' checked':'')+' aria-label="réserver le slot bion-fusion"> réserver le slot bion-fusion (interface moteur, 0 t) · PRÉSENT</label>'
|
||
+'<div class="scx__grp">blindage — bion-bouclier (mur d’eau, double emploi ECLSS)</div>'
|
||
+cslider('mur d’eau','blindage',3,8,0.5,CFG.blindage)
|
||
+'<div class="scx__grp">serre — bion-vivres</div>'
|
||
+'<div class="scx__pills" role="radiogroup" aria-label="serre">'
|
||
+pill('serre','0','aucune · stock seul')
|
||
+pill('serre','0.3','d’appoint · 0,3 t')
|
||
+pill('serre','0.8','boucle partielle · 0,8 t · TURFU')
|
||
+'</div>'
|
||
+'<div class="scx__grp">hublots — bion-hublot (silice fondue + volet débris)</div>'
|
||
+cslider('hublots','hublots',0,8,1,CFG.hublots)
|
||
+'<div class="scx__grp">humain</div>'
|
||
+'<label class="scx__chk"><input type="checkbox" data-c="forme"'+(CFG.forme?' checked':'')+' aria-label="bion-forme, exercice"> bion-forme (exercice, 0,1 t) — sans lui : −1-2 %/mois de masse osseuse</label>'
|
||
+'<label class="scx__chk"><input type="checkbox" data-c="soin"'+(CFG.soin?' checked':'')+' aria-label="bion-soin, médical"> bion-soin (médical, 0,1 t)</label>'
|
||
+'<div class="sc__note">Toujours à bord : structure 4-6 t (selon hublots) · bion-amarre 2 t (6 faces IDSS) · ECLSS 1,5 t · bion-cerveau 0,15 t (le boxion embarqué).</div>'
|
||
+'</div>'
|
||
+'<div class="sc__card"><div class="sc__ct">⚖️ Budgets en direct <span class="scx__badge" data-o="creg"></span></div>'
|
||
+'<div class="sc__big"><small>masse totale</small><span data-o="cmass"></span></div>'
|
||
+'<div class="sc__big"><small>puissance continue</small><span data-o="cpow"></span></div>'
|
||
+'<div class="sc__big"><small>réserve de delta-v (Tsiolkovsky, v_e = 25 km/s)</small><span data-o="cdv"></span></div>'
|
||
+'<div class="sc__big"><small>delta-v de consentement — LA stat</small><span data-o="cfork"></span></div>'
|
||
+'<div class="sc__note" data-o="cnote"></div></div>'
|
||
+'<div class="sc__card"><div class="sc__ct">🛰 Registre des visions</div>'
|
||
+'<button type="button" class="scx__pub" data-pub aria-label="publier ma vision au registre">🛰 publier ma vision</button>'
|
||
+'<span class="scx__pubst" data-pubst role="status" aria-live="polite"></span>'
|
||
+'<div class="scx__gal" data-gal></div></div>';
|
||
}
|
||
|
||
function updBudget(){
|
||
if(tab!=='config') return;
|
||
var b=calcBudget(CFG);
|
||
function W(k,v){ var el=content.querySelector('[data-o="'+k+'"]'); if(el) el.textContent=v; }
|
||
W('c_ergol',fr(b.erg,1)+' t → Δv '+fr(b.dv/1000,1)+' km/s');
|
||
W('c_blindage',fr(b.bli,1)+' t'+(b.bli>=5?' · abri SPE solide':''));
|
||
W('c_hublots',b.hub+(b.hub>1?' hublots':' hublot'));
|
||
W('cmass',fr(b.mass,1)+' t ('+fr(b.dry,1)+' t à sec + '+fr(b.erg,1)+' t d’ergol)');
|
||
var deficit=b.cons>b.prod;
|
||
W('cpow',fr(b.prod,0)+' kW produits · '+fr(b.cons,1)+' kW consommés'+(deficit?' — DÉFICIT !':''));
|
||
var pe=content.querySelector('[data-o="cpow"]'); if(pe) pe.className=deficit?'scx__bad':'';
|
||
W('cdv',b.dv>0?fr(b.dv/1000,1)+' km/s':'0 km/s — pas d’ergol embarqué');
|
||
var kmF=b.forkR/1000;
|
||
W('cfork',b.dv>0
|
||
?'peut forker d’un agrégat de rayon ≤ '+fr(kmF,0)+' km'+(kmF>=1737?' — ≥ la Lune':(kmF>=400?' — un Sphérion entier':''))
|
||
:'aucun droit de fork motorisé — RCS seulement');
|
||
var rg=content.querySelector('[data-o="creg"]');
|
||
if(rg){ rg.textContent='régime embarqué le + faible : '+b.regime[0]; rg.className='scx__badge '+b.regime[1]; }
|
||
W('cnote',(CFG.energie==='solaire'&&b.erg>0?'⚠ poussée Hall = pics 5-15 kW > 5 kW solaires : pousser par rafales (batteries) ou passer au bion-atome. ':'')
|
||
+(b.ser>=0.8?'La boucle alimentaire partielle est le seul morceau TURFU à bord (MELiSSA, jamais volé). ':'')
|
||
+'Consommables non comptés : ~1 t/an (vivres + pertes). Fork : inverse de v_esc = √(8πGρ/3)·r, ρ = 2 000 kg/m³.');
|
||
}
|
||
|
||
var mineTimer=0;
|
||
function afterCfgChange(){
|
||
updBudget();
|
||
if(mineTimer) clearTimeout(mineTimer);
|
||
mineTimer=setTimeout(function(){ mineTimer=0; if(alive&&E.mine){ E.mine.rebuild(); startLoop(); } },140);
|
||
saveCfg();
|
||
}
|
||
function saveCfg(){
|
||
try{ localStorage.setItem(LS_KEY,JSON.stringify(CFG)); }catch(e){}
|
||
try{ if(window.jOSBoxion&&window.jOSBoxion.saveSoon) window.jOSBoxion.saveSoon('space-cubion','mon-cubion',CFG,'Mon space-cubion'); }catch(e){}
|
||
}
|
||
function applyCfg(c,silent){
|
||
if(!c||typeof c!=='object') return;
|
||
var d={};
|
||
if(typeof c.nom==='string'&&c.nom.trim()) d.nom=c.nom.slice(0,64);
|
||
if(c.energie==='atome'||c.energie==='solaire') d.energie=c.energie;
|
||
if(isFinite(+c.ergol)) d.ergol=Math.max(0,Math.min(4,+c.ergol));
|
||
if(isFinite(+c.blindage)) d.blindage=Math.max(3,Math.min(8,+c.blindage));
|
||
if([0,0.3,0.8].indexOf(+c.serre)>=0) d.serre=+c.serre;
|
||
if(isFinite(+c.hublots)) d.hublots=Math.max(0,Math.min(8,Math.round(+c.hublots)));
|
||
['fusion','forme','soin'].forEach(function(k){ if(typeof c[k]==='boolean') d[k]=c[k]; });
|
||
['coque','accent'].forEach(function(k){ if(typeof c[k]==='string'&&/^#[0-9a-fA-F]{6}$/.test(c[k])) d[k]=c[k]; });
|
||
for(var k2 in d) CFG[k2]=d[k2];
|
||
if(tab==='config') renderContent();
|
||
if(!silent) saveCfg();
|
||
}
|
||
|
||
/* --- le registre des visions (galerie) --- */
|
||
var GAL={loaded:false,err:null,items:[]};
|
||
function fetchGallery(){
|
||
fetch('/px/space-cubion/visions',{credentials:'same-origin',headers:{Accept:'application/json'}})
|
||
.then(function(r){ if(!r.ok) throw r.status; return r.json(); })
|
||
.then(function(d){ if(!alive) return; GAL.loaded=true; GAL.err=null; GAL.items=(d&&d.visions)||[]; renderGallery(); })
|
||
.catch(function(st){ if(!alive) return; GAL.loaded=true;
|
||
GAL.err=(st===404)?'registre bientôt branché':(st===401||st===403||st===419)?'connecte-toi pour voir le registre':'registre indisponible pour l’instant';
|
||
renderGallery(); });
|
||
}
|
||
function renderGallery(){
|
||
var g=content.querySelector('[data-gal]'); if(!g) return;
|
||
if(!GAL.loaded){ g.innerHTML='<div class="sc__note">chargement du registre…</div>'; return; }
|
||
if(GAL.err){ g.innerHTML='<div class="sc__note">'+esc(GAL.err)+'</div>'; return; }
|
||
if(!GAL.items.length){ g.innerHTML='<div class="sc__note">aucune vision publiée — la tienne peut être la première.</div>'; return; }
|
||
g.innerHTML=GAL.items.map(function(v,i){
|
||
var cc=(v.couleurs&&/^#[0-9a-fA-F]{6}$/.test(v.couleurs.coque||''))?v.couleurs.coque:'#6e7b8f';
|
||
var ca=(v.couleurs&&/^#[0-9a-fA-F]{6}$/.test(v.couleurs.accent||''))?v.couleurs.accent:'#5fd0e6';
|
||
var b=calcBudget(v.config||{});
|
||
return '<button type="button" class="scx__gi" data-vi="'+i+'" aria-label="charger la vision '+esc(v.nom||'sans nom')+' en aperçu 3D">'
|
||
+'<span class="scx__sw" style="background:'+cc+'"></span><span class="scx__sw" style="background:'+ca+'"></span>'
|
||
+'<span class="scx__gin">'+esc(v.nom||'sans nom')+'</span>'
|
||
+'<span class="scx__gim">'+esc(v.user_name||'anon')+' · '+esc(String(v.at||'').slice(0,10))
|
||
+' · '+fr(b.mass,0)+' t · Δv '+fr(b.dv/1000,1)+' km/s · fork ≤ '+fr(b.forkR/1000,0)+' km</span>'
|
||
+'</button>';
|
||
}).join('');
|
||
}
|
||
function publish(){
|
||
var btn=content.querySelector('[data-pub]'), st=content.querySelector('[data-pubst]');
|
||
var nom=(CFG.nom||'').trim();
|
||
if(!nom){ if(st) st.textContent='donne d’abord un nom à ton vaisseau'; return; }
|
||
if(btn) btn.disabled=true;
|
||
if(st) st.textContent='publication…';
|
||
var meta=document.querySelector('meta[name="csrf-token"]');
|
||
fetch('/px/space-cubion/vision',{method:'POST',credentials:'same-origin',
|
||
headers:{'Content-Type':'application/json',Accept:'application/json','X-CSRF-TOKEN':meta?(meta.getAttribute('content')||''):''},
|
||
body:JSON.stringify({nom:nom,config:CFG,couleurs:{coque:CFG.coque,accent:CFG.accent}})})
|
||
.then(function(r){ if(!r.ok) throw r.status; return r.json(); })
|
||
.then(function(){ if(!alive) return;
|
||
var st2=content.querySelector('[data-pubst]');
|
||
if(st2) st2.textContent='✓ vision publiée — merci';
|
||
try{ if(window.jOSiOS&&window.jOSiOS.haptic) window.jOSiOS.haptic('light'); }catch(e){}
|
||
GAL.loaded=false; renderGallery(); fetchGallery();
|
||
})
|
||
.catch(function(s2){ if(!alive) return;
|
||
var st2=content.querySelector('[data-pubst]');
|
||
if(st2) st2.textContent=(s2===404)?'registre bientôt branché':(s2===401||s2===403||s2===419)?'connecte-toi pour publier':'échec de publication — réessaie';
|
||
})
|
||
.then(function(){ var b2=content.querySelector('[data-pub]'); if(b2) b2.disabled=false; });
|
||
}
|
||
|
||
function renderContent(){
|
||
if(tab==='concept') content.innerHTML=vConcept();
|
||
else if(tab==='phys'){ content.innerHTML=vPhys(); updPhys(); }
|
||
else if(tab==='paliers') content.innerHTML=vPaliers();
|
||
else if(tab==='nomen') content.innerHTML=vNomen();
|
||
else if(tab==='papier') content.innerHTML=vPapier();
|
||
else if(tab==='config'){
|
||
content.innerHTML=vConfig();
|
||
updBudget();
|
||
renderGallery();
|
||
if(!GAL.loaded) fetchGallery();
|
||
initConfig3D();
|
||
}
|
||
}
|
||
|
||
function setTab(t){
|
||
tab=t;
|
||
root.querySelectorAll('.sc__tab').forEach(function(b){
|
||
var on=b.getAttribute('data-t')===t;
|
||
b.classList.toggle('on',on); b.setAttribute('aria-selected',on?'true':'false');
|
||
});
|
||
var is3d=t==='3d';
|
||
pane3d.classList.toggle('on',is3d);
|
||
content.classList.toggle('on',!is3d);
|
||
if(is3d){ init3D(); startLoop(); }
|
||
else{ renderContent(); if(t!=='config') stopLoop(); }
|
||
}
|
||
|
||
root.querySelector('.sc__tabs').addEventListener('click',function(e){
|
||
var b=e.target.closest('[data-t]'); if(b) setTab(b.getAttribute('data-t'));
|
||
});
|
||
content.addEventListener('input',function(e){
|
||
var el=e.target;
|
||
var s=el.getAttribute&&el.getAttribute('data-s');
|
||
if(s){
|
||
var v=parseFloat(el.value);
|
||
if(s==='d') PH.d=Math.pow(10,v);
|
||
else if(s==='fs') PH.fs=Math.pow(10,v);
|
||
else if(s==='rho') PH.rho=v;
|
||
else if(s==='r') PH.r=Math.pow(10,v);
|
||
else if(s==='amin') PH.amin=Math.pow(10,v);
|
||
else if(s==='dv') PH.dv=Math.pow(10,v);
|
||
else if(s==='ve') PH.ve=Math.pow(10,v);
|
||
updPhys(); return;
|
||
}
|
||
var k=el.getAttribute&&el.getAttribute('data-c');
|
||
if(!k) return;
|
||
if(k==='nom') CFG.nom=String(el.value||'').slice(0,64);
|
||
else if(k==='coque'||k==='accent'){ if(/^#[0-9a-fA-F]{6}$/.test(el.value)) CFG[k]=el.value; }
|
||
else if(k==='fusion'||k==='forme'||k==='soin') CFG[k]=!!el.checked;
|
||
else CFG[k]=parseFloat(el.value)||0;
|
||
afterCfgChange();
|
||
});
|
||
content.addEventListener('click',function(e){
|
||
var px=e.target.closest('[data-openpx]');
|
||
if(px){
|
||
var pid=px.getAttribute('data-openpx');
|
||
try{
|
||
if(window.jOSOp&&jOSOp.openPloxion){ jOSOp.openPloxion(pid); return; } // (jOSOp.open ouvre la barre /op, pas un ploxion — relecture des lanceurs 25.09)
|
||
if(window.jOSMobile&&jOSMobile.open){ jOSMobile.open(pid); return; }
|
||
if(window.jOS&&jOS.openPloxion){ jOS.openPloxion(pid); return; }
|
||
}catch(err){}
|
||
location.href='/local#px='+pid;
|
||
return;
|
||
}
|
||
var b=e.target.closest('[data-preset]');
|
||
if(b){
|
||
PH.d=parseFloat(b.getAttribute('data-preset'));
|
||
var sl=content.querySelector('input[data-s="d"]'); if(sl) sl.value=Math.log10(PH.d);
|
||
updPhys(); return;
|
||
}
|
||
var pl=e.target.closest('[data-cp]');
|
||
if(pl){
|
||
var key=pl.getAttribute('data-cp'), val=pl.getAttribute('data-cv');
|
||
CFG[key]=(key==='energie')?val:parseFloat(val);
|
||
content.querySelectorAll('[data-cp="'+key+'"]').forEach(function(el){
|
||
var on=el===pl;
|
||
el.classList.toggle('on',on); el.setAttribute('aria-checked',on?'true':'false');
|
||
});
|
||
afterCfgChange(); return;
|
||
}
|
||
if(e.target.closest('[data-pub]')){ publish(); return; }
|
||
var gi=e.target.closest('[data-vi]');
|
||
if(gi){
|
||
var v=GAL.items[+gi.getAttribute('data-vi')];
|
||
if(v){
|
||
var c=Object.assign({},v.config||{});
|
||
if(v.nom) c.nom=v.nom;
|
||
if(v.couleurs){ c.coque=v.couleurs.coque; c.accent=v.couleurs.accent; }
|
||
applyCfg(c,true);
|
||
var st=content.querySelector('[data-pubst]');
|
||
if(st) st.textContent='vision « '+((v.nom||'sans nom').slice(0,30))+' » chargée en aperçu — édite et republie pour la faire tienne';
|
||
}
|
||
}
|
||
});
|
||
|
||
/* restore : brouillon localStorage puis boxion (le boxion gagne, cross-device) */
|
||
try{ var ls=localStorage.getItem(LS_KEY); if(ls) applyCfg(JSON.parse(ls),true); }catch(e){}
|
||
try{
|
||
if(window.jOSBoxion&&window.jOSBoxion.get){
|
||
Promise.resolve(window.jOSBoxion.get('space-cubion','mon-cubion'))
|
||
.then(function(v){ if(alive&&v&&typeof v==='object') applyCfg(v,true); })
|
||
.catch(function(){});
|
||
}
|
||
}catch(e){}
|
||
|
||
setTab('3d');
|
||
|
||
return { unmount:function(){
|
||
alive=false;
|
||
stopLoop();
|
||
if(mineTimer){ clearTimeout(mineTimer); mineTimer=0; }
|
||
try{ if(E.onVis){ document.removeEventListener('visibilitychange',E.onVis); E.onVis=null; } }catch(e){}
|
||
try{ if(E.ro){ E.ro.disconnect(); E.ro=null; } }catch(e){}
|
||
if(E.winResize){ window.removeEventListener('resize',E.winResize); E.winResize=null; }
|
||
try{ if(E.stage&&E.stage.mesh&&E.stage.mesh.dispose) E.stage.mesh.dispose(); }catch(e){}
|
||
try{ if(E.mine&&E.mine.clear) E.mine.clear(); }catch(e){}
|
||
var all=E.stageDisp.concat(E.mineDisp);
|
||
for(var k=0;k<all.length;k++){ try{ if(all[k].dispose) all[k].dispose(); }catch(e){} }
|
||
E.stageDisp.length=0; E.mineDisp.length=0;
|
||
try{ if(E.renderer){ E.renderer.dispose(); if(E.renderer.forceContextLoss) E.renderer.forceContextLoss(); } }catch(e){}
|
||
E.renderer=null; E.canvas=null; E.stage=null; E.mine=null; E.THREE=null;
|
||
container.innerHTML='';
|
||
}};
|
||
}
|
||
|
||
// ===== XUI (contrat v0, bion jOSXui) : describe() = MON cubion configuré, non monté =====
|
||
// p1 = mon space-cubion (LA donnée maîtresse : xb:space-cubion:mon-cubion, le brouillon du
|
||
// configurateur) + sa réserve de Δv (mêmes formules/constantes que calcBudget, v_e=25 km/s).
|
||
// Pur, jamais le DOM, ne throw jamais.
|
||
function describe(){
|
||
var items=[];
|
||
try{
|
||
var c=null; try{ c=JSON.parse(localStorage.getItem('xb:space-cubion:mon-cubion')); }catch(e){}
|
||
if(c&&typeof c==='object'){
|
||
// mêmes bornes + Tsiolkovsky que calcBudget (v_e = 25 km/s, propu Hall)
|
||
var hub=Math.max(0,Math.min(8,Math.round(+c.hublots||0)));
|
||
var erg=Math.max(0,Math.min(4,isFinite(+c.ergol)?+c.ergol:0));
|
||
var bli=Math.max(3,Math.min(8,isFinite(+c.blindage)?+c.blindage:3));
|
||
var ser=[0,0.3,0.8].indexOf(+c.serre)>=0?+c.serre:0;
|
||
var atome=c.energie==='atome';
|
||
var mass=(4+hub*0.25)+2+1.5+0.15+(atome?2:0.5)+(0.5+erg)+bli+ser+(c.forme?0.1:0)+(c.soin?0.1:0);
|
||
var dv=erg>0?25000*Math.log(mass/(mass-erg)):0;
|
||
items.push({ p:1, kind:'stat', label:'🛸 '+String(c.nom||'Mon space-cubion'), value:Math.round(dv)+' m/s de Δv' });
|
||
items.push({ p:2, kind:'stat', label:'masse', value:Math.round(mass*10)/10, unit:'t' });
|
||
items.push({ p:2, kind:'stat', label:'énergie', value:atome?'atome':'solaire' });
|
||
items.push({ p:3, kind:'stat', label:'blindage', value:bli, unit:'t' });
|
||
items.push({ p:3, kind:'stat', label:'ergol', value:erg, unit:'t' });
|
||
} else {
|
||
items.push({ p:1, kind:'stat', label:'🛸 space-cubion', value:'pas encore configuré' });
|
||
items.push({ p:2, kind:'text', label:'vaisseau', value:'arête 4 m · 2⁸ bions de 16 mm' });
|
||
}
|
||
}catch(e){ items=[{ p:1, kind:'text', label:'🛸 space-cubion', value:'config indisponible' }]; }
|
||
return { v:1, id:ID, title:'Space Cubion', icon:'🛸', items:items };
|
||
}
|
||
|
||
window.jOSApps=window.jOSApps||{};
|
||
window.jOSApps[ID]={manifest:{id:ID,name:'Space Cubion',icon:'🛸'},mount:mount,describe:describe};
|
||
})();
|
||
</script>
|