diff --git a/panther.js b/panther.js index 658ea82a2eccb45e6e53a15ae845ec06c893028b..bc8f3e05d5cf209ef361e9d23dceca0267aaf67c 100644 --- a/panther.js +++ b/panther.js @@ -842,9 +842,9 @@ function initVar(name, defaultVal) { return document.location.search.indexOf(name)>-1? document.location.search.split(name+'=')[1].split('&')[0]: defaultVal; } - const tourSpeed = 10; // speed [m/s] - const tourPeriod = initVar('tourPeriod', 20); - const alphaPerPeriod = 0.008; + const tourSpeed = 20; // speed [m/s] + let tourPeriod = initVar('tourPeriod', 10); + let alphaPerPeriod = 0.009; const tourBackets = initVar('tourBackets', 15); const tourBacketSize = initVar('tourBacketSize', 0.1); const tourBacketsDistance = initVar('tourBacketsDistance', 1500); @@ -874,15 +874,18 @@ } function tour(facility, section, pos, alpha, step, maxSteps) { if (step==maxSteps) { + alphaPerPeriod = 0.008; if (facility=='preinjector') { facility = 'booster'; const preinjRotate = initVar('preinjRotate', 0.5); camera.rotateY(-Math.PI*preinjRotate); - section = 27; + section = 0; pos = 0; step = 0; maxSteps = 40; console.log('camera.rotateY()', -180*preinjRotate, maxSteps); + alphaPerPeriod = 0.1; + tourPeriod = 3000; } else if (facility=='booster') { facility = 'bts'; @@ -898,7 +901,7 @@ section = 0; pos = 0; step = 0; - camera.rotateY(-Math.PI*preinjRotate); + camera.rotateY(-Math.PI*1.5); maxSteps = 3000; } } @@ -928,13 +931,13 @@ pos = pos+tourSpeed*tourPeriod - d; } else pos = pos+tourSpeed*tourPeriod; - const alphaFactor = facility=='sr'? 0.6: 8; + const alphaFactor = facility=='sr'? 0.77: 0.6; if (params.tour) setTimeout(tour, tourPeriod, facility, section, pos, (alpha<0? 2*Math.PI+alpha: alpha)*alphaFactor, step, maxSteps); } } function preTour(step, steps, facility, section, cameraPos, preFactor) { console.log(step, facility, section, lattice); - const pos = facility=='preinjector'? -10000: 0; + const pos = facility=='preinjector'? -20000: 0; const maxSteps = facility=='preinjector'? 3: 10000; const bx = (lattice[facility].sections[section].start.x-pos)*tourTransverse; const bz = (lattice[facility].sections[section].start.z)*tourTransverse;