@holoscript/core 8.0.1 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{GLTFPipeline-N6B6PJ6G.cjs → GLTFPipeline-76QTLF4Z.cjs} +9 -9
  2. package/dist/{GLTFPipeline-P3WMNYCN.js → GLTFPipeline-ES5YMBGT.js} +5 -5
  3. package/dist/HoloScriptRuntime-2DDYOPOR.js +10 -0
  4. package/dist/{HoloScriptRuntime-VJ374RER.cjs → HoloScriptRuntime-ZGRR5EB3.cjs} +5 -5
  5. package/dist/{chunk-J52VSAQ7.js → chunk-3OYVN53V.js} +3 -3
  6. package/dist/{chunk-ALC6K7GL.cjs → chunk-3OZACAFQ.cjs} +11 -7
  7. package/dist/{chunk-MQWAT42R.cjs → chunk-DAKRKDZV.cjs} +27 -38
  8. package/dist/{chunk-HR2OSYVQ.js → chunk-DXWOTOUK.js} +3 -3
  9. package/dist/{chunk-YVOAF4ML.js → chunk-E47Z63DF.js} +3 -3
  10. package/dist/{chunk-BGY3SDG3.js → chunk-FS7BFHFN.js} +7 -3
  11. package/dist/{chunk-KHDZJE5D.cjs → chunk-FXIO6GHT.cjs} +5 -5
  12. package/dist/{chunk-SMIWS6DE.cjs → chunk-IELX2OKI.js} +118 -7
  13. package/dist/{chunk-L5LKKENW.cjs → chunk-IMGDUSTT.cjs} +4 -4
  14. package/dist/{chunk-JIBL5LRK.js → chunk-KFIXE2MB.js} +14 -5
  15. package/dist/{chunk-7T25IEZ2.js → chunk-LCEXRE5Z.js} +3 -3
  16. package/dist/{chunk-7V4JI5TB.cjs → chunk-LKBTCABN.cjs} +6 -6
  17. package/dist/{chunk-CSD27UNQ.js → chunk-LOGP3JWH.js} +5 -5
  18. package/dist/{chunk-FL33V6U7.js → chunk-NNFA2C3Y.js} +3 -3
  19. package/dist/{chunk-K574J76X.cjs → chunk-O7WLJ53D.cjs} +3 -3
  20. package/dist/{chunk-4GU5GCIY.js → chunk-QRPRIJ2W.js} +145 -4
  21. package/dist/{chunk-CR7XRXRN.cjs → chunk-RMTPN3G4.cjs} +5 -5
  22. package/dist/{chunk-AOVGZ25K.cjs → chunk-SMRVK6BI.cjs} +5 -5
  23. package/dist/{chunk-X3UVCWNL.cjs → chunk-U7IUS5HJ.cjs} +8 -8
  24. package/dist/{chunk-6Q7RC2MK.cjs → chunk-UPXIY52O.cjs} +147 -3
  25. package/dist/{chunk-RARB3MBR.js → chunk-YDPEHCCI.cjs} +127 -3
  26. package/dist/{chunk-E6XXE66V.js → chunk-ZPYP4RBA.js} +3 -3
  27. package/dist/compiler/gltf-pipeline.cjs +8 -8
  28. package/dist/compiler/gltf-pipeline.js +1 -1
  29. package/dist/compiler/index.cjs +41 -41
  30. package/dist/compiler/index.js +7 -7
  31. package/dist/compiler/r3f.cjs +8 -8
  32. package/dist/compiler/r3f.js +3 -3
  33. package/dist/debugger.cjs +5 -5
  34. package/dist/debugger.js +3 -3
  35. package/dist/index.cjs +305 -397
  36. package/dist/index.js +12 -104
  37. package/dist/reconstruction/index.cjs +31 -31
  38. package/dist/reconstruction/index.js +2 -2
  39. package/dist/runtime.cjs +150 -293
  40. package/dist/runtime.js +82 -23
  41. package/dist/traits/botanical-lotus.cjs +60 -44
  42. package/dist/traits/botanical-lotus.js +2 -2
  43. package/dist/traits/index.cjs +481 -465
  44. package/dist/traits/index.js +5 -5
  45. package/package.json +20 -20
  46. package/dist/HoloScriptRuntime-CBYJX3LZ.js +0 -10
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkALC6K7GL_cjs = require('./chunk-ALC6K7GL.cjs');
3
+ var chunk3OZACAFQ_cjs = require('./chunk-3OZACAFQ.cjs');
4
4
  var chunk5S7RKFGR_cjs = require('./chunk-5S7RKFGR.cjs');
5
5
  var chunkOIQYIIO3_cjs = require('./chunk-OIQYIIO3.cjs');
6
6
  var chunkAIA52I7T_cjs = require('./chunk-AIA52I7T.cjs');
@@ -2564,7 +2564,7 @@ var init_NIRCompiler = chunkHCCQLAA4_cjs.__esm({
2564
2564
 
2565
2565
  // src/compiler/USDZPipeline.ts
2566
2566
  chunkHKEXJUWS_cjs.init_DomainBlockCompilerMixin();
2567
- chunkALC6K7GL_cjs.init_R3FCompiler();
2567
+ chunk3OZACAFQ_cjs.init_R3FCompiler();
2568
2568
  function presetString(p, k) {
2569
2569
  const v = p[k];
2570
2570
  return typeof v === "string" ? v : void 0;
@@ -2795,8 +2795,8 @@ ${domainBlocksOutput}` : materials,
2795
2795
  const matName = `Material_${this.sanitizeName(obj.name)}`;
2796
2796
  const mat = { name: matName };
2797
2797
  const presetName = typeof material === "string" ? material : typeof materialPreset === "string" ? materialPreset : void 0;
2798
- if (presetName && chunkALC6K7GL_cjs.MATERIAL_PRESETS[presetName]) {
2799
- const preset = chunkALC6K7GL_cjs.MATERIAL_PRESETS[presetName];
2798
+ if (presetName && chunk3OZACAFQ_cjs.MATERIAL_PRESETS[presetName]) {
2799
+ const preset = chunk3OZACAFQ_cjs.MATERIAL_PRESETS[presetName];
2800
2800
  const colorStr = presetString(preset, "color");
2801
2801
  if (colorStr) mat.baseColor = this.hexToRGB(colorStr);
2802
2802
  const metal = presetNumber(preset, "metalness");
@@ -6943,5 +6943,5 @@ exports.runSafetyPass = runSafetyPass;
6943
6943
  exports.selectModality = selectModality;
6944
6944
  exports.selectModalityForAll = selectModalityForAll;
6945
6945
  exports.spatialPartition = spatialPartition;
6946
- //# sourceMappingURL=chunk-7V4JI5TB.cjs.map
6947
- //# sourceMappingURL=chunk-7V4JI5TB.cjs.map
6946
+ //# sourceMappingURL=chunk-LKBTCABN.cjs.map
6947
+ //# sourceMappingURL=chunk-LKBTCABN.cjs.map
@@ -2,9 +2,9 @@ import { computeHoloMapReplayFingerprint } from './chunk-WNNE3PO3.js';
2
2
  import { isWebGpuEnvironmentPresent, HOLOMAP_SIMULATION_CONTRACT_KIND } from './chunk-YF2I3MV3.js';
3
3
 
4
4
  // src/version.ts
5
- var HOLOSCRIPT_VERSION = "8.0.1" ;
6
- var GIT_COMMIT_SHA = "efb467dce" ;
7
- var BUILD_TIMESTAMP = "2026-06-04T22:03:08.151Z" ;
5
+ var HOLOSCRIPT_VERSION = "8.0.2" ;
6
+ var GIT_COMMIT_SHA = "9c4778c0c" ;
7
+ var BUILD_TIMESTAMP = "2026-06-04T23:03:35.165Z" ;
8
8
  function getVersionString() {
9
9
  const sha = `+${GIT_COMMIT_SHA}` ;
10
10
  return `${HOLOSCRIPT_VERSION}${sha}`;
@@ -2172,5 +2172,5 @@ function createHoloMapRuntime(_config) {
2172
2172
  }
2173
2173
 
2174
2174
  export { BUILD_TIMESTAMP, GIT_COMMIT_SHA, HOLOMAP_DEFAULTS, HOLOSCRIPT_VERSION, assertWeightCid, createHoloMapMicroEncoder, createHoloMapRunId, createHoloMapRuntime, frameToMicroImage, getCachedWeightBlob, getVersionInfo, getVersionString, loadHoloMapWeightBlob, logHoloMapEvent, normalizeWeightCidDigest, putCachedWeightBlob, resetHoloMapTelemetryForTests, runHoloMapMicroEncoderCpu, tryCreateHoloMapEncoderDevice };
2175
- //# sourceMappingURL=chunk-CSD27UNQ.js.map
2176
- //# sourceMappingURL=chunk-CSD27UNQ.js.map
2175
+ //# sourceMappingURL=chunk-LOGP3JWH.js.map
2176
+ //# sourceMappingURL=chunk-LOGP3JWH.js.map
@@ -1,4 +1,4 @@
1
- import { HoloScriptRuntime } from './chunk-JIBL5LRK.js';
1
+ import { HoloScriptRuntime } from './chunk-KFIXE2MB.js';
2
2
  import { HoloScriptCodeParser } from './chunk-URG2SJLK.js';
3
3
 
4
4
  // src/HoloScriptDebugger.ts
@@ -417,5 +417,5 @@ function createDebugger(runtime) {
417
417
  }
418
418
 
419
419
  export { HoloScriptDebugger, createDebugger };
420
- //# sourceMappingURL=chunk-FL33V6U7.js.map
421
- //# sourceMappingURL=chunk-FL33V6U7.js.map
420
+ //# sourceMappingURL=chunk-NNFA2C3Y.js.map
421
+ //# sourceMappingURL=chunk-NNFA2C3Y.js.map
@@ -437,7 +437,7 @@ function uint8ArrayToBase64(data) {
437
437
  return btoa(binary);
438
438
  }
439
439
  async function importGLTFPipeline() {
440
- return import('./GLTFPipeline-N6B6PJ6G.cjs');
440
+ return import('./GLTFPipeline-76QTLF4Z.cjs');
441
441
  }
442
442
  function registerGLTFTools(server) {
443
443
  for (const tool of GLTF_PIPELINE_TOOLS) {
@@ -453,5 +453,5 @@ exports.handleGLTFToolCall = handleGLTFToolCall;
453
453
  exports.inspectComposition = inspectComposition;
454
454
  exports.registerGLTFTools = registerGLTFTools;
455
455
  exports.validateForGLTF = validateForGLTF;
456
- //# sourceMappingURL=chunk-K574J76X.cjs.map
457
- //# sourceMappingURL=chunk-K574J76X.cjs.map
456
+ //# sourceMappingURL=chunk-O7WLJ53D.cjs.map
457
+ //# sourceMappingURL=chunk-O7WLJ53D.cjs.map
@@ -521,6 +521,137 @@ function generateBotanicalRoughnessMap(opts) {
521
521
  }
522
522
  return { width: size, height: size, data };
523
523
  }
524
+ function lotusSmoothstep(edge0, edge1, x) {
525
+ const t = Math.min(1, Math.max(0, (x - edge0) / (edge1 - edge0)));
526
+ return t * t * (3 - 2 * t);
527
+ }
528
+ function lotusPetalHalfWidthFraction(v) {
529
+ const broad = Math.sin(Math.PI * Math.pow(v, 0.8));
530
+ const tipPoint = 1 - lotusSmoothstep(0.82, 1, v) * 0.55;
531
+ return Math.max(0, broad * tipPoint);
532
+ }
533
+ function buildLotusPetalGeometryData(params = {}) {
534
+ const P = { ...DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS, ...params };
535
+ const nu = Math.max(2, Math.floor(P.segmentsU));
536
+ const nv = Math.max(2, Math.floor(P.segmentsV));
537
+ const cols = nu + 1;
538
+ const rows = nv + 1;
539
+ const vertexCount = cols * rows;
540
+ const halfWidthMax = P.width * 0.5;
541
+ const positions = new Float32Array(vertexCount * 3);
542
+ const normals = new Float32Array(vertexCount * 3);
543
+ const petalUv = new Float32Array(vertexCount * 2);
544
+ const veinPhase = new Float32Array(vertexCount);
545
+ const pos = (u, v) => {
546
+ const su = 2 * u - 1;
547
+ const hw = lotusPetalHalfWidthFraction(v) * halfWidthMax;
548
+ const x = su * hw;
549
+ const y = v * P.length;
550
+ const cup = P.cup * halfWidthMax * (su * su);
551
+ const ridge = P.ridge * Math.exp(-(su * su) / (2 * 0.16 * 0.16)) * lotusSmoothstep(0, 0.3, v) * (1 - 0.4 * v);
552
+ const sag = P.gravitySag * v * v * P.length;
553
+ return [x, y, cup + ridge - sag];
554
+ };
555
+ for (let j = 0; j < rows; j += 1) {
556
+ const v = j / nv;
557
+ for (let i = 0; i < cols; i += 1) {
558
+ const u = i / nu;
559
+ const idx = j * cols + i;
560
+ const [x, y, z] = pos(u, v);
561
+ positions[idx * 3] = x;
562
+ positions[idx * 3 + 1] = y;
563
+ positions[idx * 3 + 2] = z;
564
+ petalUv[idx * 2] = u;
565
+ petalUv[idx * 2 + 1] = v;
566
+ veinPhase[idx] = P.veinPhase;
567
+ const eps = 1e-3;
568
+ const pu0 = pos(Math.max(0, u - eps), v);
569
+ const pu1 = pos(Math.min(1, u + eps), v);
570
+ const pv0 = pos(u, Math.max(0, v - eps));
571
+ const pv1 = pos(u, Math.min(1, v + eps));
572
+ const dux = pu1[0] - pu0[0];
573
+ const duy = pu1[1] - pu0[1];
574
+ const duz = pu1[2] - pu0[2];
575
+ const dvx = pv1[0] - pv0[0];
576
+ const dvy = pv1[1] - pv0[1];
577
+ const dvz = pv1[2] - pv0[2];
578
+ let nx = duy * dvz - duz * dvy;
579
+ let ny = duz * dvx - dux * dvz;
580
+ let nz = dux * dvy - duy * dvx;
581
+ const len = Math.hypot(nx, ny, nz);
582
+ if (len < 1e-8) {
583
+ nx = 0;
584
+ ny = 0;
585
+ nz = 1;
586
+ } else {
587
+ nx /= len;
588
+ ny /= len;
589
+ nz /= len;
590
+ if (nz < 0) {
591
+ nx = -nx;
592
+ ny = -ny;
593
+ nz = -nz;
594
+ }
595
+ }
596
+ normals[idx * 3] = nx;
597
+ normals[idx * 3 + 1] = ny;
598
+ normals[idx * 3 + 2] = nz;
599
+ }
600
+ }
601
+ const indices = new Uint32Array(nu * nv * 6);
602
+ let k = 0;
603
+ for (let j = 0; j < nv; j += 1) {
604
+ for (let i = 0; i < nu; i += 1) {
605
+ const a = j * cols + i;
606
+ const b = a + 1;
607
+ const c = a + cols;
608
+ const d = c + 1;
609
+ indices[k] = a;
610
+ indices[k + 1] = b;
611
+ indices[k + 2] = c;
612
+ indices[k + 3] = b;
613
+ indices[k + 4] = d;
614
+ indices[k + 5] = c;
615
+ k += 6;
616
+ }
617
+ }
618
+ return { positions, normals, petalUv, veinPhase, indices, vertexCount };
619
+ }
620
+ function lotusPetalGeometryParamsFromProfile(profile, options = {}) {
621
+ const rings = profile.petal_rings;
622
+ const ring = (options.ring ? rings.find((r) => r.name === options.ring) : void 0) ?? rings[rings.length - 1];
623
+ const { ring: _ring, ...overrides } = options;
624
+ return {
625
+ ...DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS,
626
+ ...ring ? { length: ring.length, width: ring.width, cup: ring.cup, gravitySag: ring.gravity_sag } : {},
627
+ ...overrides
628
+ };
629
+ }
630
+ function buildLotusFlowerPlacements(profile = createBotanicalLotusRenderProfile(), options = {}) {
631
+ const radiusScale = options.radiusScale ?? 0.5;
632
+ const ringLift = options.ringLift ?? 0.12;
633
+ const goldenAngle = LOTUS_GOLDEN_ANGLE_DEG * Math.PI / 180;
634
+ const placements = [];
635
+ let globalIndex = 0;
636
+ profile.petal_rings.forEach((ring, idx) => {
637
+ const ringNum = idx + 1;
638
+ const scale = LOTUS_RING_SCALING[ringNum] ?? LOTUS_RING_SCALING[3];
639
+ const radius = ring.radius * scale.radius * radiusScale;
640
+ const tilt = (90 - ring.pitch_degrees) * Math.PI / 180;
641
+ const lift = (profile.petal_rings.length - ringNum) * ringLift;
642
+ for (let i = 0; i < ring.count; i += 1) {
643
+ placements.push({
644
+ azimuth: globalIndex * goldenAngle,
645
+ tilt,
646
+ radius,
647
+ lift,
648
+ ring: ringNum
649
+ });
650
+ globalIndex += 1;
651
+ }
652
+ });
653
+ return placements;
654
+ }
524
655
  function lotusMulberry32(seed) {
525
656
  let a = seed >>> 0;
526
657
  return () => {
@@ -1015,7 +1146,7 @@ function lotusPetalTurgorOpenProgress(state) {
1015
1146
  const tip = lotusPetalTurgorTipDeg(state);
1016
1147
  return Math.max(0, Math.min(1, (250 - tip) / (250 - 76)));
1017
1148
  }
1018
- var DEFAULT_BOTANICAL_LOTUS_CONFIG, SHA256_HASH_PATTERN, HEX_COLOR_PATTERN, RING_RENDER_DEFAULTS, botanicalLotusHandler, LOTUS_GOLDEN_ANGLE_DEG, LOTUS_GROWTH_SECONDS, LOTUS_GENESIS_SEED_PLACEHOLDER, LOTUS_RING_SCALING, LOTUS_OUTER_PETAL_COLOR, LOTUS_PETAL_NAME_RE, LOTUS_PETAL_SHADER_CHUNKS, LOTUS_PETAL_CHUNK_ENTRIES, LOTUS_PETAL_DEFAULT_DYNAMIC, LOTUS_PETAL_UNIFORM_BINDINGS;
1149
+ var DEFAULT_BOTANICAL_LOTUS_CONFIG, SHA256_HASH_PATTERN, HEX_COLOR_PATTERN, RING_RENDER_DEFAULTS, botanicalLotusHandler, LOTUS_GOLDEN_ANGLE_DEG, LOTUS_GROWTH_SECONDS, LOTUS_GENESIS_SEED_PLACEHOLDER, LOTUS_RING_SCALING, LOTUS_OUTER_PETAL_COLOR, LOTUS_PETAL_NAME_RE, LOTUS_PETAL_SHADER_CHUNKS, LOTUS_PETAL_CHUNK_ENTRIES, LOTUS_PETAL_DEFAULT_DYNAMIC, LOTUS_PETAL_UNIFORM_BINDINGS, DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS;
1019
1150
  var init_BotanicalLotusTrait = __esm({
1020
1151
  "src/traits/BotanicalLotusTrait.ts"() {
1021
1152
  DEFAULT_BOTANICAL_LOTUS_CONFIG = {
@@ -1376,9 +1507,19 @@ totalEmissiveRadiance += lotusScatter * (0.28 + uLotusBloom * 0.72);`
1376
1507
  uLotusBloom: "bloom",
1377
1508
  uLotusTime: "time"
1378
1509
  };
1510
+ DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS = {
1511
+ length: 1.7,
1512
+ width: 1.1,
1513
+ cup: 0.34,
1514
+ ridge: 0.12,
1515
+ gravitySag: 0.18,
1516
+ segmentsU: 24,
1517
+ segmentsV: 40,
1518
+ veinPhase: 0
1519
+ };
1379
1520
  }
1380
1521
  });
1381
1522
 
1382
- export { DEFAULT_BOTANICAL_LOTUS_CONFIG, LOTUS_GENESIS_SEED_PLACEHOLDER, LOTUS_GOLDEN_ANGLE_DEG, LOTUS_GROWTH_SECONDS, LOTUS_OUTER_PETAL_COLOR, LOTUS_PETAL_CHUNK_ENTRIES, LOTUS_PETAL_SHADER_CHUNKS, LOTUS_PETAL_UNIFORM_BINDINGS, LOTUS_RING_SCALING, assertBotanicalLotusConfig, botanicalLotusHandler, buildLotusPetalMaterialSpec, buildLotusSceneFromComposition, createBotanicalLotusRenderProfile, createLotusMeristem, createLotusMorphogen, createLotusMorphogen2D, createLotusPetalTurgor, createLotusPond, deriveBotanicalLotusAnchorStatus, deriveLotusBloomFromGlow, disturbLotusPond, generateBotanicalNormalMap, generateBotanicalRoughnessMap, getBotanicalLotusPetalCount, init_BotanicalLotusTrait, lotusMorphogen2DPeaks, lotusMorphogen2DSampleAt, lotusMorphogenPeaks, lotusPetalRenderColor, lotusPetalTurgorOpenProgress, lotusPetalTurgorTipDeg, lotusPondSurface, normalizeBotanicalLotusConfig, simulateLotusMorphogenesis, simulateLotusPetalGrowth, simulateLotusPhyllotaxis, stepLotusMeristem, stepLotusMorphogen, stepLotusMorphogen2D, stepLotusPetalTurgor, stepLotusPond, validateBotanicalLotusConfig };
1383
- //# sourceMappingURL=chunk-4GU5GCIY.js.map
1384
- //# sourceMappingURL=chunk-4GU5GCIY.js.map
1523
+ export { DEFAULT_BOTANICAL_LOTUS_CONFIG, DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS, LOTUS_GENESIS_SEED_PLACEHOLDER, LOTUS_GOLDEN_ANGLE_DEG, LOTUS_GROWTH_SECONDS, LOTUS_OUTER_PETAL_COLOR, LOTUS_PETAL_CHUNK_ENTRIES, LOTUS_PETAL_SHADER_CHUNKS, LOTUS_PETAL_UNIFORM_BINDINGS, LOTUS_RING_SCALING, assertBotanicalLotusConfig, botanicalLotusHandler, buildLotusFlowerPlacements, buildLotusPetalGeometryData, buildLotusPetalMaterialSpec, buildLotusSceneFromComposition, createBotanicalLotusRenderProfile, createLotusMeristem, createLotusMorphogen, createLotusMorphogen2D, createLotusPetalTurgor, createLotusPond, deriveBotanicalLotusAnchorStatus, deriveLotusBloomFromGlow, disturbLotusPond, generateBotanicalNormalMap, generateBotanicalRoughnessMap, getBotanicalLotusPetalCount, init_BotanicalLotusTrait, lotusMorphogen2DPeaks, lotusMorphogen2DSampleAt, lotusMorphogenPeaks, lotusPetalGeometryParamsFromProfile, lotusPetalRenderColor, lotusPetalTurgorOpenProgress, lotusPetalTurgorTipDeg, lotusPondSurface, normalizeBotanicalLotusConfig, simulateLotusMorphogenesis, simulateLotusPetalGrowth, simulateLotusPhyllotaxis, stepLotusMeristem, stepLotusMorphogen, stepLotusMorphogen2D, stepLotusPetalTurgor, stepLotusPond, validateBotanicalLotusConfig };
1524
+ //# sourceMappingURL=chunk-QRPRIJ2W.js.map
1525
+ //# sourceMappingURL=chunk-QRPRIJ2W.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkKHDZJE5D_cjs = require('./chunk-KHDZJE5D.cjs');
3
+ var chunkFXIO6GHT_cjs = require('./chunk-FXIO6GHT.cjs');
4
4
 
5
5
  // src/reconstruction/FusedAttentionKernel.ts
6
6
  var FUSED_ATTENTION_WGSL = `
@@ -585,9 +585,9 @@ function mobileSensorBundleToFrames(bundle) {
585
585
  }
586
586
  async function replayMobileSensorBundle(bundle, config = {}) {
587
587
  const frames = mobileSensorBundleToFrames(bundle);
588
- const runtime = chunkKHDZJE5D_cjs.createHoloMapRuntime();
588
+ const runtime = chunkFXIO6GHT_cjs.createHoloMapRuntime();
589
589
  await runtime.init({
590
- ...chunkKHDZJE5D_cjs.HOLOMAP_DEFAULTS,
590
+ ...chunkFXIO6GHT_cjs.HOLOMAP_DEFAULTS,
591
591
  seed: 0,
592
592
  modelHash: bundle.bundleId,
593
593
  videoHash: bundle.bundleId,
@@ -635,5 +635,5 @@ exports.mergeAnchoredProvenance = mergeAnchoredProvenance;
635
635
  exports.mobileSensorBundleToFrames = mobileSensorBundleToFrames;
636
636
  exports.replayMobileSensorBundle = replayMobileSensorBundle;
637
637
  exports.validateMobileSensorBundle = validateMobileSensorBundle;
638
- //# sourceMappingURL=chunk-CR7XRXRN.cjs.map
639
- //# sourceMappingURL=chunk-CR7XRXRN.cjs.map
638
+ //# sourceMappingURL=chunk-RMTPN3G4.cjs.map
639
+ //# sourceMappingURL=chunk-RMTPN3G4.cjs.map
@@ -5,7 +5,7 @@ var chunk3FOKASKO_cjs = require('./chunk-3FOKASKO.cjs');
5
5
  var chunk4PDEPEQW_cjs = require('./chunk-4PDEPEQW.cjs');
6
6
  var chunkXJAN7CZG_cjs = require('./chunk-XJAN7CZG.cjs');
7
7
  var chunkXHIV6326_cjs = require('./chunk-XHIV6326.cjs');
8
- var chunk6Q7RC2MK_cjs = require('./chunk-6Q7RC2MK.cjs');
8
+ var chunkUPXIY52O_cjs = require('./chunk-UPXIY52O.cjs');
9
9
  var chunkTVHSPJ4N_cjs = require('./chunk-TVHSPJ4N.cjs');
10
10
  var chunkILRBGFVD_cjs = require('./chunk-ILRBGFVD.cjs');
11
11
  var chunkE7JP3BS3_cjs = require('./chunk-E7JP3BS3.cjs');
@@ -54819,7 +54819,7 @@ var gotchaHandler = {
54819
54819
  };
54820
54820
 
54821
54821
  // src/traits/VRTraitSystem.ts
54822
- chunk6Q7RC2MK_cjs.init_BotanicalLotusTrait();
54822
+ chunkUPXIY52O_cjs.init_BotanicalLotusTrait();
54823
54823
 
54824
54824
  // src/traits/FluidSimulationTrait.ts
54825
54825
  var SpatialHash = class {
@@ -55749,7 +55749,7 @@ var VRTraitRegistry = class {
55749
55749
  for (const handler of vfxParticleHandlers) this.register(handler);
55750
55750
  this.register(gpuPhysicsHandler);
55751
55751
  this.register(gpuBufferHandler);
55752
- this.register(chunk6Q7RC2MK_cjs.botanicalLotusHandler);
55752
+ this.register(chunkUPXIY52O_cjs.botanicalLotusHandler);
55753
55753
  this.register(phyllotaxisHandler);
55754
55754
  this.register(bloomReactiveHandler);
55755
55755
  this.register(lotusRootHandler);
@@ -56579,5 +56579,5 @@ exports.windHandler = windHandler;
56579
56579
  exports.withNegotiation = withNegotiation;
56580
56580
  exports.wotThingHandler = wotThingHandler;
56581
56581
  exports.zkPrivateHandler = zkPrivateHandler;
56582
- //# sourceMappingURL=chunk-AOVGZ25K.cjs.map
56583
- //# sourceMappingURL=chunk-AOVGZ25K.cjs.map
56582
+ //# sourceMappingURL=chunk-SMRVK6BI.cjs.map
56583
+ //# sourceMappingURL=chunk-SMRVK6BI.cjs.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkEXUP2BUM_cjs = require('./chunk-EXUP2BUM.cjs');
4
- var chunkALC6K7GL_cjs = require('./chunk-ALC6K7GL.cjs');
4
+ var chunk3OZACAFQ_cjs = require('./chunk-3OZACAFQ.cjs');
5
5
  var chunkOIQYIIO3_cjs = require('./chunk-OIQYIIO3.cjs');
6
6
  var chunkHKEXJUWS_cjs = require('./chunk-HKEXJUWS.cjs');
7
7
  var chunkKKP7JKN4_cjs = require('./chunk-KKP7JKN4.cjs');
@@ -9,7 +9,7 @@ var ans = require('@holoscript/core-types/ans');
9
9
 
10
10
  // src/compiler/GLTFPipeline.ts
11
11
  chunkOIQYIIO3_cjs.init_TraitCompositor();
12
- chunkALC6K7GL_cjs.init_R3FCompiler();
12
+ chunk3OZACAFQ_cjs.init_R3FCompiler();
13
13
  chunkKKP7JKN4_cjs.init_CompilerBase();
14
14
  chunkHKEXJUWS_cjs.init_DomainBlockCompilerMixin();
15
15
 
@@ -120,8 +120,8 @@ function declareExtensions(gltf) {
120
120
  }
121
121
 
122
122
  // src/compiler/GLTFPipeline.ts
123
- chunkALC6K7GL_cjs.init_ObjectPool();
124
- var gltfNodePool = new chunkALC6K7GL_cjs.ASTNodePool(
123
+ chunk3OZACAFQ_cjs.init_ObjectPool();
124
+ var gltfNodePool = new chunk3OZACAFQ_cjs.ASTNodePool(
125
125
  () => ({ name: "" }),
126
126
  (node) => {
127
127
  node.name = "";
@@ -1601,8 +1601,8 @@ var GLTFPipeline = class extends chunkKKP7JKN4_cjs.CompilerBase {
1601
1601
  let attenuationColor;
1602
1602
  let attenuationDistance;
1603
1603
  const namedMat = this.findProp(object, "material");
1604
- if (typeof namedMat === "string" && chunkALC6K7GL_cjs.MATERIAL_PRESETS[namedMat]) {
1605
- const preset = chunkALC6K7GL_cjs.MATERIAL_PRESETS[namedMat];
1604
+ if (typeof namedMat === "string" && chunk3OZACAFQ_cjs.MATERIAL_PRESETS[namedMat]) {
1605
+ const preset = chunk3OZACAFQ_cjs.MATERIAL_PRESETS[namedMat];
1606
1606
  if (preset.color) color = this.parseColorString(preset.color);
1607
1607
  if (preset.metalness !== void 0) metallic = preset.metalness;
1608
1608
  if (preset.roughness !== void 0) roughness = preset.roughness;
@@ -2253,5 +2253,5 @@ exports.GLTFPipeline = GLTFPipeline;
2253
2253
  exports.createGLTFPipeline = createGLTFPipeline;
2254
2254
  exports.generateScaleNormalMap = generateScaleNormalMap;
2255
2255
  exports.generateScaleTexture = generateScaleTexture;
2256
- //# sourceMappingURL=chunk-X3UVCWNL.cjs.map
2257
- //# sourceMappingURL=chunk-X3UVCWNL.cjs.map
2256
+ //# sourceMappingURL=chunk-U7IUS5HJ.cjs.map
2257
+ //# sourceMappingURL=chunk-U7IUS5HJ.cjs.map
@@ -523,6 +523,137 @@ function generateBotanicalRoughnessMap(opts) {
523
523
  }
524
524
  return { width: size, height: size, data };
525
525
  }
526
+ function lotusSmoothstep(edge0, edge1, x) {
527
+ const t = Math.min(1, Math.max(0, (x - edge0) / (edge1 - edge0)));
528
+ return t * t * (3 - 2 * t);
529
+ }
530
+ function lotusPetalHalfWidthFraction(v) {
531
+ const broad = Math.sin(Math.PI * Math.pow(v, 0.8));
532
+ const tipPoint = 1 - lotusSmoothstep(0.82, 1, v) * 0.55;
533
+ return Math.max(0, broad * tipPoint);
534
+ }
535
+ function buildLotusPetalGeometryData(params = {}) {
536
+ const P = { ...exports.DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS, ...params };
537
+ const nu = Math.max(2, Math.floor(P.segmentsU));
538
+ const nv = Math.max(2, Math.floor(P.segmentsV));
539
+ const cols = nu + 1;
540
+ const rows = nv + 1;
541
+ const vertexCount = cols * rows;
542
+ const halfWidthMax = P.width * 0.5;
543
+ const positions = new Float32Array(vertexCount * 3);
544
+ const normals = new Float32Array(vertexCount * 3);
545
+ const petalUv = new Float32Array(vertexCount * 2);
546
+ const veinPhase = new Float32Array(vertexCount);
547
+ const pos = (u, v) => {
548
+ const su = 2 * u - 1;
549
+ const hw = lotusPetalHalfWidthFraction(v) * halfWidthMax;
550
+ const x = su * hw;
551
+ const y = v * P.length;
552
+ const cup = P.cup * halfWidthMax * (su * su);
553
+ const ridge = P.ridge * Math.exp(-(su * su) / (2 * 0.16 * 0.16)) * lotusSmoothstep(0, 0.3, v) * (1 - 0.4 * v);
554
+ const sag = P.gravitySag * v * v * P.length;
555
+ return [x, y, cup + ridge - sag];
556
+ };
557
+ for (let j = 0; j < rows; j += 1) {
558
+ const v = j / nv;
559
+ for (let i = 0; i < cols; i += 1) {
560
+ const u = i / nu;
561
+ const idx = j * cols + i;
562
+ const [x, y, z] = pos(u, v);
563
+ positions[idx * 3] = x;
564
+ positions[idx * 3 + 1] = y;
565
+ positions[idx * 3 + 2] = z;
566
+ petalUv[idx * 2] = u;
567
+ petalUv[idx * 2 + 1] = v;
568
+ veinPhase[idx] = P.veinPhase;
569
+ const eps = 1e-3;
570
+ const pu0 = pos(Math.max(0, u - eps), v);
571
+ const pu1 = pos(Math.min(1, u + eps), v);
572
+ const pv0 = pos(u, Math.max(0, v - eps));
573
+ const pv1 = pos(u, Math.min(1, v + eps));
574
+ const dux = pu1[0] - pu0[0];
575
+ const duy = pu1[1] - pu0[1];
576
+ const duz = pu1[2] - pu0[2];
577
+ const dvx = pv1[0] - pv0[0];
578
+ const dvy = pv1[1] - pv0[1];
579
+ const dvz = pv1[2] - pv0[2];
580
+ let nx = duy * dvz - duz * dvy;
581
+ let ny = duz * dvx - dux * dvz;
582
+ let nz = dux * dvy - duy * dvx;
583
+ const len = Math.hypot(nx, ny, nz);
584
+ if (len < 1e-8) {
585
+ nx = 0;
586
+ ny = 0;
587
+ nz = 1;
588
+ } else {
589
+ nx /= len;
590
+ ny /= len;
591
+ nz /= len;
592
+ if (nz < 0) {
593
+ nx = -nx;
594
+ ny = -ny;
595
+ nz = -nz;
596
+ }
597
+ }
598
+ normals[idx * 3] = nx;
599
+ normals[idx * 3 + 1] = ny;
600
+ normals[idx * 3 + 2] = nz;
601
+ }
602
+ }
603
+ const indices = new Uint32Array(nu * nv * 6);
604
+ let k = 0;
605
+ for (let j = 0; j < nv; j += 1) {
606
+ for (let i = 0; i < nu; i += 1) {
607
+ const a = j * cols + i;
608
+ const b = a + 1;
609
+ const c = a + cols;
610
+ const d = c + 1;
611
+ indices[k] = a;
612
+ indices[k + 1] = b;
613
+ indices[k + 2] = c;
614
+ indices[k + 3] = b;
615
+ indices[k + 4] = d;
616
+ indices[k + 5] = c;
617
+ k += 6;
618
+ }
619
+ }
620
+ return { positions, normals, petalUv, veinPhase, indices, vertexCount };
621
+ }
622
+ function lotusPetalGeometryParamsFromProfile(profile, options = {}) {
623
+ const rings = profile.petal_rings;
624
+ const ring = (options.ring ? rings.find((r) => r.name === options.ring) : void 0) ?? rings[rings.length - 1];
625
+ const { ring: _ring, ...overrides } = options;
626
+ return {
627
+ ...exports.DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS,
628
+ ...ring ? { length: ring.length, width: ring.width, cup: ring.cup, gravitySag: ring.gravity_sag } : {},
629
+ ...overrides
630
+ };
631
+ }
632
+ function buildLotusFlowerPlacements(profile = createBotanicalLotusRenderProfile(), options = {}) {
633
+ const radiusScale = options.radiusScale ?? 0.5;
634
+ const ringLift = options.ringLift ?? 0.12;
635
+ const goldenAngle = exports.LOTUS_GOLDEN_ANGLE_DEG * Math.PI / 180;
636
+ const placements = [];
637
+ let globalIndex = 0;
638
+ profile.petal_rings.forEach((ring, idx) => {
639
+ const ringNum = idx + 1;
640
+ const scale = exports.LOTUS_RING_SCALING[ringNum] ?? exports.LOTUS_RING_SCALING[3];
641
+ const radius = ring.radius * scale.radius * radiusScale;
642
+ const tilt = (90 - ring.pitch_degrees) * Math.PI / 180;
643
+ const lift = (profile.petal_rings.length - ringNum) * ringLift;
644
+ for (let i = 0; i < ring.count; i += 1) {
645
+ placements.push({
646
+ azimuth: globalIndex * goldenAngle,
647
+ tilt,
648
+ radius,
649
+ lift,
650
+ ring: ringNum
651
+ });
652
+ globalIndex += 1;
653
+ }
654
+ });
655
+ return placements;
656
+ }
526
657
  function lotusMulberry32(seed) {
527
658
  let a = seed >>> 0;
528
659
  return () => {
@@ -1017,7 +1148,7 @@ function lotusPetalTurgorOpenProgress(state) {
1017
1148
  const tip = lotusPetalTurgorTipDeg(state);
1018
1149
  return Math.max(0, Math.min(1, (250 - tip) / (250 - 76)));
1019
1150
  }
1020
- exports.DEFAULT_BOTANICAL_LOTUS_CONFIG = void 0; var SHA256_HASH_PATTERN, HEX_COLOR_PATTERN, RING_RENDER_DEFAULTS; exports.botanicalLotusHandler = void 0; exports.LOTUS_GOLDEN_ANGLE_DEG = void 0; exports.LOTUS_GROWTH_SECONDS = void 0; exports.LOTUS_GENESIS_SEED_PLACEHOLDER = void 0; exports.LOTUS_RING_SCALING = void 0; exports.LOTUS_OUTER_PETAL_COLOR = void 0; var LOTUS_PETAL_NAME_RE; exports.LOTUS_PETAL_SHADER_CHUNKS = void 0; exports.LOTUS_PETAL_CHUNK_ENTRIES = void 0; var LOTUS_PETAL_DEFAULT_DYNAMIC; exports.LOTUS_PETAL_UNIFORM_BINDINGS = void 0;
1151
+ exports.DEFAULT_BOTANICAL_LOTUS_CONFIG = void 0; var SHA256_HASH_PATTERN, HEX_COLOR_PATTERN, RING_RENDER_DEFAULTS; exports.botanicalLotusHandler = void 0; exports.LOTUS_GOLDEN_ANGLE_DEG = void 0; exports.LOTUS_GROWTH_SECONDS = void 0; exports.LOTUS_GENESIS_SEED_PLACEHOLDER = void 0; exports.LOTUS_RING_SCALING = void 0; exports.LOTUS_OUTER_PETAL_COLOR = void 0; var LOTUS_PETAL_NAME_RE; exports.LOTUS_PETAL_SHADER_CHUNKS = void 0; exports.LOTUS_PETAL_CHUNK_ENTRIES = void 0; var LOTUS_PETAL_DEFAULT_DYNAMIC; exports.LOTUS_PETAL_UNIFORM_BINDINGS = void 0; exports.DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS = void 0;
1021
1152
  var init_BotanicalLotusTrait = chunkHCCQLAA4_cjs.__esm({
1022
1153
  "src/traits/BotanicalLotusTrait.ts"() {
1023
1154
  exports.DEFAULT_BOTANICAL_LOTUS_CONFIG = {
@@ -1378,10 +1509,22 @@ totalEmissiveRadiance += lotusScatter * (0.28 + uLotusBloom * 0.72);`
1378
1509
  uLotusBloom: "bloom",
1379
1510
  uLotusTime: "time"
1380
1511
  };
1512
+ exports.DEFAULT_LOTUS_PETAL_GEOMETRY_PARAMS = {
1513
+ length: 1.7,
1514
+ width: 1.1,
1515
+ cup: 0.34,
1516
+ ridge: 0.12,
1517
+ gravitySag: 0.18,
1518
+ segmentsU: 24,
1519
+ segmentsV: 40,
1520
+ veinPhase: 0
1521
+ };
1381
1522
  }
1382
1523
  });
1383
1524
 
1384
1525
  exports.assertBotanicalLotusConfig = assertBotanicalLotusConfig;
1526
+ exports.buildLotusFlowerPlacements = buildLotusFlowerPlacements;
1527
+ exports.buildLotusPetalGeometryData = buildLotusPetalGeometryData;
1385
1528
  exports.buildLotusPetalMaterialSpec = buildLotusPetalMaterialSpec;
1386
1529
  exports.buildLotusSceneFromComposition = buildLotusSceneFromComposition;
1387
1530
  exports.createBotanicalLotusRenderProfile = createBotanicalLotusRenderProfile;
@@ -1400,6 +1543,7 @@ exports.init_BotanicalLotusTrait = init_BotanicalLotusTrait;
1400
1543
  exports.lotusMorphogen2DPeaks = lotusMorphogen2DPeaks;
1401
1544
  exports.lotusMorphogen2DSampleAt = lotusMorphogen2DSampleAt;
1402
1545
  exports.lotusMorphogenPeaks = lotusMorphogenPeaks;
1546
+ exports.lotusPetalGeometryParamsFromProfile = lotusPetalGeometryParamsFromProfile;
1403
1547
  exports.lotusPetalRenderColor = lotusPetalRenderColor;
1404
1548
  exports.lotusPetalTurgorOpenProgress = lotusPetalTurgorOpenProgress;
1405
1549
  exports.lotusPetalTurgorTipDeg = lotusPetalTurgorTipDeg;
@@ -1414,5 +1558,5 @@ exports.stepLotusMorphogen2D = stepLotusMorphogen2D;
1414
1558
  exports.stepLotusPetalTurgor = stepLotusPetalTurgor;
1415
1559
  exports.stepLotusPond = stepLotusPond;
1416
1560
  exports.validateBotanicalLotusConfig = validateBotanicalLotusConfig;
1417
- //# sourceMappingURL=chunk-6Q7RC2MK.cjs.map
1418
- //# sourceMappingURL=chunk-6Q7RC2MK.cjs.map
1561
+ //# sourceMappingURL=chunk-UPXIY52O.cjs.map
1562
+ //# sourceMappingURL=chunk-UPXIY52O.cjs.map