@ntalmagor/3drize-viewer 0.1.26 → 0.1.27

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 (60) hide show
  1. package/dist/components/Bubbles.d.ts +3 -2
  2. package/dist/components/Bubbles.d.ts.map +1 -1
  3. package/dist/components/Bubbles.js +2 -3
  4. package/dist/components/Corona.d.ts +26 -0
  5. package/dist/components/Corona.d.ts.map +1 -0
  6. package/dist/components/Corona.js +12 -0
  7. package/dist/components/CustomPrimitive.d.ts.map +1 -1
  8. package/dist/components/CustomPrimitive.js +46 -40
  9. package/dist/components/Earth.d.ts +3 -13
  10. package/dist/components/Earth.d.ts.map +1 -1
  11. package/dist/components/Earth.js +7 -12
  12. package/dist/components/EffectsGenerator.d.ts +1 -1
  13. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  14. package/dist/components/EffectsGenerator.js +10 -2
  15. package/dist/components/EffectsGroup.d.ts.map +1 -1
  16. package/dist/components/EffectsGroup.js +3 -1
  17. package/dist/components/Flares.d.ts +64 -0
  18. package/dist/components/Flares.d.ts.map +1 -0
  19. package/dist/components/Flares.js +134 -0
  20. package/dist/components/Frame.js +1 -0
  21. package/dist/components/GalleryLayout.d.ts.map +1 -1
  22. package/dist/components/GalleryLayout.js +5 -5
  23. package/dist/components/Glyphs.d.ts +3 -2
  24. package/dist/components/Glyphs.d.ts.map +1 -1
  25. package/dist/components/Glyphs.js +5 -5
  26. package/dist/components/ImageGeometry.js +1 -1
  27. package/dist/components/Lensflare.d.ts +1 -1
  28. package/dist/components/Lensflare.d.ts.map +1 -1
  29. package/dist/components/Lensflare.js +1 -1
  30. package/dist/components/Moon.d.ts +2 -2
  31. package/dist/components/Moon.d.ts.map +1 -1
  32. package/dist/components/Moon.js +4 -4
  33. package/dist/components/ObjectNode.d.ts.map +1 -1
  34. package/dist/components/ObjectNode.js +11 -9
  35. package/dist/components/Planet.d.ts +16 -0
  36. package/dist/components/Planet.d.ts.map +1 -0
  37. package/dist/components/Planet.js +60 -0
  38. package/dist/components/ShootingStars.d.ts.map +1 -1
  39. package/dist/components/ShootingStars.js +1 -0
  40. package/dist/components/SolarSystem.d.ts +5 -0
  41. package/dist/components/SolarSystem.d.ts.map +1 -0
  42. package/dist/components/SolarSystem.js +76 -0
  43. package/dist/components/SparklesBurst.d.ts +3 -2
  44. package/dist/components/SparklesBurst.d.ts.map +1 -1
  45. package/dist/components/SparklesBurst.js +3 -3
  46. package/dist/components/Sun.d.ts +34 -0
  47. package/dist/components/Sun.d.ts.map +1 -0
  48. package/dist/components/Sun.js +7 -0
  49. package/dist/components/SunCore.d.ts +26 -0
  50. package/dist/components/SunCore.d.ts.map +1 -0
  51. package/dist/components/SunCore.js +14 -0
  52. package/dist/components/effects/Fire.d.ts +29 -0
  53. package/dist/components/effects/Fire.d.ts.map +1 -0
  54. package/dist/components/effects/Fire.js +208 -0
  55. package/dist/hooks/useMeshController.d.ts.map +1 -1
  56. package/dist/hooks/useMeshController.js +5 -1
  57. package/dist/index.d.ts +3 -2
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +3 -1
  60. package/package.json +4 -2
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- import type { CreatedObjectSettings } from '@ntalmagor/3drize-core';
2
+ import type { BubblesConfig } from '@ntalmagor/3drize-core';
3
3
  export interface BubblesProps {
4
- settings: CreatedObjectSettings;
4
+ config: BubblesConfig;
5
+ boundingRadius?: number;
5
6
  }
6
7
  declare const Bubbles: React.FC<BubblesProps>;
7
8
  export default Bubbles;
@@ -1 +1 @@
1
- {"version":3,"file":"Bubbles.d.ts","sourceRoot":"","sources":["../../src/components/Bubbles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAG1D,OAAO,KAAK,EAAiB,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAKnF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8GnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Bubbles.d.ts","sourceRoot":"","sources":["../../src/components/Bubbles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAyB,MAAM,wBAAwB,CAAC;AAKnF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8GnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -4,8 +4,7 @@ import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { BubblesPointsMaterial } from '@ntalmagor/3drize-core';
6
6
  const MAX_BUBBLES = 256;
7
- const Bubbles = ({ settings }) => {
8
- const config = settings.config;
7
+ const Bubbles = ({ config }) => {
9
8
  const positions = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
10
9
  const velocities = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
11
10
  const ages = useMemo(() => new Float32Array(MAX_BUBBLES), []);
@@ -99,7 +98,7 @@ const Bubbles = ({ settings }) => {
99
98
  geometry.attributes.aBaseSize.needsUpdate = true;
100
99
  geometry.attributes.aPhase.needsUpdate = true;
101
100
  });
102
- if (!settings.meshSettings.visible)
101
+ if (!config.enabled)
103
102
  return null;
104
103
  return _jsx("points", { geometry: geometry, material: material, frustumCulled: false });
105
104
  };
@@ -0,0 +1,26 @@
1
+ import * as THREE from "three";
2
+ /**
3
+ * <Corona />
4
+ * The halo: an inverted (BackSide) sphere shell driven by SunCoronaMaterial,
5
+ * additively blended. The shell scale is kept in sync with the material's
6
+ * u_shellScale so the falloff math stays correct at any size.
7
+ *
8
+ * Note: additive blending — reads best against a dark scene background.
9
+ */
10
+ declare global {
11
+ namespace JSX {
12
+ interface IntrinsicElements {
13
+ sunCoronaMaterial: any;
14
+ }
15
+ }
16
+ }
17
+ export type CoronaProps = {
18
+ /** Radius of the core this corona surrounds. Default 1. */
19
+ radius?: number;
20
+ /** Shell size relative to the core. Default 1.25. Synced with u_shellScale. */
21
+ shellScale?: number;
22
+ /** Uniform overrides for SunCoronaMaterial (u_intensity, u_innerColor, ...). */
23
+ uniforms?: Record<string, number | THREE.Vector3 | number[]>;
24
+ };
25
+ export default function Corona({ radius, shellScale, uniforms }: CoronaProps): import("react/jsx-runtime").JSX.Element;
26
+ //# sourceMappingURL=Corona.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Corona.d.ts","sourceRoot":"","sources":["../../src/components/Corona.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;;;GAOG;AAEH,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,iBAAiB,EAAE,GAAG,CAAC;SACxB;KACF;CACF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;CAC9D,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,MAAU,EACV,UAAiB,EACjB,QAAQ,EACT,EAAE,WAAW,2CAsBb"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as THREE from "three";
3
+ import { useRef } from "react";
4
+ import { useFrame } from "@react-three/fiber";
5
+ export default function Corona({ radius = 1, shellScale = 1.25, uniforms }) {
6
+ const matRef = useRef(null);
7
+ useFrame((_, delta) => {
8
+ if (matRef.current)
9
+ matRef.current.u_time += delta;
10
+ });
11
+ return (_jsxs("mesh", { scale: radius * shellScale, children: [_jsx("sphereGeometry", { args: [1, 64, 64] }), _jsx("coronaMaterial", { ref: matRef, u_shellScale: shellScale, side: THREE.BackSide, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, ...uniforms })] }));
12
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAoB,KAAK,qBAAqB,EAKzC,MAAM,wBAAwB,CAAC;AAI3C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD,UAAU,oBAAoB;IAC5B,aAAa,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAClH;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgFlD,CAAC;AAIH,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAEvD,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAQ,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,UAAU,oBAAoB;IAC5B,aAAa,EAAE,qBAAqB,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAClH;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAiFlD,CAAC;AAIH,eAAe,eAAe,CAAC"}
@@ -1,53 +1,59 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useRef, memo } from "react";
3
- import { ObjectManager } from "@ntalmagor/3drize-core";
2
+ import { useRef, useEffect, memo } from "react";
3
+ import { createMeshByType, ObjectManager, } from "@ntalmagor/3drize-core";
4
+ import { Mesh } from "three";
4
5
  import MaterialLibrary from "./MaterialLibrary.js";
5
6
  const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick, }) => {
6
- // const { handleObjectClick } = useSceneClick();
7
- // console.log("Rendering CustomPrimitive with settings:", createdObject.name, createdObject);
8
7
  const meshRef = useRef(null);
9
- // const effectStateRef = useRef<EffectState | null>(null);
10
- // const [animatedTransform, setAnimatedTransform] = React.useState<AnimatedTransform>({
11
- // position: createdObject.meshSettings.position,
12
- // rotation: createdObject.meshSettings.rotation,
13
- // scale: createdObject.meshSettings.scale,
14
- // });
15
- // Initialize transform controls
16
- // const { handlePointerEnter, handlePointerLeave, hovered } = useFrameEffects(true);
17
- // useEffect(() => {
18
- // setAnimatedTransform({
19
- // position: createdObject.meshSettings.position,
20
- // rotation: createdObject.meshSettings.rotation,
21
- // scale: createdObject.meshSettings.scale,
22
- // });
23
- // }, [createdObject.meshSettings.position, createdObject.meshSettings.rotation, createdObject.meshSettings.scale]);
8
+ useEffect(() => {
9
+ if (createdObject.type !== 'mesh')
10
+ return;
11
+ const managedObject = ObjectManager.getObject(createdObject.id);
12
+ if (!managedObject || !(managedObject.object instanceof Mesh))
13
+ return;
14
+ const targetMesh = managedObject.object;
15
+ const meshType = createdObject.config?.type || managedObject.object.userData?.type || 'box';
16
+ const meshData = {
17
+ position: [targetMesh.position.x, targetMesh.position.y, targetMesh.position.z],
18
+ rotation: [targetMesh.rotation.x, targetMesh.rotation.y, targetMesh.rotation.z],
19
+ scale: [targetMesh.scale.x, targetMesh.scale.y, targetMesh.scale.z],
20
+ visible: targetMesh.visible,
21
+ name: targetMesh.name || createdObject.name,
22
+ ...createdObject.config,
23
+ type: meshType,
24
+ id: createdObject.id,
25
+ };
26
+ const generated = createMeshByType(meshData);
27
+ if (!generated)
28
+ return;
29
+ if (targetMesh.geometry !== generated.mesh.geometry) {
30
+ targetMesh.geometry?.dispose();
31
+ targetMesh.geometry = generated.mesh.geometry;
32
+ }
33
+ targetMesh.userData = {
34
+ ...targetMesh.userData,
35
+ type: meshType,
36
+ id: createdObject.id,
37
+ options: generated.config,
38
+ };
39
+ if (generated.mesh.material && generated.mesh.material !== targetMesh.material) {
40
+ if (Array.isArray(generated.mesh.material)) {
41
+ generated.mesh.material.forEach((m) => m.dispose());
42
+ }
43
+ else {
44
+ generated.mesh.material.dispose();
45
+ }
46
+ }
47
+ }, [
48
+ createdObject.config,
49
+ ]);
24
50
  const useDreiMaterials = createdObject.materialSettings.materialType === "advanced";
25
- // const apply3driseMaterials = !useDreiMaterials;
26
- // const willApplyMaterial = apply3driseMaterials && !!createdObject.materialSettings.materialVariant;
27
- // const [materialReady, setMaterialReady] = useState(!willApplyMaterial);
28
- // get initial object from ObjectManager to add to scene with primitive, then use findById to get updated reference with materials applied by useMaterialApplication
29
51
  const obj = ObjectManager.getObject(createdObject.id);
30
- // const object = findById(createdObject.id);
31
- // useMaterialApplication(object ?? null, createdObject.materialSettings, apply3driseMaterials, () => setMaterialReady(true));
32
52
  if (!obj) {
33
53
  // console.warn(`CustomPrimitive - Object with ID ${createdObject.id} not found.`);
34
54
  return null;
35
55
  }
36
- return (
37
- // <Select enabled={isSelected}>
38
- // <CreatedObject createdObject={createdObject}
39
- // shouldApply3driseMaterial={false} // Material is owned by useMaterialApplication above (applied to obj.object directly)
40
- // handleObjectClick={handleObjectClick}
41
- // onObjectReady={(object, ref) => {
42
- // onObjectReady && onObjectReady(object, ref);
43
- // }}
44
- // >
45
- _jsx("primitive", { ref: meshRef, name: obj.name, object: obj.object, visible: createdObject.meshSettings.visible, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: useDreiMaterials && createdObject.type === 'mesh' && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }, obj.id)
46
- // {/* <LineEdges object={obj.object} />
47
- // <MeshEdges object={obj.object} /> */}
48
- // </CreatedObject>
49
- // {/* </Select> */}
50
- );
56
+ return (_jsx("primitive", { ref: meshRef, name: obj.name, object: obj.object, visible: createdObject.meshSettings.visible, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: useDreiMaterials && createdObject.type === 'mesh' && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }, obj.id));
51
57
  });
52
58
  CustomPrimitive.displayName = 'CustomPrimitive';
53
59
  export default CustomPrimitive;
@@ -1,18 +1,8 @@
1
1
  import React from 'react';
2
2
  import * as THREE from 'three';
3
- export interface EarthProps {
4
- sunPosition?: [number, number, number];
5
- position?: [number, number, number];
6
- scale?: number;
7
- radius?: number;
8
- segments?: number;
9
- enableRotation?: boolean;
10
- rotationSpeed?: number;
11
- visible?: boolean;
12
- atmosphereDayColor?: THREE.ColorRepresentation;
13
- atmosphereTwilightColor?: THREE.ColorRepresentation;
3
+ import { EarthConfig } from '@ntalmagor/3drize-core';
4
+ declare const Earth: React.FC<EarthConfig & {
14
5
  onMeshReady?: (mesh: THREE.Mesh) => void;
15
- }
16
- declare const Earth: React.FC<EarthProps>;
6
+ }>;
17
7
  export default Earth;
18
8
  //# sourceMappingURL=Earth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Earth.d.ts","sourceRoot":"","sources":["../../src/components/Earth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;IAC/C,uBAAuB,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;IACpD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;CAC1C;AAED,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAkF/B,CAAC;AAGF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Earth.d.ts","sourceRoot":"","sources":["../../src/components/Earth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAA0C,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQ7F,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG;IAAE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,CAAA;CAAE,CA0E/E,CAAC;AAGF,eAAe,KAAK,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useMemo, useCallback, useEffect } from 'react';
3
3
  import * as THREE from 'three';
4
- import { useFrame } from '@react-three/fiber';
5
4
  import { useTexture } from '@react-three/drei';
6
- const EARTH_CDN_BASE = 'https://3d-rise.sfo3.cdn.digitaloceanspaces.com/app/images/earth';
7
- const EARTH_DAY_URL = `${EARTH_CDN_BASE}/earth_day_4096.jpg`;
8
- const EARTH_NIGHT_URL = `${EARTH_CDN_BASE}/earth_night_4096.jpg`;
9
- const EARTH_BUMP_ROUGHNESS_CLOUDS_URL = `${EARTH_CDN_BASE}/earth_bump_roughness_clouds_4096.jpg`;
10
- const Earth = ({ sunPosition = [0, 0, 3], position = [0, 0, 0], scale = 1, radius = 1, segments = 64, enableRotation = true, rotationSpeed = 0.025, visible = true, atmosphereDayColor = '#4db2ff', atmosphereTwilightColor = '#bc490b', onMeshReady, }) => {
5
+ const CDN = 'https://3d-rise.sfo3.cdn.digitaloceanspaces.com/app/images/planets';
6
+ const EARTH_DAY_URL = `${CDN}/earth_day_4096.jpg`;
7
+ const EARTH_NIGHT_URL = `${CDN}/earth_night_4096.jpg`;
8
+ const EARTH_BUMP_ROUGHNESS_CLOUDS_URL = `${CDN}/earth_bump_roughness_clouds_4096.jpg`;
9
+ const Earth = ({ sunPosition = [0, 0, 3], atmosphereDayColor = '#4db2ff', atmosphereTwilightColor = '#bc490b', radius = 1, onMeshReady, }) => {
11
10
  const globeRef = useRef(null);
12
11
  const globeMatRef = useRef(null);
13
12
  const atmosphereMatRef = useRef(null);
13
+ const segments = 64;
14
14
  const [dayMap, nightMap, bumpRoughnessClouds] = useTexture([
15
15
  EARTH_DAY_URL,
16
16
  EARTH_NIGHT_URL,
@@ -32,12 +32,7 @@ const Earth = ({ sunPosition = [0, 0, 3], position = [0, 0, 0], scale = 1, radiu
32
32
  onMeshReady?.(mesh);
33
33
  }
34
34
  }, [onMeshReady]);
35
- useFrame((_, delta) => {
36
- if (enableRotation && globeRef.current) {
37
- globeRef.current.rotation.y += delta * rotationSpeed;
38
- }
39
- });
40
- return (_jsxs("group", { position: position, scale: scale, visible: visible, userData: { id: '3drise-earth' }, children: [_jsxs("mesh", { ref: handleGlobeRef, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthMaterial", { ref: globeMatRef, uDayMap: dayMap, uNightMap: nightMap, uBumpRoughnessClouds: bumpRoughnessClouds, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] }), _jsxs("mesh", { scale: 1.04, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthAtmosphereMaterial", { ref: atmosphereMatRef, transparent: true, side: THREE.BackSide, depthWrite: false, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] })] }));
35
+ return (_jsxs("group", { userData: { id: '3drise-earth' }, children: [_jsxs("mesh", { ref: handleGlobeRef, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthMaterial", { ref: globeMatRef, uDayMap: dayMap, uNightMap: nightMap, uBumpRoughnessClouds: bumpRoughnessClouds, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] }), _jsxs("mesh", { scale: 1.04, children: [_jsx("sphereGeometry", { args: [radius, segments, segments] }), _jsx("earthAtmosphereMaterial", { ref: atmosphereMatRef, transparent: true, side: THREE.BackSide, depthWrite: false, uSunDirection: sunDirection, uAtmosphereDayColor: dayColor, uAtmosphereTwilightColor: twilightColor })] })] }));
41
36
  };
42
37
  Earth.displayName = 'Earth';
43
38
  export default Earth;
@@ -3,7 +3,7 @@ import { Object3D } from 'three';
3
3
  import type { GenerativeEffectSettings } from '@ntalmagor/3drize-core';
4
4
  export interface EffectsGeneratorProps {
5
5
  settings: GenerativeEffectSettings;
6
- object?: Object3D;
6
+ object?: Object3D | null;
7
7
  }
8
8
  declare const EffectsGenerator: React.FC<EffectsGeneratorProps>;
9
9
  export default EffectsGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAgB,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAsBvE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoCrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAgB,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AA0BvE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAwCrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -12,7 +12,6 @@ import DnaHelixEffect from './effects/DnaHelixEffect.js';
12
12
  import OrbEffect from './effects/OrbEffect.js';
13
13
  import LightningEffect from './effects/LightningEffect.js';
14
14
  import AuroraEffect from './effects/AuroraEffect.js';
15
- import FireEffect from './effects/FireEffect.js';
16
15
  import ForcefieldEffect from './effects/ForcefieldEffect.js';
17
16
  import NeuralNetworkEffect from './effects/NeuralNetworkEffect.js';
18
17
  import BlackHoleEffect from './effects/BlackHoleEffect.js';
@@ -20,6 +19,11 @@ import IceCrystalsEffect from './effects/IceCrystalsEffect.js';
20
19
  import SmokePlumeEffect from './effects/SmokePlumeEffect.js';
21
20
  import VolumetricFogEffect from './effects/VolumetricFogEffect.js';
22
21
  import SmokeRingEffect from './effects/SmokeRingEffect.js';
22
+ import Flares from './Flares.js';
23
+ import SparklesBurst from './SparklesBurst.js';
24
+ import Bubbles from './Bubbles.js';
25
+ import Glyphs from './Glyphs.js';
26
+ import Fire from './effects/Fire.js';
23
27
  const EffectsGenerator = ({ settings, object }) => {
24
28
  if (!settings.enabled)
25
29
  return null;
@@ -45,7 +49,6 @@ const EffectsGenerator = ({ settings, object }) => {
45
49
  case 'orb': return _jsx(OrbEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
46
50
  case 'lightning': return _jsx(LightningEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
47
51
  case 'aurora': return _jsx(AuroraEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
48
- case 'fire': return _jsx(FireEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
49
52
  case 'forcefield': return _jsx(ForcefieldEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
50
53
  case 'neuralNetwork': return _jsx(NeuralNetworkEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
51
54
  case 'blackHole': return _jsx(BlackHoleEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
@@ -53,6 +56,11 @@ const EffectsGenerator = ({ settings, object }) => {
53
56
  case 'smokePlume': return _jsx(SmokePlumeEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
54
57
  case 'volumetricFog': return _jsx(VolumetricFogEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
55
58
  case 'smokeRing': return _jsx(SmokeRingEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
59
+ case 'fire': return _jsx(Fire, { hostRef: object, config: config, animations: animations });
60
+ case 'flares': return _jsx(Flares, { hostRef: object, config: config, animations: animations });
61
+ case 'sparklesBurst': return _jsx(SparklesBurst, { boundingRadius: boundingRadius, config: config });
62
+ case 'bubbles': return _jsx(Bubbles, { boundingRadius: boundingRadius, config: config });
63
+ case 'glyphs': return _jsx(Glyphs, { boundingRadius: boundingRadius, config: config });
56
64
  default: return null;
57
65
  }
58
66
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG3F,UAAU,iBAAiB;IACzB,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAU7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAI3F,UAAU,iBAAiB;IACzB,aAAa,EAAE,qBAAqB,CAAC;CACtC;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAW7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { GEREATIVE_EFFECTS_KEY } from '@ntalmagor/3drize-core';
3
3
  import EffectsGenerator from './EffectsGenerator.js';
4
+ import { findById } from '../utils/sceneQuery.js';
4
5
  const EffectsGroup = ({ createdObject }) => {
5
6
  if (!createdObject.effects || createdObject.effects.length === 0)
6
7
  return null;
7
- return (_jsx("group", { name: `${createdObject.id}-effects`, userData: { [GEREATIVE_EFFECTS_KEY]: true }, children: createdObject.effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect }, index))) }));
8
+ const object = findById(createdObject.id);
9
+ return (_jsx("group", { name: `${createdObject.id}-effects`, userData: { [GEREATIVE_EFFECTS_KEY]: true }, children: createdObject.effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect, object: object }, index))) }));
8
10
  };
9
11
  export default EffectsGroup;
@@ -0,0 +1,64 @@
1
+ import { Vector3, Object3D } from "three";
2
+ import { AnimationOptions, FlaresConfig } from "@ntalmagor/3drize-core";
3
+ /**
4
+ * <Flares />
5
+ * Explosive energy bursts.
6
+ *
7
+ * TWO MODES, controlled by the `hostRef` prop:
8
+ *
9
+ * hostRef = false (default) — PLANE MODE
10
+ * Renders a camera-facing billboard plane with bursts erupting from a
11
+ * circular limb (radius 1 in plane units). Auto-fits to the enclosing
12
+ * object's bounding sphere if there is one; otherwise size it with
13
+ * `radius`. Zero extra cost. Ideal for spheres / round bodies (the Sun).
14
+ *
15
+ * <mesh>
16
+ * <sphereGeometry />
17
+ * <Flares />
18
+ * </mesh>
19
+ *
20
+ * hostRef = true — SILHOUETTE MODE
21
+ * Treats the enclosing object as the host: each frame the host is
22
+ * rendered as a mask into a render target and the shader roots the
23
+ * bursts on the host's ACTUAL screen silhouette, whatever its shape.
24
+ * Costs one extra (cheap) render pass of the host per frame.
25
+ *
26
+ * <primitive object={gltf.scene}>
27
+ * <Flares hostRef fitKey={gltf.scene} />
28
+ * </primitive>
29
+ *
30
+ * shooting = true — CENTER BURSTS
31
+ * The same bursts, rooted at the plane center instead of the limb,
32
+ * firing outward from the source. Overrides plane/silhouette rooting.
33
+ * Renders over the host (depth test off) so the rays stay visible.
34
+ *
35
+ * <Flares shooting />
36
+ *
37
+ * Shared behavior:
38
+ * - Auto-fits to the enclosing object's bounding sphere (`radius` to
39
+ * override, `fitKey` to re-fit after async loads, `padding` to tighten).
40
+ * - World-space billboarding: correct under rotated/scaled ancestors.
41
+ * - Additive blending — reads best against a dark scene background.
42
+ */
43
+ declare global {
44
+ namespace JSX {
45
+ interface IntrinsicElements {
46
+ flareMaterial: any;
47
+ }
48
+ }
49
+ }
50
+ export type FlaresProps = {
51
+ /**
52
+ * true -> silhouette mode: bursts root on the enclosing object's actual
53
+ * screen silhouette (mask render pass).
54
+ * false -> plane mode: circular limb billboard (default).
55
+ */
56
+ hostRef?: Object3D | null;
57
+ /** Root the bursts at the center (shooting from source) instead of the limb. */
58
+ config: FlaresConfig;
59
+ /** Uniform overrides for FlareMaterial (u_frequency, u_reach, ...). */
60
+ uniforms?: Record<string, number | Vector3 | number[]>;
61
+ animations?: AnimationOptions[];
62
+ };
63
+ export default function Flares({ hostRef, config, uniforms, animations }: FlaresProps): import("react/jsx-runtime").JSX.Element;
64
+ //# sourceMappingURL=Flares.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flares.d.ts","sourceRoot":"","sources":["../../src/components/Flares.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,OAAO,EAAqC,QAAQ,EAAwB,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,aAAa,EAAE,GAAG,CAAC;SACpB;KACF;CACF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,gFAAgF;IAChF,MAAM,EAAE,YAAY,CAAA;IACpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,CAAC;IACvD,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACjC,CAAC;AAUF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACX,EAAE,WAAW,2CAyJb"}
@@ -0,0 +1,134 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef } from "react";
3
+ import { useFrame, useThree } from "@react-three/fiber";
4
+ import { WebGLRenderTarget, MeshBasicMaterial, AdditiveBlending, Box3, Sphere, Vector3, Vector2, Quaternion, Color, Object3D } from "three";
5
+ const tmpBox = new Box3();
6
+ const tmpSphere = new Sphere();
7
+ const tmpVec = new Vector3();
8
+ const tmpVec2 = new Vector2();
9
+ const tmpQuat = new Quaternion();
10
+ const tmpRight = new Vector3();
11
+ const tmpColor = new Color();
12
+ export default function Flares({ hostRef, config, uniforms, animations }) {
13
+ const { gl, scene } = useThree();
14
+ const anchorRef = useRef(null);
15
+ const meshRef = useRef(null);
16
+ const matRef = useRef(null);
17
+ const { radius, padding = 1.2, fitKey, shooting, maskResolution = 512, maskLayer = 31 } = config;
18
+ const maskTarget = useMemo(() => hostRef
19
+ ? new WebGLRenderTarget(maskResolution, maskResolution, {
20
+ depthBuffer: true,
21
+ stencilBuffer: false,
22
+ samples: 4 // MSAA mask (WebGL2) -> smooth silhouette edges
23
+ })
24
+ : null, [hostRef, maskResolution]);
25
+ const maskMaterial = useMemo(() => new MeshBasicMaterial({ color: 0xffffff }), []);
26
+ useEffect(() => () => maskTarget?.dispose(), [maskTarget]);
27
+ // Fit the billboard to the host object + tag the host for the mask pass.
28
+ useEffect(() => {
29
+ const anchor = anchorRef.current;
30
+ const mesh = meshRef.current;
31
+ if (!anchor || !mesh)
32
+ return;
33
+ const host = hostRef && hostRef instanceof Object3D ? hostRef : anchor;
34
+ // Silhouette mode: tag every host node (except us) with the mask layer.
35
+ if (hostRef && host) {
36
+ host.traverse((o) => o.layers.enable(maskLayer));
37
+ anchor.traverse((o) => o.layers.disable(maskLayer));
38
+ }
39
+ if (radius !== undefined) {
40
+ anchor.position.set(0, 0, 0);
41
+ mesh.scale.setScalar(radius * padding);
42
+ return;
43
+ }
44
+ if (!host)
45
+ return;
46
+ // Bounding box of every sibling except ourselves (world space).
47
+ tmpBox.makeEmpty();
48
+ let hasGeometry = false;
49
+ for (const child of host.children) {
50
+ if (child === anchor)
51
+ continue;
52
+ const childBox = new Box3().setFromObject(child);
53
+ if (!childBox.isEmpty()) {
54
+ tmpBox.union(childBox);
55
+ hasGeometry = true;
56
+ }
57
+ }
58
+ // Host itself may be a mesh (Flares nested directly inside it).
59
+ if (host.geometry) {
60
+ const g = host.geometry;
61
+ if (!g.boundingBox)
62
+ g.computeBoundingBox();
63
+ if (g.boundingBox) {
64
+ tmpBox.union(g.boundingBox.clone().applyMatrix4(host.matrixWorld));
65
+ hasGeometry = true;
66
+ }
67
+ }
68
+ if (!hasGeometry)
69
+ return;
70
+ tmpBox.getBoundingSphere(tmpSphere);
71
+ host.updateWorldMatrix(true, false);
72
+ const localCenter = host.worldToLocal(tmpSphere.center.clone());
73
+ host.getWorldScale(tmpVec);
74
+ const worldScale = Math.max(tmpVec.x, tmpVec.y, tmpVec.z) || 1;
75
+ anchor.position.copy(localCenter);
76
+ mesh.scale.setScalar((tmpSphere.radius / worldScale) * padding);
77
+ }, [radius, padding, fitKey, hostRef, maskLayer]);
78
+ useFrame(({ camera: cam }, delta) => {
79
+ const mat = matRef.current;
80
+ const mesh = meshRef.current;
81
+ if (mat)
82
+ mat.u_time += delta;
83
+ // World-space billboard: compensate for inherited rotation.
84
+ if (mesh && hostRef) {
85
+ hostRef.getWorldQuaternion(tmpQuat).invert();
86
+ mesh.quaternion.copy(tmpQuat).multiply(cam.quaternion);
87
+ }
88
+ // --- Silhouette mask pass: render only the host, white on black. ---
89
+ if (hostRef && maskTarget && mat && mesh) {
90
+ const prevOverride = scene.overrideMaterial;
91
+ const prevBackground = scene.background;
92
+ const prevTarget = gl.getRenderTarget();
93
+ const prevLayers = cam.layers.mask;
94
+ gl.getClearColor(tmpColor);
95
+ const prevClearAlpha = gl.getClearAlpha();
96
+ scene.overrideMaterial = maskMaterial;
97
+ scene.background = null;
98
+ cam.layers.set(maskLayer);
99
+ gl.setRenderTarget(maskTarget);
100
+ gl.setClearColor(0x000000, 1);
101
+ gl.clear();
102
+ gl.render(scene, cam);
103
+ gl.setRenderTarget(prevTarget);
104
+ gl.setClearColor(tmpColor, prevClearAlpha);
105
+ scene.overrideMaterial = prevOverride;
106
+ scene.background = prevBackground;
107
+ cam.layers.mask = prevLayers;
108
+ // Feed the shader: mask, buffer size, host center in screen UV.
109
+ mat.u_mask = maskTarget.texture;
110
+ gl.getDrawingBufferSize(tmpVec2);
111
+ mat.u_resolution.set(tmpVec2.x, tmpVec2.y);
112
+ const anchor = anchorRef.current;
113
+ anchor.getWorldPosition(tmpVec).project(cam);
114
+ const cx = tmpVec.x * 0.5 + 0.5;
115
+ const cy = tmpVec.y * 0.5 + 0.5;
116
+ mat.u_center.set(cx, cy);
117
+ // Bounding-silhouette radius in aspect-corrected screen UV: project a
118
+ // point one limb-unit to the camera's right of the center.
119
+ mesh.getWorldScale(tmpVec);
120
+ const worldLimb = Math.max(tmpVec.x, tmpVec.y, tmpVec.z);
121
+ tmpRight.setFromMatrixColumn(cam.matrixWorld, 0).multiplyScalar(worldLimb);
122
+ anchor.getWorldPosition(tmpVec).add(tmpRight).project(cam);
123
+ const aspect = tmpVec2.x / tmpVec2.y;
124
+ const dx = (tmpVec.x * 0.5 + 0.5 - cx) * aspect;
125
+ const dy = tmpVec.y * 0.5 + 0.5 - cy;
126
+ mat.u_limbScreen = Math.max(Math.hypot(dx, dy), 1e-4);
127
+ mat.u_maskEnabled = 1;
128
+ }
129
+ else if (mat) {
130
+ mat.u_maskEnabled = 0;
131
+ }
132
+ });
133
+ return (_jsx("group", { ref: anchorRef, children: _jsxs("mesh", { ref: meshRef, renderOrder: 2, children: [_jsx("planeGeometry", { args: [4.4, 4.4] }), _jsx("flareMaterial", { ref: matRef, transparent: true, depthWrite: false, depthTest: !hostRef && !shooting, blending: AdditiveBlending, u_shootEnabled: shooting ? 1 : 0, ...uniforms })] }) }));
134
+ }
@@ -48,6 +48,7 @@ export default function Frame({ url, isActive, createdObject, position, rotation
48
48
  };
49
49
  if (!texture)
50
50
  return null;
51
+ // console.log('Rendering Frame - url:', url);
51
52
  return (_jsx("mesh", { name: url, ref: frameRef, position: position, rotation: rotation, scale: scale, raycast: () => null, onPointerEnter: handlePointerEnter, onPointerLeave: handlePointerLeave, onClick: onClick, userData: {
52
53
  url,
53
54
  }, children: children ? children : (_jsxs(_Fragment, { children: [_jsx(FrameGeometry, { shapeType: 'rectangle', layoutSettings: layoutSettings, scale: layoutSettings.outerFrameScale }), _jsx(MaterialLibrary, { materialSettings: materialSettings }), showFront && (_jsx(FrameImage, { ref: imageRef, texture: texture, shapeType: 'rectangle', position: [0, 0, 0.02] })), showBack && (_jsx(FrameImage, { texture: texture, shapeType: 'rectangle', position: [0, 0, -0.02], rotation: [0, Math.PI, 0], isBack: true }))] })) }));
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/components/GalleryLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAuC,MAAM,wBAAwB,CAAC;AAKzG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,qBAAqB,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EACvD,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC1C;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmD/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/components/GalleryLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAuC,MAAM,wBAAwB,CAAC;AAKzG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,qBAAqB,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EACvD,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC1C;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoD/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,11 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo, useRef } from 'react';
3
3
  import { updateCurrentLayoutSettings } from '@ntalmagor/3drize-core';
4
4
  import Frame from './Frame.js';
5
- import EffectsGenerator from './EffectsGenerator.js';
6
5
  import { ImageGeometry } from './ImageGeometry.js';
7
6
  const GalleryLayout = ({ createdObject, selectedFrameUrl, handleObjectClick, }) => {
8
7
  const groupRef = useRef(null);
8
+ console.log('GalleryLayout - createdObject:', createdObject);
9
9
  const { config, materialSettings, animations } = createdObject;
10
10
  const galleryLayout = config || {
11
11
  frames: [],
@@ -13,8 +13,8 @@ const GalleryLayout = ({ createdObject, selectedFrameUrl, handleObjectClick, })
13
13
  outerFrameScale: 1,
14
14
  };
15
15
  const { frames, layoutSettings } = useMemo(() => updateCurrentLayoutSettings(galleryLayout), [galleryLayout]);
16
- // console.log('GalleryLayout - frames:', frames);
17
- // console.log('GalleryLayout - layoutSettings:', layoutSettings);
18
- return (_jsx("group", { ref: groupRef, scale: [1, 1, 1], position: [0, 0, 0], rotation: [0, 0, 0], children: frames.map((frame, index) => (_jsxs(Frame, { url: frame.url, isActive: selectedFrameUrl === frame.url, createdObject: createdObject, position: frame.position, rotation: frame.rotation, hoverSettings: { sensitivity: 0.5, applyToChildren: false }, transformEffects: animations?.transform?.effects || [], layoutSettings: layoutSettings, side: galleryLayout?.side || 2, materialSettings: materialSettings, handleObjectClick: handleObjectClick, children: [layoutSettings.geometryType !== 'none' && (_jsx(ImageGeometry, { url: frame.url, geometryType: layoutSettings.geometryType, outerFrameScale: layoutSettings.outerFrameScale })), createdObject.effects?.map((effect, effectIndex) => (_jsx(EffectsGenerator, { settings: effect }, effectIndex)))] }, index))) }));
16
+ console.log('GalleryLayout - frames:', frames);
17
+ console.log('GalleryLayout - layoutSettings:', layoutSettings);
18
+ return (_jsx("group", { ref: groupRef, scale: [1, 1, 1], position: [0, 0, 0], rotation: [0, 0, 0], children: frames.map((frame, index) => (_jsx(Frame, { url: frame.url, isActive: selectedFrameUrl === frame.url, createdObject: createdObject, position: frame.position, rotation: frame.rotation, hoverSettings: { sensitivity: 0.5, applyToChildren: false }, transformEffects: animations?.transform?.effects || [], layoutSettings: layoutSettings, side: galleryLayout?.side || 2, materialSettings: materialSettings, handleObjectClick: handleObjectClick, children: layoutSettings.geometryType !== 'none' && (_jsx(ImageGeometry, { url: frame.url, geometryType: layoutSettings.geometryType, outerFrameScale: layoutSettings.outerFrameScale })) }, index))) }));
19
19
  };
20
20
  export default GalleryLayout;
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- import type { CreatedObjectSettings } from '@ntalmagor/3drize-core';
2
+ import type { GlyphsConfig } from '@ntalmagor/3drize-core';
3
3
  export interface GlyphsProps {
4
- settings: CreatedObjectSettings;
4
+ config: GlyphsConfig;
5
+ boundingRadius?: number;
5
6
  }
6
7
  declare const Glyphs: React.FC<GlyphsProps>;
7
8
  export default Glyphs;
@@ -1 +1 @@
1
- {"version":3,"file":"Glyphs.d.ts","sourceRoot":"","sources":["../../src/components/Glyphs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAE,qBAAqB,EAAgB,MAAM,wBAAwB,CAAC;AAGlF,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA0DjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Glyphs.d.ts","sourceRoot":"","sources":["../../src/components/Glyphs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGlF,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyDjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -3,14 +3,14 @@ import { useEffect, useMemo } from 'react';
3
3
  import { useFrame } from '@react-three/fiber';
4
4
  import * as THREE from 'three';
5
5
  import { GlyphRingMaterial } from '@ntalmagor/3drize-core';
6
- const Glyphs = ({ settings }) => {
7
- const config = settings.config;
6
+ const Glyphs = ({ config, boundingRadius }) => {
8
7
  // The ring sits at r=0.55 within UV space, so the plane must span 2 * ringRadius / 0.55
9
8
  // for the ring's outer edge to land at the configured `ringRadius` in world units.
10
9
  const planeSize = useMemo(() => {
11
- const r = Math.max(0.05, config.ringRadius ?? 1);
10
+ const r = Math.max(0.05, (boundingRadius ?? config.ringRadius ?? 1) * 2);
12
11
  return (2 * r) / 0.55;
13
- }, [config.ringRadius]);
12
+ }, [boundingRadius, config.ringRadius]);
13
+ console.log("Rendering Glyphs with config:", config, "and boundingRadius:", boundingRadius, "resulting in planeSize:", planeSize);
14
14
  const geometry = useMemo(() => new THREE.PlaneGeometry(planeSize, planeSize, 1, 1), [planeSize]);
15
15
  const material = useMemo(() => {
16
16
  const m = new GlyphRingMaterial();
@@ -51,7 +51,7 @@ const Glyphs = ({ settings }) => {
51
51
  const rotSpeed = config.rotationSpeed ?? 0.5;
52
52
  material.uniforms.uRotation.value += delta * rotSpeed * 0.15;
53
53
  });
54
- if (!settings.meshSettings.visible)
54
+ if (!config.enabled)
55
55
  return null;
56
56
  return _jsx("mesh", { geometry: geometry, material: material, frustumCulled: false });
57
57
  };