@3driseai/3drise-viewer 0.1.2 → 0.1.3
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.
- package/dist/components/AnimatedObject.d.ts +2 -1
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +11 -3
- package/dist/components/Bubbles.d.ts +2 -1
- package/dist/components/Bubbles.d.ts.map +1 -1
- package/dist/components/Bubbles.js +5 -2
- package/dist/components/CameraController.d.ts +9 -1
- package/dist/components/CameraController.d.ts.map +1 -1
- package/dist/components/CameraController.js +12 -1
- package/dist/components/Clouds.d.ts +2 -1
- package/dist/components/Clouds.d.ts.map +1 -1
- package/dist/components/Clouds.js +3 -1
- package/dist/components/CreatedObject.d.ts +2 -2
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +5 -6
- package/dist/components/CustomPrimitive.d.ts +2 -2
- package/dist/components/CustomPrimitive.d.ts.map +1 -1
- package/dist/components/CustomPrimitive.js +6 -2
- package/dist/components/Earth.d.ts +2 -4
- package/dist/components/Earth.d.ts.map +1 -1
- package/dist/components/Earth.js +6 -4
- package/dist/components/EffectsGenerator.d.ts +2 -1
- package/dist/components/EffectsGenerator.d.ts.map +1 -1
- package/dist/components/EffectsGenerator.js +26 -25
- package/dist/components/EffectsGroup.d.ts +2 -1
- package/dist/components/EffectsGroup.d.ts.map +1 -1
- package/dist/components/EffectsGroup.js +7 -2
- package/dist/components/EnvironmentManager.js +2 -2
- package/dist/components/EnvironmentObject.d.ts +2 -1
- package/dist/components/EnvironmentObject.d.ts.map +1 -1
- package/dist/components/EnvironmentObject.js +2 -2
- package/dist/components/Frame.d.ts +3 -2
- package/dist/components/Frame.d.ts.map +1 -1
- package/dist/components/Frame.js +3 -1
- package/dist/components/Galaxy.d.ts +2 -3
- package/dist/components/Galaxy.d.ts.map +1 -1
- package/dist/components/Galaxy.js +10 -10
- package/dist/components/GalleryLayout.d.ts +2 -1
- package/dist/components/GalleryLayout.d.ts.map +1 -1
- package/dist/components/GalleryLayout.js +3 -1
- package/dist/components/GeometryShape.d.ts +3 -2
- package/dist/components/GeometryShape.d.ts.map +1 -1
- package/dist/components/GeometryShape.js +17 -6
- package/dist/components/Glyphs.d.ts +2 -1
- package/dist/components/Glyphs.d.ts.map +1 -1
- package/dist/components/Glyphs.js +6 -2
- package/dist/components/GridHelper.d.ts +2 -1
- package/dist/components/GridHelper.d.ts.map +1 -1
- package/dist/components/GridHelper.js +3 -1
- package/dist/components/GridsGenerator.d.ts +2 -1
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +12 -4
- package/dist/components/HdrPlaylistRenderer.d.ts +2 -1
- package/dist/components/HdrPlaylistRenderer.d.ts.map +1 -1
- package/dist/components/HdrPlaylistRenderer.js +3 -1
- package/dist/components/Lensflare.d.ts +2 -1
- package/dist/components/Lensflare.d.ts.map +1 -1
- package/dist/components/Lensflare.js +3 -1
- package/dist/components/Letter.d.ts +3 -2
- package/dist/components/Letter.d.ts.map +1 -1
- package/dist/components/Letter.js +3 -1
- package/dist/components/Letters.d.ts +3 -2
- package/dist/components/Letters.d.ts.map +1 -1
- package/dist/components/Letters.js +3 -1
- package/dist/components/LightObject.d.ts +2 -1
- package/dist/components/LightObject.d.ts.map +1 -1
- package/dist/components/LightObject.js +11 -7
- package/dist/components/LightsManager.d.ts +2 -1
- package/dist/components/LightsManager.d.ts.map +1 -1
- package/dist/components/LightsManager.js +6 -3
- package/dist/components/Lines.d.ts +2 -1
- package/dist/components/Lines.d.ts.map +1 -1
- package/dist/components/Lines.js +2 -2
- package/dist/components/Moon.d.ts +2 -3
- package/dist/components/Moon.d.ts.map +1 -1
- package/dist/components/Moon.js +6 -4
- package/dist/components/MyGrid.d.ts +3 -2
- package/dist/components/MyGrid.d.ts.map +1 -1
- package/dist/components/MyGrid.js +5 -2
- package/dist/components/ObjectNode.d.ts +2 -2
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +29 -24
- package/dist/components/ObjectNodeApi.d.ts +2 -2
- package/dist/components/ObjectNodeApi.d.ts.map +1 -1
- package/dist/components/ObjectNodeApi.js +2 -2
- package/dist/components/ObjectsRenderer.d.ts +2 -1
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +15 -4
- package/dist/components/ObjectsRendererApi.d.ts +2 -1
- package/dist/components/ObjectsRendererApi.d.ts.map +1 -1
- package/dist/components/ObjectsRendererApi.js +2 -2
- package/dist/components/Ocean.d.ts +2 -1
- package/dist/components/Ocean.d.ts.map +1 -1
- package/dist/components/Ocean.js +3 -1
- package/dist/components/Outline.d.ts +3 -2
- package/dist/components/Outline.d.ts.map +1 -1
- package/dist/components/Outline.js +6 -2
- package/dist/components/ParticlesR3f.d.ts +2 -1
- package/dist/components/ParticlesR3f.d.ts.map +1 -1
- package/dist/components/ParticlesR3f.js +3 -1
- package/dist/components/Path.d.ts +2 -1
- package/dist/components/Path.d.ts.map +1 -1
- package/dist/components/Path.js +14 -3
- package/dist/components/PathGeometry.d.ts +2 -1
- package/dist/components/PathGeometry.d.ts.map +1 -1
- package/dist/components/PathGeometry.js +6 -2
- package/dist/components/PathRenderer.d.ts +2 -1
- package/dist/components/PathRenderer.d.ts.map +1 -1
- package/dist/components/PathRenderer.js +6 -2
- package/dist/components/Planet.d.ts +2 -3
- package/dist/components/Planet.d.ts.map +1 -1
- package/dist/components/Planet.js +6 -4
- package/dist/components/PointCloud.d.ts +2 -1
- package/dist/components/PointCloud.d.ts.map +1 -1
- package/dist/components/PointCloud.js +3 -1
- package/dist/components/ProjectLoader.d.ts +2 -1
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +6 -3
- package/dist/components/Rain.d.ts +2 -1
- package/dist/components/Rain.d.ts.map +1 -1
- package/dist/components/Rain.js +7 -1
- package/dist/components/SceneBuilder.d.ts +2 -1
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +2 -2
- package/dist/components/ShootingStar.d.ts +2 -1
- package/dist/components/ShootingStar.d.ts.map +1 -1
- package/dist/components/ShootingStar.js +5 -2
- package/dist/components/ShootingStars.d.ts +2 -1
- package/dist/components/ShootingStars.d.ts.map +1 -1
- package/dist/components/ShootingStars.js +2 -2
- package/dist/components/SkyController.d.ts +3 -2
- package/dist/components/SkyController.d.ts.map +1 -1
- package/dist/components/SkyController.js +9 -6
- package/dist/components/SkyMesh.d.ts +2 -3
- package/dist/components/SkyMesh.d.ts.map +1 -1
- package/dist/components/SkyMesh.js +3 -5
- package/dist/components/SkySystem.d.ts +2 -1
- package/dist/components/SkySystem.d.ts.map +1 -1
- package/dist/components/SkySystem.js +6 -2
- package/dist/components/Skybox.d.ts +2 -1
- package/dist/components/Skybox.d.ts.map +1 -1
- package/dist/components/Skybox.js +5 -2
- package/dist/components/SolarSystem.d.ts +2 -4
- package/dist/components/SolarSystem.d.ts.map +1 -1
- package/dist/components/SolarSystem.js +3 -1
- package/dist/components/SparklesBurst.d.ts +2 -1
- package/dist/components/SparklesBurst.d.ts.map +1 -1
- package/dist/components/SparklesBurst.js +5 -2
- package/dist/components/Stars.d.ts +2 -3
- package/dist/components/Stars.d.ts.map +1 -1
- package/dist/components/Stars.js +3 -2
- package/dist/components/Sun.d.ts +3 -2
- package/dist/components/Sun.d.ts.map +1 -1
- package/dist/components/Sun.js +7 -3
- package/dist/components/SunCore.d.ts +3 -2
- package/dist/components/SunCore.d.ts.map +1 -1
- package/dist/components/SunCore.js +3 -1
- package/dist/components/SunLight.d.ts +2 -1
- package/dist/components/SunLight.d.ts.map +1 -1
- package/dist/components/SunLight.js +3 -1
- package/dist/components/Text2D.d.ts +2 -1
- package/dist/components/Text2D.d.ts.map +1 -1
- package/dist/components/Text2D.js +3 -1
- package/dist/components/Text3D.d.ts +2 -1
- package/dist/components/Text3D.d.ts.map +1 -1
- package/dist/components/Text3D.js +2 -2
- package/dist/components/VolumePoints.d.ts +3 -2
- package/dist/components/VolumePoints.d.ts.map +1 -1
- package/dist/components/VolumePoints.js +6 -2
- package/dist/components/cursor/AuraCursor.d.ts.map +1 -1
- package/dist/components/cursor/AuraCursor.js +3 -1
- package/dist/components/cursor/AuroraCursor.d.ts.map +1 -1
- package/dist/components/cursor/AuroraCursor.js +5 -2
- package/dist/components/cursor/BubblesCursor.d.ts.map +1 -1
- package/dist/components/cursor/BubblesCursor.js +5 -2
- package/dist/components/cursor/CometCursor.d.ts.map +1 -1
- package/dist/components/cursor/CometCursor.js +6 -3
- package/dist/components/cursor/CrosshairCursor.d.ts.map +1 -1
- package/dist/components/cursor/CrosshairCursor.js +6 -3
- package/dist/components/cursor/CursorActions.d.ts +2 -1
- package/dist/components/cursor/CursorActions.d.ts.map +1 -1
- package/dist/components/cursor/CursorActions.js +12 -10
- package/dist/components/cursor/CursorController.d.ts +2 -1
- package/dist/components/cursor/CursorController.d.ts.map +1 -1
- package/dist/components/cursor/CursorController.js +1 -1
- package/dist/components/cursor/CursorEffects.d.ts +3 -2
- package/dist/components/cursor/CursorEffects.d.ts.map +1 -1
- package/dist/components/cursor/CursorEffects.js +3 -1
- package/dist/components/cursor/FerrofluidCursor.d.ts.map +1 -1
- package/dist/components/cursor/FerrofluidCursor.js +3 -1
- package/dist/components/cursor/GlyphRingCursor.d.ts.map +1 -1
- package/dist/components/cursor/GlyphRingCursor.js +3 -1
- package/dist/components/cursor/LightningCursor.d.ts.map +1 -1
- package/dist/components/cursor/LightningCursor.js +3 -1
- package/dist/components/cursor/LiquidMetalCursor.d.ts.map +1 -1
- package/dist/components/cursor/LiquidMetalCursor.js +3 -1
- package/dist/components/cursor/OrbCursor.d.ts.map +1 -1
- package/dist/components/cursor/OrbCursor.js +3 -1
- package/dist/components/cursor/PlasmaWhipCursor.d.ts.map +1 -1
- package/dist/components/cursor/PlasmaWhipCursor.js +3 -1
- package/dist/components/cursor/SparklesCursor.d.ts.map +1 -1
- package/dist/components/cursor/SparklesCursor.js +5 -2
- package/dist/components/cursor/TeslaCursor.d.ts.map +1 -1
- package/dist/components/cursor/TeslaCursor.js +6 -9
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/BoltFlashAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/BoltFlashAction.js +5 -2
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/GlyphInscriptionAction.js +3 -1
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/ImplosionAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/ImplosionAction.js +3 -1
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/PhaseShiftAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/PhaseShiftAction.js +5 -2
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/PlasmaBombAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/PlasmaBombAction.js +5 -2
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/RealityTearAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/RealityTearAction.js +3 -1
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/ShockwaveAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/ShockwaveAction.js +5 -2
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/SparklesBurstAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/SparklesBurstAction.js +3 -1
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts +2 -1
- package/dist/components/cursor/clickActions/VoronoiFractureAction.d.ts.map +1 -1
- package/dist/components/cursor/clickActions/VoronoiFractureAction.js +3 -1
- package/dist/components/cursor/clickActions/index.d.ts +11 -0
- package/dist/components/cursor/clickActions/index.d.ts.map +1 -0
- package/dist/components/cursor/clickActions/index.js +10 -0
- package/dist/components/cursor/index.d.ts +21 -0
- package/dist/components/cursor/index.d.ts.map +1 -0
- package/dist/components/cursor/index.js +19 -0
- package/dist/components/effects/AuraEffect.d.ts +2 -1
- package/dist/components/effects/AuraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuraEffect.js +5 -2
- package/dist/components/effects/AuroraEffect.d.ts +2 -1
- package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuroraEffect.js +3 -1
- package/dist/components/effects/BlackHoleEffect.d.ts +2 -1
- package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
- package/dist/components/effects/BlackHoleEffect.js +3 -1
- package/dist/components/effects/ConstellationEffect.d.ts +2 -1
- package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
- package/dist/components/effects/ConstellationEffect.js +3 -1
- package/dist/components/effects/Corona.d.ts +19 -0
- package/dist/components/effects/Corona.d.ts.map +1 -0
- package/dist/components/effects/Corona.js +15 -0
- package/dist/components/effects/DataStreamEffect.d.ts +2 -1
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
- package/dist/components/effects/DataStreamEffect.js +5 -2
- package/dist/components/effects/DnaHelixEffect.d.ts +2 -1
- package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
- package/dist/components/effects/DnaHelixEffect.js +3 -1
- package/dist/components/effects/Fire.d.ts +3 -2
- package/dist/components/effects/Fire.d.ts.map +1 -1
- package/dist/components/effects/Fire.js +3 -1
- package/dist/components/effects/FireEffect.d.ts +2 -1
- package/dist/components/effects/FireEffect.d.ts.map +1 -1
- package/dist/components/effects/FireEffect.js +5 -2
- package/dist/components/effects/Flares.d.ts +25 -0
- package/dist/components/effects/Flares.d.ts.map +1 -0
- package/dist/components/effects/Flares.js +136 -0
- package/dist/components/effects/ForcefieldEffect.d.ts +2 -1
- package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
- package/dist/components/effects/ForcefieldEffect.js +3 -1
- package/dist/components/effects/HologramEffect.d.ts +2 -1
- package/dist/components/effects/HologramEffect.d.ts.map +1 -1
- package/dist/components/effects/HologramEffect.js +5 -2
- package/dist/components/effects/IceCrystalsEffect.d.ts +2 -1
- package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
- package/dist/components/effects/IceCrystalsEffect.js +3 -1
- package/dist/components/effects/LightningEffect.d.ts +2 -1
- package/dist/components/effects/LightningEffect.d.ts.map +1 -1
- package/dist/components/effects/LightningEffect.js +5 -2
- package/dist/components/effects/MoleculesEffect.d.ts +2 -1
- package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
- package/dist/components/effects/MoleculesEffect.js +5 -2
- package/dist/components/effects/NeuralNetworkEffect.d.ts +2 -1
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
- package/dist/components/effects/NeuralNetworkEffect.js +3 -1
- package/dist/components/effects/OrbEffect.d.ts +2 -1
- package/dist/components/effects/OrbEffect.d.ts.map +1 -1
- package/dist/components/effects/OrbEffect.js +5 -2
- package/dist/components/effects/PortalEffect.d.ts +2 -1
- package/dist/components/effects/PortalEffect.d.ts.map +1 -1
- package/dist/components/effects/PortalEffect.js +5 -2
- package/dist/components/effects/ShockwaveEffect.d.ts +2 -1
- package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
- package/dist/components/effects/ShockwaveEffect.js +5 -2
- package/dist/components/effects/SmokePlumeEffect.d.ts +2 -1
- package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokePlumeEffect.js +5 -2
- package/dist/components/effects/SmokeRibbon.d.ts +3 -2
- package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
- package/dist/components/effects/SmokeRibbon.js +5 -2
- package/dist/components/effects/SmokeRingEffect.d.ts +2 -1
- package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokeRingEffect.js +5 -2
- package/dist/components/effects/VolumetricFogEffect.d.ts +2 -1
- package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
- package/dist/components/effects/VolumetricFogEffect.js +5 -2
- package/dist/components/effects/index.d.ts +28 -0
- package/dist/components/effects/index.d.ts.map +1 -0
- package/dist/components/effects/index.js +24 -0
- package/dist/components/index.d.ts +112 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +77 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/hooks/index.d.ts +55 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +46 -1
- package/dist/hooks/useObjectReady.d.ts +29 -0
- package/dist/hooks/useObjectReady.d.ts.map +1 -0
- package/dist/hooks/useObjectReady.js +59 -0
- package/dist/index.d.ts +4 -135
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -108
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/objectReady.d.ts +24 -0
- package/dist/types/objectReady.d.ts.map +1 -0
- package/dist/types/objectReady.js +1 -0
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import React from "react";
|
|
2
3
|
import type { Object3D } from "three";
|
|
3
4
|
import type { ThreeEvent } from "@react-three/fiber";
|
|
4
5
|
import type { AnimatedTransform, AnchorSettings, CreatedObjectSettings } from "@3driseai/3drise-core";
|
|
5
|
-
export interface AnimatedObjectProps {
|
|
6
|
+
export interface AnimatedObjectProps extends ObjectReadyProps {
|
|
6
7
|
stateKey: string;
|
|
7
8
|
transitionSettings: AnimatedTransform;
|
|
8
9
|
createdObject: CreatedObjectSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedObject.d.ts","sourceRoot":"","sources":["../../src/components/AnimatedObject.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimatedObject.d.ts","sourceRoot":"","sources":["../../src/components/AnimatedObject.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAM7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACtG,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,qBAAqB,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACjH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAGD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+DvD,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useEffect, useCallback, memo } from 'react';
|
|
3
4
|
import { usePathAnimation } from '../hooks/usePathAnimation.js';
|
|
4
5
|
import EffectsGroup from './EffectsGroup.js';
|
|
@@ -6,11 +7,18 @@ import { useObjectAnimation } from '../hooks/useObjectAnimation.js';
|
|
|
6
7
|
import { hasHoverAnimation } from '../utils/hasHoverAnimation.js';
|
|
7
8
|
export const AnimatedObject = memo(({ stateKey, transitionSettings, createdObject,
|
|
8
9
|
// speed = 1,
|
|
9
|
-
visible = true, children, parentRef, handleObjectClick, onPointerEnter, onPointerLeave, anchor, hovered = false, animateMaterial = true,
|
|
10
|
+
visible = true, children, parentRef, handleObjectClick, onPointerEnter, onPointerLeave, anchor, hovered = false, animateMaterial = true, onObjectReady, onObjectDispose,
|
|
10
11
|
// isActive = false,
|
|
11
12
|
}) => {
|
|
12
13
|
const internalRef = useRef(null);
|
|
13
14
|
const groupRef = parentRef ?? internalRef;
|
|
15
|
+
// Ownership rule: whoever creates the group reports it. CreatedObject passes
|
|
16
|
+
// its own meshRef in as parentRef, so groupRef is literally CreatedObject's
|
|
17
|
+
// object — reporting it here as well would fire twice for one Object3D.
|
|
18
|
+
// Standalone use (no parentRef) means this component owns the group, so it
|
|
19
|
+
// reports. `unownedRef` stays null, which the hook treats as nothing to report.
|
|
20
|
+
const unownedRef = useRef(null);
|
|
21
|
+
useObjectReady(parentRef ? unownedRef : groupRef, createdObject, onObjectReady, onObjectDispose);
|
|
14
22
|
const { position, scale, rotation, targetPosition, targetScale, targetRotation } = transitionSettings;
|
|
15
23
|
const animationStartTime = useRef(null);
|
|
16
24
|
const stepDuration = useRef(1);
|
|
@@ -57,9 +65,9 @@ visible = true, children, parentRef, handleObjectClick, onPointerEnter, onPointe
|
|
|
57
65
|
return _jsx(_Fragment, { children: _jsxs("group", { ref: groupRef, position: position, scale: scale, rotation: rotation, visible: visible, onClick: onClick,
|
|
58
66
|
// onPointerEnter={onPointerEnter}
|
|
59
67
|
// onPointerLeave={onPointerLeave}
|
|
60
|
-
name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject })] }) });
|
|
68
|
+
name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }) });
|
|
61
69
|
}
|
|
62
|
-
return (_jsx(_Fragment, { children: _jsxs("group", { ref: groupRef, position: position, scale: scale, rotation: rotation, visible: visible, onClick: onClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject })] }) }));
|
|
70
|
+
return (_jsx(_Fragment, { children: _jsxs("group", { ref: groupRef, position: position, scale: scale, rotation: rotation, visible: visible, onClick: onClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }) }));
|
|
63
71
|
});
|
|
64
72
|
AnimatedObject.displayName = 'AnimatedObject';
|
|
65
73
|
export default AnimatedObject;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { BubblesConfig } from '@3driseai/3drise-core';
|
|
2
3
|
import React from "react";
|
|
3
|
-
export interface BubblesProps {
|
|
4
|
+
export interface BubblesProps extends ObjectReadyProps {
|
|
4
5
|
config: BubblesConfig;
|
|
5
6
|
boundingRadius?: number;
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bubbles.d.ts","sourceRoot":"","sources":["../../src/components/Bubbles.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Bubbles.d.ts","sourceRoot":"","sources":["../../src/components/Bubbles.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IAClD,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAID,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAmGnC,CAAC;AACF,eAAe,OAAO,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useEffect, useMemo, useRef } from 'react';
|
|
3
4
|
import { useFrame } from '@react-three/fiber';
|
|
4
5
|
import * as THREE from 'three';
|
|
5
6
|
import { BubblesPointsMaterial } from '@3driseai/3drise-core';
|
|
6
7
|
const MAX_BUBBLES = 256;
|
|
7
|
-
const Bubbles = ({ config }) => {
|
|
8
|
+
const Bubbles = ({ config, onObjectReady, onObjectDispose }) => {
|
|
8
9
|
const positions = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
|
|
9
10
|
const velocities = useMemo(() => new Float32Array(MAX_BUBBLES * 3), []);
|
|
10
11
|
const ages = useMemo(() => new Float32Array(MAX_BUBBLES), []);
|
|
@@ -43,6 +44,8 @@ const Bubbles = ({ config }) => {
|
|
|
43
44
|
}, [config.colors, config.scale, config.opacity, config.iridescence, config.speed, material]);
|
|
44
45
|
useEffect(() => () => { geometry.dispose(); material.dispose(); }, [geometry, material]);
|
|
45
46
|
const spawnAccum = useRef(0);
|
|
47
|
+
const rootRef = useRef(null);
|
|
48
|
+
useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
|
|
46
49
|
useFrame((state, delta) => {
|
|
47
50
|
material.uniforms.uTime.value = state.clock.getElapsedTime();
|
|
48
51
|
const scale = config.scale ?? 1;
|
|
@@ -100,6 +103,6 @@ const Bubbles = ({ config }) => {
|
|
|
100
103
|
});
|
|
101
104
|
if (!config.enabled)
|
|
102
105
|
return null;
|
|
103
|
-
return _jsx("points", { geometry: geometry, material: material, frustumCulled: false });
|
|
106
|
+
return _jsx("points", { ref: rootRef, geometry: geometry, material: material, frustumCulled: false });
|
|
104
107
|
};
|
|
105
108
|
export default Bubbles;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { CameraState } from "@3driseai/3drise-core";
|
|
2
|
-
interface CameraControllerProps {
|
|
3
|
+
interface CameraControllerProps extends ObjectReadyProps {
|
|
3
4
|
settings: CameraState;
|
|
4
5
|
enableAutoAnimation?: boolean;
|
|
5
6
|
animationDuration?: number;
|
|
6
7
|
animationEase?: string;
|
|
8
|
+
/**
|
|
9
|
+
* drei's OrbitControls instance is not an Object3D, so it cannot travel
|
|
10
|
+
* through onObjectReady — it gets its own pair. onObjectReady reports the
|
|
11
|
+
* camera, which is an Object3D.
|
|
12
|
+
*/
|
|
13
|
+
onControlsReady?: (controls: any) => void;
|
|
14
|
+
onControlsDispose?: (controls: any) => void;
|
|
7
15
|
}
|
|
8
16
|
export declare const CameraController: React.FC<CameraControllerProps>;
|
|
9
17
|
export default CameraController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraController.d.ts","sourceRoot":"","sources":["../../src/components/CameraController.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CameraController.d.ts","sourceRoot":"","sources":["../../src/components/CameraController.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,UAAU,qBAAsB,SAAQ,gBAAgB;IACpD,QAAQ,EAAE,WAAW,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/C;AAGD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8J5D,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useEffect, useRef } from 'react';
|
|
3
4
|
import { useFrame, useThree } from '@react-three/fiber';
|
|
4
5
|
import { useCameraAnimation } from '../hooks/useCameraAnimation.js';
|
|
@@ -6,11 +7,21 @@ import { cameraManager } from '../utils/CameraSingleton.js';
|
|
|
6
7
|
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
7
8
|
import { usePathAnimation } from '../hooks/usePathAnimation.js';
|
|
8
9
|
import { OrbitControls } from "@react-three/drei";
|
|
9
|
-
export const CameraController = ({ enableAutoAnimation = true, animationDuration = 1, animationEase = "power2.out", settings, }) => {
|
|
10
|
+
export const CameraController = ({ enableAutoAnimation = true, animationDuration = 1, animationEase = "power2.out", settings, onObjectReady, onObjectDispose, onControlsReady, onControlsDispose, }) => {
|
|
10
11
|
const { camera, set } = useThree();
|
|
11
12
|
const cameraRef = useRef(camera);
|
|
12
13
|
const transformAnimationProgress = useRef(0);
|
|
13
14
|
const controlsRef = useRef(null);
|
|
15
|
+
useObjectReady(cameraRef, settings, onObjectReady, onObjectDispose);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const controls = controlsRef.current;
|
|
18
|
+
if (!controls)
|
|
19
|
+
return;
|
|
20
|
+
onControlsReady && onControlsReady(controls);
|
|
21
|
+
return () => {
|
|
22
|
+
onControlsDispose && onControlsDispose(controls);
|
|
23
|
+
};
|
|
24
|
+
}, [controlsRef.current]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
14
25
|
const { position, orientation, fov, near, far, controls } = settings;
|
|
15
26
|
const initialControls = useRef(controls);
|
|
16
27
|
const { startPathAnimation, updatePathAnimation, isAnimating: isPathAnimating, } = usePathAnimation();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { TimeSettings, CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
2
3
|
import React from "react";
|
|
3
|
-
export interface CloudsProps {
|
|
4
|
+
export interface CloudsProps extends ObjectReadyProps {
|
|
4
5
|
settings: CreatedObjectSettings;
|
|
5
6
|
timeSettings?: TimeSettings;
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Clouds.d.ts","sourceRoot":"","sources":["../../src/components/Clouds.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,QAAQ,EAAE,qBAAqB,CAAC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAmFD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA6LjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useCallback } from 'react';
|
|
3
4
|
import * as THREE from 'three';
|
|
4
5
|
import { useThree, useFrame } from '@react-three/fiber';
|
|
@@ -86,7 +87,7 @@ const defaultTimeSettings = {
|
|
|
86
87
|
syncWithRealTime: false,
|
|
87
88
|
autoAnimate: false,
|
|
88
89
|
};
|
|
89
|
-
const Clouds = ({ settings, timeSettings = defaultTimeSettings }) => {
|
|
90
|
+
const Clouds = ({ settings, timeSettings = defaultTimeSettings, onObjectReady, onObjectDispose }) => {
|
|
90
91
|
const visible = settings.meshSettings.visible ?? true;
|
|
91
92
|
const meshSettings = settings.meshSettings;
|
|
92
93
|
const config = settings.config;
|
|
@@ -100,6 +101,7 @@ const Clouds = ({ settings, timeSettings = defaultTimeSettings }) => {
|
|
|
100
101
|
const planeSize = config?.planeSize || [10000, 10000];
|
|
101
102
|
const planeSegments = config?.planeSegments || 64;
|
|
102
103
|
const meshRef = useRef(null);
|
|
104
|
+
useObjectReady(meshRef, settings, onObjectReady, onObjectDispose);
|
|
103
105
|
const cloudAnimTime = useRef(0);
|
|
104
106
|
const { camera } = useThree();
|
|
105
107
|
const cloudColorRef = useRef(new THREE.Color(1, 1, 1));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
2
|
+
import type { ObjectReadyProps } from "../types/objectReady";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { Object3D } from "three";
|
|
4
5
|
import { type ThreeEvent } from "@react-three/fiber";
|
|
5
|
-
interface CreatedObjectProps {
|
|
6
|
+
interface CreatedObjectProps extends ObjectReadyProps {
|
|
6
7
|
createdObject: CreatedObjectSettings;
|
|
7
8
|
children: React.ReactNode;
|
|
8
9
|
shouldApply3driseMaterial?: boolean;
|
|
9
|
-
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
10
10
|
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
11
11
|
}
|
|
12
12
|
declare const CreatedObject: React.FC<CreatedObjectProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAUnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,kBAAmB,SAAQ,gBAAgB;IACjD,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqF9C,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -9,7 +9,8 @@ import { cameraManager } from "../utils/CameraSingleton.js";
|
|
|
9
9
|
import AnimatedObject from "./AnimatedObject.js";
|
|
10
10
|
import { useFrameEffects } from "../hooks/useFrameEffects.js";
|
|
11
11
|
import { useObjectEdges } from "../hooks/useObjectEdges.js";
|
|
12
|
-
|
|
12
|
+
import { useObjectReady } from "../hooks/useObjectReady.js";
|
|
13
|
+
const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial = true, onObjectReady, onObjectDispose, handleObjectClick, }) => {
|
|
13
14
|
const isSelected = false;
|
|
14
15
|
// const isSelected = useObjectSelection(createdObject.id);
|
|
15
16
|
// const { handleObjectClick: contextHandleObjectClick } = useSceneClick();
|
|
@@ -34,11 +35,9 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
|
|
|
34
35
|
useEffect(() => {
|
|
35
36
|
if (meshRef.current) {
|
|
36
37
|
meshRef.current.userData.id = createdObject.id;
|
|
37
|
-
onObjectReady && onObjectReady(createdObject, meshRef.current);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, [meshRef.current]);
|
|
39
|
+
}, [meshRef.current, createdObject.id]);
|
|
40
|
+
useObjectReady(meshRef, createdObject, onObjectReady, onObjectDispose);
|
|
42
41
|
useEffect(() => {
|
|
43
42
|
if (transformRef.current && isSelected) {
|
|
44
43
|
controllersRef.current.set(createdObject.id.toString(), transformRef.current);
|
|
@@ -94,7 +93,7 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
|
|
|
94
93
|
position: anchorEnabled ? [anchoredPosition.x, anchoredPosition.y, anchoredPosition.z] : animatedTransform.position
|
|
95
94
|
}, createdObject: createdObject,
|
|
96
95
|
// animateMaterial={!useDreiMaterials}
|
|
97
|
-
parentRef: meshRef, visible: createdObject.meshSettings.visible, handleObjectClick: handleObjectClick, onPointerEnter: handleObjectEnter, onPointerLeave: e => handleObjectLeave(e), hovered: hovered, children: createdObject.rigidBodySettings?.enabled ? (_jsx(RigidBody, { type: createdObject.rigidBodySettings?.type || 'dynamic', mass: createdObject.rigidBodySettings?.mass || 1, colliders: createdObject.userData?.type === 'plane'
|
|
96
|
+
parentRef: meshRef, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose, visible: createdObject.meshSettings.visible, handleObjectClick: handleObjectClick, onPointerEnter: handleObjectEnter, onPointerLeave: e => handleObjectLeave(e), hovered: hovered, children: createdObject.rigidBodySettings?.enabled ? (_jsx(RigidBody, { type: createdObject.rigidBodySettings?.type || 'dynamic', mass: createdObject.rigidBodySettings?.mass || 1, colliders: createdObject.userData?.type === 'plane'
|
|
98
97
|
? 'cuboid' // Force box collider for planes
|
|
99
98
|
: undefined // Auto-detect for others
|
|
100
99
|
, friction: createdObject.rigidBodySettings?.friction, restitution: createdObject.rigidBodySettings?.restitution, gravityScale: createdObject.rigidBodySettings?.gravityScale ?? 1, linearDamping: createdObject.rigidBodySettings?.linearDamping ?? 0.01, angularDamping: createdObject.rigidBodySettings?.angularDamping ?? 0.01, children: children })) : (children) }));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
2
2
|
import type { Object3D } from 'three';
|
|
3
|
+
import type { ObjectReadyProps } from "../types/objectReady";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import { type ThreeEvent } from "@react-three/fiber";
|
|
5
|
-
interface CustomPrimitiveProps {
|
|
6
|
+
interface CustomPrimitiveProps extends ObjectReadyProps {
|
|
6
7
|
createdObject: CreatedObjectSettings;
|
|
7
|
-
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
8
8
|
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
9
9
|
}
|
|
10
10
|
declare const CustomPrimitive: React.FC<CustomPrimitiveProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,UAAU,oBAAqB,SAAQ,gBAAgB;IACnD,aAAa,EAAE,qBAAqB,CAAC;IACrC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgFlD,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -5,8 +5,11 @@ import { Vector3 } from "three";
|
|
|
5
5
|
import MaterialLibrary from "./MaterialLibrary.js";
|
|
6
6
|
import { useWaterReflections } from "../hooks/useWaterReflections.js";
|
|
7
7
|
import { GeometryMesh } from "./GeometryShape.js";
|
|
8
|
-
|
|
8
|
+
import { useObjectReady } from "../hooks/useObjectReady.js";
|
|
9
|
+
const CustomPrimitive = memo(({ createdObject, onObjectReady, onObjectDispose, handleObjectClick, }) => {
|
|
9
10
|
const meshRef = useRef(null);
|
|
11
|
+
// CustomPrimitive accepted onObjectReady but never fired it; this is the fix.
|
|
12
|
+
useObjectReady(meshRef, createdObject, onObjectReady, onObjectDispose);
|
|
10
13
|
const resolvedObject = useMemo(() => {
|
|
11
14
|
// console.log(`Resolving object for ${createdObject.name}`, createdObject);
|
|
12
15
|
if (!createdObject)
|
|
@@ -75,8 +78,9 @@ const CustomPrimitive = memo(({ createdObject, onObjectReady, handleObjectClick,
|
|
|
75
78
|
// else if (materialType === 'line') {
|
|
76
79
|
// mode = 'outline';
|
|
77
80
|
// }
|
|
81
|
+
// console.log({createdObject});
|
|
78
82
|
if (createdObject.type === 'mesh')
|
|
79
|
-
return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, materialSettings: createdObject.materialSettings, animations: createdObject.animations, modeConfig: createdObject.modeConfig || { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 } }) }, createdObject.id);
|
|
83
|
+
return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, materialSettings: createdObject.materialSettings, animations: createdObject.animations, onObjectReady: (_object, ref) => onObjectReady && onObjectReady(createdObject, ref), onObjectDispose: (_object, ref) => onObjectDispose && onObjectDispose(createdObject, ref), modeConfig: createdObject.modeConfig || { mode: 'solid', count: 1000, symmetry: 3, spacing: 0.1, slices: 8, linkRadius: 0.05, angle: 18, lineWidth: 1 } }) }, createdObject.id);
|
|
80
84
|
if (!resolvedObject) {
|
|
81
85
|
console.warn(`no resolved object for ${createdObject.name} (${createdObject.id})`);
|
|
82
86
|
return null;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { EarthConfig } from "@3driseai/3drise-core";
|
|
4
|
-
declare const Earth: React.FC<EarthConfig &
|
|
5
|
-
onMeshReady?: (mesh: THREE.Mesh) => void;
|
|
6
|
-
}>;
|
|
4
|
+
declare const Earth: React.FC<EarthConfig & ObjectReadyProps>;
|
|
7
5
|
export default Earth;
|
|
8
6
|
//# sourceMappingURL=Earth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Earth.d.ts","sourceRoot":"","sources":["../../src/components/Earth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Earth.d.ts","sourceRoot":"","sources":["../../src/components/Earth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMpD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG,gBAAgB,CA4BnD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/dist/components/Earth.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useMemo, useCallback, useEffect } from 'react';
|
|
3
4
|
import * as THREE from 'three';
|
|
4
5
|
import { useTexture } from '@react-three/drei';
|
|
@@ -6,8 +7,10 @@ const CDN = 'https://3d-rise.sfo3.cdn.digitaloceanspaces.com/app/images/planets'
|
|
|
6
7
|
const EARTH_DAY_URL = `${CDN}/earth_day_4096.jpg`;
|
|
7
8
|
const EARTH_NIGHT_URL = `${CDN}/earth_night_4096.jpg`;
|
|
8
9
|
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,
|
|
10
|
+
const Earth = ({ sunPosition = [0, 0, 3], atmosphereDayColor = '#4db2ff', atmosphereTwilightColor = '#bc490b', radius = 1, onObjectReady, onObjectDispose, }) => {
|
|
10
11
|
const globeRef = useRef(null);
|
|
12
|
+
const rootRef = useRef(null);
|
|
13
|
+
useObjectReady(rootRef, { sunPosition, atmosphereDayColor, atmosphereTwilightColor, radius }, onObjectReady, onObjectDispose);
|
|
11
14
|
const globeMatRef = useRef(null);
|
|
12
15
|
const atmosphereMatRef = useRef(null);
|
|
13
16
|
const segments = 64;
|
|
@@ -29,10 +32,9 @@ const Earth = ({ sunPosition = [0, 0, 3], atmosphereDayColor = '#4db2ff', atmosp
|
|
|
29
32
|
const handleGlobeRef = useCallback((mesh) => {
|
|
30
33
|
if (mesh) {
|
|
31
34
|
globeRef.current = mesh;
|
|
32
|
-
onMeshReady?.(mesh);
|
|
33
35
|
}
|
|
34
|
-
}, [
|
|
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 })] })] }));
|
|
36
|
+
}, []);
|
|
37
|
+
return (_jsxs("group", { ref: rootRef, 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 })] })] }));
|
|
36
38
|
};
|
|
37
39
|
Earth.displayName = 'Earth';
|
|
38
40
|
export default Earth;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Object3D } from 'three';
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { GenerativeEffectSettings } from "@3driseai/3drise-core";
|
|
4
|
-
|
|
4
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
5
|
+
export interface EffectsGeneratorProps extends ObjectReadyProps {
|
|
5
6
|
settings: GenerativeEffectSettings;
|
|
6
7
|
object?: Object3D | null;
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAyBtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"EffectsGenerator.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGenerator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAyBtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC3D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC5B;AAGD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA4CrD,CAAC;AACF,eAAe,gBAAgB,CAAC"}
|
|
@@ -19,17 +19,15 @@ import IceCrystalsEffect from './effects/IceCrystalsEffect.js';
|
|
|
19
19
|
import SmokePlumeEffect from './effects/SmokePlumeEffect.js';
|
|
20
20
|
import VolumetricFogEffect from './effects/VolumetricFogEffect.js';
|
|
21
21
|
import SmokeRingEffect from './effects/SmokeRingEffect.js';
|
|
22
|
-
import Flares from './Flares.js';
|
|
22
|
+
import Flares from './effects/Flares.js';
|
|
23
23
|
import SparklesBurst from './SparklesBurst.js';
|
|
24
24
|
import Bubbles from './Bubbles.js';
|
|
25
25
|
import Glyphs from './Glyphs.js';
|
|
26
26
|
import Fire from './effects/Fire.js';
|
|
27
27
|
import SmokeRibbon from './effects/SmokeRibbon.js';
|
|
28
|
-
const EffectsGenerator = ({ settings, object }) => {
|
|
28
|
+
const EffectsGenerator = ({ settings, object, onObjectReady, onObjectDispose }) => {
|
|
29
29
|
console.log('EffectsGenerator render with settings:', settings, 'and object:', object);
|
|
30
30
|
const { config } = settings;
|
|
31
|
-
if (!config.enabled)
|
|
32
|
-
return null;
|
|
33
31
|
// console.log('Effect config:', config);
|
|
34
32
|
const boundingRadius = useMemo(() => {
|
|
35
33
|
if (!object)
|
|
@@ -39,32 +37,35 @@ const EffectsGenerator = ({ settings, object }) => {
|
|
|
39
37
|
box.getBoundingSphere(sphere);
|
|
40
38
|
return sphere.radius || 1;
|
|
41
39
|
}, [object]);
|
|
40
|
+
if (!config.enabled)
|
|
41
|
+
return null;
|
|
42
42
|
const animations = settings.animations;
|
|
43
|
+
const ready = { onObjectReady, onObjectDispose };
|
|
43
44
|
switch (config.type) {
|
|
44
|
-
case 'molecules': return _jsx(MoleculesEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
45
|
-
case 'shockwave': return _jsx(ShockwaveEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
46
|
-
case 'aura': return _jsx(AuraEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
47
|
-
case 'dataStream': return _jsx(DataStreamEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
48
|
-
case 'constellation': return _jsx(ConstellationEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
49
|
-
case 'hologram': return _jsx(HologramEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
50
|
-
case 'portal': return _jsx(PortalEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
51
|
-
case 'dnaHelix': return _jsx(DnaHelixEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
52
|
-
case 'orb': return _jsx(OrbEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
53
|
-
case 'lightning': return _jsx(LightningEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
54
|
-
case 'aurora': return _jsx(AuroraEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
55
|
-
case 'forcefield': return _jsx(ForcefieldEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
56
|
-
case 'neuralNetwork': return _jsx(NeuralNetworkEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
57
|
-
case 'blackHole': return _jsx(BlackHoleEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
58
|
-
case 'iceCrystals': return _jsx(IceCrystalsEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
59
|
-
case 'smokePlume': return _jsx(SmokePlumeEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
60
|
-
case 'volumetricFog': return _jsx(VolumetricFogEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
61
|
-
case 'smokeRing': return _jsx(SmokeRingEffect, { boundingRadius: boundingRadius, config: config, animations: animations });
|
|
62
|
-
case 'fire': return _jsx(Fire, { hostRef: object, config: config, animations: animations });
|
|
63
|
-
case 'flares': return _jsx(Flares, { hostRef: object, config: config, animations: animations });
|
|
45
|
+
case 'molecules': return _jsx(MoleculesEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
46
|
+
case 'shockwave': return _jsx(ShockwaveEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
47
|
+
case 'aura': return _jsx(AuraEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
48
|
+
case 'dataStream': return _jsx(DataStreamEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
49
|
+
case 'constellation': return _jsx(ConstellationEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
50
|
+
case 'hologram': return _jsx(HologramEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
51
|
+
case 'portal': return _jsx(PortalEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
52
|
+
case 'dnaHelix': return _jsx(DnaHelixEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
53
|
+
case 'orb': return _jsx(OrbEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
54
|
+
case 'lightning': return _jsx(LightningEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
55
|
+
case 'aurora': return _jsx(AuroraEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
56
|
+
case 'forcefield': return _jsx(ForcefieldEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
57
|
+
case 'neuralNetwork': return _jsx(NeuralNetworkEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
58
|
+
case 'blackHole': return _jsx(BlackHoleEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
59
|
+
case 'iceCrystals': return _jsx(IceCrystalsEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
60
|
+
case 'smokePlume': return _jsx(SmokePlumeEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
61
|
+
case 'volumetricFog': return _jsx(VolumetricFogEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
62
|
+
case 'smokeRing': return _jsx(SmokeRingEffect, { boundingRadius: boundingRadius, config: config, animations: animations, ...ready });
|
|
63
|
+
case 'fire': return _jsx(Fire, { hostRef: object, config: config, animations: animations, ...ready });
|
|
64
|
+
case 'flares': return _jsx(Flares, { hostRef: object, config: config, animations: animations, ...ready });
|
|
64
65
|
case 'sparklesBurst': return _jsx(SparklesBurst, { boundingRadius: boundingRadius, config: config });
|
|
65
66
|
case 'bubbles': return _jsx(Bubbles, { boundingRadius: boundingRadius, config: config });
|
|
66
67
|
case 'glyphs': return _jsx(Glyphs, { boundingRadius: boundingRadius, config: config });
|
|
67
|
-
case 'smokeRibbon': return _jsx(SmokeRibbon, { config: config, boundingRadius: boundingRadius });
|
|
68
|
+
case 'smokeRibbon': return _jsx(SmokeRibbon, { config: config, boundingRadius: boundingRadius, ...ready });
|
|
68
69
|
default: return null;
|
|
69
70
|
}
|
|
70
71
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { CreatedObjectSettings } from '@3driseai/3drise-core';
|
|
2
3
|
import React from "react";
|
|
3
|
-
interface EffectsGroupProps {
|
|
4
|
+
interface EffectsGroupProps extends ObjectReadyProps {
|
|
4
5
|
createdObject: CreatedObjectSettings;
|
|
5
6
|
}
|
|
6
7
|
declare const EffectsGroup: React.FC<EffectsGroupProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EffectsGroup.d.ts","sourceRoot":"","sources":["../../src/components/EffectsGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,UAAU,iBAAkB,SAAQ,gBAAgB;IAChD,aAAa,EAAE,qBAAqB,CAAC;CACxC;AAGD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAQ7C,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
4
|
import { GEREATIVE_EFFECTS_KEY } from '@3driseai/3drise-core';
|
|
3
5
|
import EffectsGenerator from './EffectsGenerator.js';
|
|
4
6
|
import { findById } from '../utils/sceneQuery.js';
|
|
5
|
-
const EffectsGroup = ({ createdObject }) => {
|
|
7
|
+
const EffectsGroup = ({ createdObject, onObjectReady, onObjectDispose }) => {
|
|
8
|
+
// Hooks must run before the early return below.
|
|
9
|
+
const groupRef = useRef(null);
|
|
10
|
+
useObjectReady(groupRef, createdObject, onObjectReady, onObjectDispose);
|
|
6
11
|
if (!createdObject.effects || createdObject.effects.length === 0)
|
|
7
12
|
return null;
|
|
8
13
|
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))) }));
|
|
14
|
+
return (_jsx("group", { ref: groupRef, name: `${createdObject.id}-effects`, userData: { [GEREATIVE_EFFECTS_KEY]: true }, children: createdObject.effects.map((effect, index) => (_jsx(EffectsGenerator, { settings: effect, object: object, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose }, index))) }));
|
|
10
15
|
};
|
|
11
16
|
export default EffectsGroup;
|
|
@@ -7,7 +7,7 @@ import SkySystem from './SkySystem.js';
|
|
|
7
7
|
import { useCubeCamera } from '../hooks/useCubeCamera.js';
|
|
8
8
|
import HdrPlaylistRenderer from './HdrPlaylistRenderer.js';
|
|
9
9
|
import { getTransitionSettings } from '@3driseai/3drise-core';
|
|
10
|
-
const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512, timeSettings, onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
10
|
+
const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512, timeSettings, onTimeOfDayChange, onTimeUpdate, onObjectReady, onObjectDispose, }, ref) => {
|
|
11
11
|
const { scene } = useThree();
|
|
12
12
|
const defaultHdr = {
|
|
13
13
|
visible: false,
|
|
@@ -68,7 +68,7 @@ const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512
|
|
|
68
68
|
scale: hdr.settings.groundScale,
|
|
69
69
|
} }));
|
|
70
70
|
}, [playlistActive, singleUrl, backgroundName, hdr.settings, scene]);
|
|
71
|
-
return (_jsxs(_Fragment, { children: [environmentComponent, playlistActive && urls && (_jsx(HdrPlaylistRenderer, { urls: urls, transition: getTransitionSettings(hdr) })), _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sunSize, moonSize: moonSize, skyboxScale: skyboxScale, sunIntensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, playerPosition: playerPosition, starsSettings: starsSettings, cloudsSettings: cloudsSettings, cloudsMaterialSettings: cloudsMaterialSettings, skyControllerSettings: skyControllerSettings, rainSettings: rainSettings, fogSettings: fogSettings, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate })] }));
|
|
71
|
+
return (_jsxs(_Fragment, { children: [environmentComponent, playlistActive && urls && (_jsx(HdrPlaylistRenderer, { urls: urls, transition: getTransitionSettings(hdr), onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })), _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sunSize, moonSize: moonSize, skyboxScale: skyboxScale, sunIntensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, playerPosition: playerPosition, starsSettings: starsSettings, cloudsSettings: cloudsSettings, cloudsMaterialSettings: cloudsMaterialSettings, skyControllerSettings: skyControllerSettings, rainSettings: rainSettings, fogSettings: fogSettings, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })] }));
|
|
72
72
|
});
|
|
73
73
|
EnvironmentManager.displayName = 'EnvironmentManager';
|
|
74
74
|
export default EnvironmentManager;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import React from "react";
|
|
2
3
|
import type { CreatedObjectSettings } from "@3driseai/3drise-core";
|
|
3
|
-
type EnvironmentObjectProps = {
|
|
4
|
+
type EnvironmentObjectProps = ObjectReadyProps & {
|
|
4
5
|
createdObject: CreatedObjectSettings;
|
|
5
6
|
};
|
|
6
7
|
declare const EnvironmentObject: React.FC<EnvironmentObjectProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentObject.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentObject.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnvironmentObject.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentObject.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,KAAK,sBAAsB,GAAG,gBAAgB,GAAG;IAC7C,aAAa,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAGF,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAUvD,CAAC;AACF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Rain from './Rain.js';
|
|
3
|
-
const EnvironmentObject = ({ createdObject }) => {
|
|
3
|
+
const EnvironmentObject = ({ createdObject, onObjectReady, onObjectDispose }) => {
|
|
4
4
|
const config = createdObject.config;
|
|
5
5
|
if (!config || config.enabled === false)
|
|
6
6
|
return null;
|
|
7
7
|
switch (config.type) {
|
|
8
8
|
case 'rain':
|
|
9
|
-
return _jsx(Rain, { settings: createdObject });
|
|
9
|
+
return _jsx(Rain, { settings: createdObject, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose });
|
|
10
10
|
default:
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { ObjectReadyProps } from '../types/objectReady';
|
|
1
2
|
import type { Object3D } from 'three';
|
|
2
3
|
import type { CreatedObjectSettings, HoverSettings, GalleryLayoutSettings, TransformEffect, ColorEffect, MaterialSettings } from '@3driseai/3drise-core';
|
|
3
4
|
import type { FrameShapeType } from './FrameGeometry';
|
|
4
5
|
import { type ThreeEvent } from "@react-three/fiber";
|
|
5
6
|
export type { FrameShapeType };
|
|
6
|
-
export interface FrameProps {
|
|
7
|
+
export interface FrameProps extends ObjectReadyProps {
|
|
7
8
|
url: string;
|
|
8
9
|
isActive: boolean;
|
|
9
10
|
createdObject: CreatedObjectSettings;
|
|
@@ -19,5 +20,5 @@ export interface FrameProps {
|
|
|
19
20
|
children?: React.ReactNode;
|
|
20
21
|
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
21
22
|
}
|
|
22
|
-
export default function Frame({ url, isActive, createdObject, position, rotation, shapeType, hoverSettings, transformEffects, colorEffects, layoutSettings, side, materialSettings, children, handleObjectClick, }: FrameProps): import("react").JSX.Element;
|
|
23
|
+
export default function Frame({ url, isActive, createdObject, position, rotation, shapeType, hoverSettings, transformEffects, colorEffects, layoutSettings, side, materialSettings, children, handleObjectClick, onObjectReady, onObjectDispose, }: FrameProps): import("react").JSX.Element;
|
|
23
24
|
//# sourceMappingURL=Frame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../src/components/Frame.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../src/components/Frame.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzJ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKtD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,cAAc,EAAE,qBAAqB,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAGD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAoB,EAAE,aAAa,EAAE,gBAAqB,EAAE,YAAiB,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,GAAG,EAAE,UAAU,+BA4ClR"}
|
package/dist/components/Frame.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useObjectReady } from '../hooks/useObjectReady.js';
|
|
2
3
|
import { useRef, useState, useEffect } from "react";
|
|
3
4
|
import { useCursor } from "@react-three/drei";
|
|
4
5
|
import { BackSide, DoubleSide, FrontSide, Mesh } from "three";
|
|
@@ -8,8 +9,9 @@ import { FrameImage } from "./FrameImage.js";
|
|
|
8
9
|
import MaterialLibrary from "./MaterialLibrary.js";
|
|
9
10
|
import { useFrameEffects } from "../hooks/useFrameEffects.js";
|
|
10
11
|
import { useObjectAnimation } from "../hooks/useObjectAnimation.js";
|
|
11
|
-
export default function Frame({ url, isActive, createdObject, position, rotation, shapeType = 'circle', hoverSettings, transformEffects = [], colorEffects = [], layoutSettings, side, materialSettings, children, handleObjectClick, }) {
|
|
12
|
+
export default function Frame({ url, isActive, createdObject, position, rotation, shapeType = 'circle', hoverSettings, transformEffects = [], colorEffects = [], layoutSettings, side, materialSettings, children, handleObjectClick, onObjectReady, onObjectDispose, }) {
|
|
12
13
|
const frameRef = useRef(new Mesh());
|
|
14
|
+
useObjectReady(frameRef, createdObject, onObjectReady, onObjectDispose);
|
|
13
15
|
const imageRef = useRef(null);
|
|
14
16
|
const [texture, setTexture] = useState(null);
|
|
15
17
|
useEffect(() => {
|