MCPcopy Create free account
hub / github.com/collidingScopes/iron-interface / initGUI

Function initGUI

main.js:367–409  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

365
366// --- DAT.GUI ---
367function initGUI() {
368// Check if dat exists
369if (typeof dat === 'undefined') {
370console.warn("dat.GUI library not found. GUI controls will be unavailable.");
371return; // Exit if dat.GUI is not loaded
372}
373
374try {
375// Create GUI
376gui = new dat.GUI({ width: 300 });
377gui.close(); // Start with closed panel
378
379// --- Animation Parameters ---
380const animFolder = gui.addFolder('Animation');
381// Remove cameraSpeed option since we're not using default camera movement
382animFolder.add(params, 'waveIntensity', 0, 1, 0.05).name('Wave Intensity');
383animFolder.add(params, 'transitionSpeed', 0.001, 0.05, 0.001).name('Transition Speed');
384animFolder.open();
385
386// --- Visual Parameters ---
387const visualFolder = gui.addFolder('Visual');
388visualFolder.add(params, 'particleSize', 0.1, 10, 0.1).onChange(function(value) {
389 if (particles && particles.material) {
390 particles.material.size = value;
391 }
392}).name('Particle Size');
393visualFolder.open();
394
395// --- Pattern Controls ---
396gui.add(params, 'changePattern').name('Next Pattern');
397
398// Add GUI styling (optional)
399const guiElement = document.querySelector('.dg.ac');
400if (guiElement) {
401 guiElement.style.zIndex = "1000"; // Ensure GUI is above other elements
402}
403
404} catch (error) {
405console.error("Error initializing dat.GUI:", error);
406if(gui) gui.destroy(); // Clean up partial GUI if error occurred
407gui = null;
408}
409}
410
411// --- Updated onResults with Pinch and Rotation ---
412function onResults(results) {

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected