@3driseai/3drise-viewer 0.1.41 → 0.1.43
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/animationsV2/ClipsRuntime.d.ts +16 -1
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +144 -25
- package/dist/animationsV2/appliers.d.ts +9 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +62 -2
- package/dist/animationsV2/clipUtils.d.ts +30 -0
- package/dist/animationsV2/clipUtils.d.ts.map +1 -1
- package/dist/animationsV2/clipUtils.js +163 -17
- package/dist/animationsV2/elementSettings.d.ts +5 -0
- package/dist/animationsV2/elementSettings.d.ts.map +1 -1
- package/dist/animationsV2/elementSettings.js +6 -3
- package/dist/animationsV2/sequenceUtils.js +4 -4
- package/dist/animationsV2/types.d.ts +23 -0
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +2 -2
- package/dist/components/CreatedObject.d.ts +3 -0
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +6 -2
- package/dist/components/CustomPrimitive.d.ts.map +1 -1
- package/dist/components/CustomPrimitive.js +1 -10
- package/dist/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/EnvironmentManager.js +11 -5
- package/dist/components/GeometryShape.d.ts +5 -2
- package/dist/components/GeometryShape.d.ts.map +1 -1
- package/dist/components/GeometryShape.js +71 -10
- package/dist/components/LandObject.d.ts.map +1 -1
- package/dist/components/LandObject.js +1 -1
- package/dist/components/LayoutInstances.d.ts +2 -1
- package/dist/components/LayoutInstances.d.ts.map +1 -1
- package/dist/components/LayoutInstances.js +39 -6
- package/dist/components/LightObject.d.ts.map +1 -1
- package/dist/components/LightObject.js +3 -0
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +62 -13
- package/dist/components/OceanBuilder.d.ts +2 -0
- package/dist/components/OceanBuilder.d.ts.map +1 -1
- package/dist/components/OceanBuilder.js +2 -1
- package/dist/components/RenderEffects.d.ts +8 -0
- package/dist/components/RenderEffects.d.ts.map +1 -0
- package/dist/components/RenderEffects.js +120 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +18 -9
- package/dist/components/SportsObject.d.ts +9 -0
- package/dist/components/SportsObject.d.ts.map +1 -0
- package/dist/components/SportsObject.js +20 -0
- package/dist/components/UrbanObject.d.ts +9 -0
- package/dist/components/UrbanObject.d.ts.map +1 -0
- package/dist/components/UrbanObject.js +28 -0
- package/dist/components/VegetationObject.d.ts +9 -0
- package/dist/components/VegetationObject.d.ts.map +1 -0
- package/dist/components/VegetationObject.js +26 -0
- package/dist/components/WaterObject.d.ts +15 -0
- package/dist/components/WaterObject.d.ts.map +1 -0
- package/dist/components/WaterObject.js +29 -0
- package/dist/components/index.d.ts +7 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +6 -1
- package/dist/components/land/LandPatch.d.ts +3 -1
- package/dist/components/land/LandPatch.d.ts.map +1 -1
- package/dist/components/land/LandPatch.js +80 -7
- package/dist/components/layout/InstancedLayout.d.ts +19 -0
- package/dist/components/layout/InstancedLayout.d.ts.map +1 -0
- package/dist/components/layout/InstancedLayout.js +154 -0
- package/dist/components/layout/LayoutGrounds.d.ts +19 -0
- package/dist/components/layout/LayoutGrounds.d.ts.map +1 -0
- package/dist/components/layout/LayoutGrounds.js +104 -0
- package/dist/components/layout/LinkProxies.d.ts +5 -0
- package/dist/components/layout/LinkProxies.d.ts.map +1 -0
- package/dist/components/layout/LinkProxies.js +51 -0
- package/dist/components/layout/LinkedSource.d.ts +14 -0
- package/dist/components/layout/LinkedSource.d.ts.map +1 -0
- package/dist/components/layout/LinkedSource.js +129 -0
- package/dist/components/projector/Projector.d.ts +14 -0
- package/dist/components/projector/Projector.d.ts.map +1 -0
- package/dist/components/projector/Projector.js +44 -0
- package/dist/components/projector/index.d.ts +4 -0
- package/dist/components/projector/index.d.ts.map +1 -0
- package/dist/components/projector/index.js +2 -0
- package/dist/components/projector/projectorCore.d.ts +19 -0
- package/dist/components/projector/projectorCore.d.ts.map +1 -0
- package/dist/components/projector/projectorCore.js +545 -0
- package/dist/components/sports/SportsBall.d.ts +9 -0
- package/dist/components/sports/SportsBall.d.ts.map +1 -0
- package/dist/components/sports/SportsBall.js +23 -0
- package/dist/components/sports/SportsCourt.d.ts +9 -0
- package/dist/components/sports/SportsCourt.d.ts.map +1 -0
- package/dist/components/sports/SportsCourt.js +23 -0
- package/dist/components/sports/SportsEquipment.d.ts +9 -0
- package/dist/components/sports/SportsEquipment.d.ts.map +1 -0
- package/dist/components/sports/SportsEquipment.js +23 -0
- package/dist/components/sports/SportsGoal.d.ts +9 -0
- package/dist/components/sports/SportsGoal.d.ts.map +1 -0
- package/dist/components/sports/SportsGoal.js +23 -0
- package/dist/components/sports/core/ball.d.ts +166 -0
- package/dist/components/sports/core/ball.d.ts.map +1 -0
- package/dist/components/sports/core/ball.js +402 -0
- package/dist/components/sports/core/court.d.ts +442 -0
- package/dist/components/sports/core/court.d.ts.map +1 -0
- package/dist/components/sports/core/court.js +658 -0
- package/dist/components/sports/core/equipment.d.ts +103 -0
- package/dist/components/sports/core/equipment.d.ts.map +1 -0
- package/dist/components/sports/core/equipment.js +403 -0
- package/dist/components/sports/core/goal.d.ts +98 -0
- package/dist/components/sports/core/goal.d.ts.map +1 -0
- package/dist/components/sports/core/goal.js +44 -0
- package/dist/components/sports/index.d.ts +11 -0
- package/dist/components/sports/index.d.ts.map +1 -0
- package/dist/components/sports/index.js +8 -0
- package/dist/components/sports/sportsCore.d.ts +195 -0
- package/dist/components/sports/sportsCore.d.ts.map +1 -0
- package/dist/components/sports/sportsCore.js +758 -0
- package/dist/components/sports/useSportsInstance.d.ts +35 -0
- package/dist/components/sports/useSportsInstance.d.ts.map +1 -0
- package/dist/components/sports/useSportsInstance.js +47 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +14 -0
- package/dist/components/urban/UrbanBlock.d.ts +9 -0
- package/dist/components/urban/UrbanBlock.d.ts.map +1 -0
- package/dist/components/urban/UrbanBlock.js +23 -0
- package/dist/components/urban/UrbanBuilding.d.ts +9 -0
- package/dist/components/urban/UrbanBuilding.d.ts.map +1 -0
- package/dist/components/urban/UrbanBuilding.js +23 -0
- package/dist/components/urban/UrbanJunction.d.ts +9 -0
- package/dist/components/urban/UrbanJunction.d.ts.map +1 -0
- package/dist/components/urban/UrbanJunction.js +23 -0
- package/dist/components/urban/UrbanPark.d.ts +9 -0
- package/dist/components/urban/UrbanPark.d.ts.map +1 -0
- package/dist/components/urban/UrbanPark.js +23 -0
- package/dist/components/urban/UrbanParkingLot.d.ts +9 -0
- package/dist/components/urban/UrbanParkingLot.d.ts.map +1 -0
- package/dist/components/urban/UrbanParkingLot.js +23 -0
- package/dist/components/urban/UrbanPlaza.d.ts +9 -0
- package/dist/components/urban/UrbanPlaza.d.ts.map +1 -0
- package/dist/components/urban/UrbanPlaza.js +23 -0
- package/dist/components/urban/UrbanRoad.d.ts +9 -0
- package/dist/components/urban/UrbanRoad.d.ts.map +1 -0
- package/dist/components/urban/UrbanRoad.js +23 -0
- package/dist/components/urban/UrbanSignage.d.ts +9 -0
- package/dist/components/urban/UrbanSignage.d.ts.map +1 -0
- package/dist/components/urban/UrbanSignage.js +23 -0
- package/dist/components/urban/UrbanSkyline.d.ts +9 -0
- package/dist/components/urban/UrbanSkyline.d.ts.map +1 -0
- package/dist/components/urban/UrbanSkyline.js +23 -0
- package/dist/components/urban/UrbanStreetFurniture.d.ts +9 -0
- package/dist/components/urban/UrbanStreetFurniture.d.ts.map +1 -0
- package/dist/components/urban/UrbanStreetFurniture.js +23 -0
- package/dist/components/urban/UrbanStreetGrid.d.ts +9 -0
- package/dist/components/urban/UrbanStreetGrid.d.ts.map +1 -0
- package/dist/components/urban/UrbanStreetGrid.js +34 -0
- package/dist/components/urban/UrbanTraffic.d.ts +9 -0
- package/dist/components/urban/UrbanTraffic.d.ts.map +1 -0
- package/dist/components/urban/UrbanTraffic.js +23 -0
- package/dist/components/urban/core/block.d.ts +119 -0
- package/dist/components/urban/core/block.d.ts.map +1 -0
- package/dist/components/urban/core/block.js +266 -0
- package/dist/components/urban/core/building.d.ts +128 -0
- package/dist/components/urban/core/building.d.ts.map +1 -0
- package/dist/components/urban/core/building.js +741 -0
- package/dist/components/urban/core/junction.d.ts +152 -0
- package/dist/components/urban/core/junction.d.ts.map +1 -0
- package/dist/components/urban/core/junction.js +617 -0
- package/dist/components/urban/core/park.d.ts +67 -0
- package/dist/components/urban/core/park.d.ts.map +1 -0
- package/dist/components/urban/core/park.js +176 -0
- package/dist/components/urban/core/parkingLot.d.ts +82 -0
- package/dist/components/urban/core/parkingLot.d.ts.map +1 -0
- package/dist/components/urban/core/parkingLot.js +284 -0
- package/dist/components/urban/core/plaza.d.ts +24 -0
- package/dist/components/urban/core/plaza.d.ts.map +1 -0
- package/dist/components/urban/core/plaza.js +243 -0
- package/dist/components/urban/core/road.d.ts +113 -0
- package/dist/components/urban/core/road.d.ts.map +1 -0
- package/dist/components/urban/core/road.js +347 -0
- package/dist/components/urban/core/signage.d.ts +83 -0
- package/dist/components/urban/core/signage.d.ts.map +1 -0
- package/dist/components/urban/core/signage.js +209 -0
- package/dist/components/urban/core/skyline.d.ts +100 -0
- package/dist/components/urban/core/skyline.d.ts.map +1 -0
- package/dist/components/urban/core/skyline.js +89 -0
- package/dist/components/urban/core/streetFurniture.d.ts +75 -0
- package/dist/components/urban/core/streetFurniture.d.ts.map +1 -0
- package/dist/components/urban/core/streetFurniture.js +193 -0
- package/dist/components/urban/core/streetGrid.d.ts +134 -0
- package/dist/components/urban/core/streetGrid.d.ts.map +1 -0
- package/dist/components/urban/core/streetGrid.js +422 -0
- package/dist/components/urban/core/traffic.d.ts +125 -0
- package/dist/components/urban/core/traffic.d.ts.map +1 -0
- package/dist/components/urban/core/traffic.js +305 -0
- package/dist/components/urban/index.d.ts +29 -0
- package/dist/components/urban/index.d.ts.map +1 -0
- package/dist/components/urban/index.js +16 -0
- package/dist/components/urban/textureSetResolver.d.ts +8 -0
- package/dist/components/urban/textureSetResolver.d.ts.map +1 -0
- package/dist/components/urban/textureSetResolver.js +16 -0
- package/dist/components/urban/urbanCore.d.ts +262 -0
- package/dist/components/urban/urbanCore.d.ts.map +1 -0
- package/dist/components/urban/urbanCore.js +928 -0
- package/dist/components/urban/useUrbanInstance.d.ts +53 -0
- package/dist/components/urban/useUrbanInstance.d.ts.map +1 -0
- package/dist/components/urban/useUrbanInstance.js +100 -0
- package/dist/components/vegetation/VegetationBush.d.ts +9 -0
- package/dist/components/vegetation/VegetationBush.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationBush.js +23 -0
- package/dist/components/vegetation/VegetationCrops.d.ts +9 -0
- package/dist/components/vegetation/VegetationCrops.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationCrops.js +23 -0
- package/dist/components/vegetation/VegetationFlowers.d.ts +9 -0
- package/dist/components/vegetation/VegetationFlowers.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationFlowers.js +23 -0
- package/dist/components/vegetation/VegetationForest.d.ts +9 -0
- package/dist/components/vegetation/VegetationForest.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationForest.js +23 -0
- package/dist/components/vegetation/VegetationFruit.d.ts +9 -0
- package/dist/components/vegetation/VegetationFruit.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationFruit.js +23 -0
- package/dist/components/vegetation/VegetationGrass.d.ts +9 -0
- package/dist/components/vegetation/VegetationGrass.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationGrass.js +23 -0
- package/dist/components/vegetation/VegetationHedge.d.ts +9 -0
- package/dist/components/vegetation/VegetationHedge.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationHedge.js +23 -0
- package/dist/components/vegetation/VegetationIvy.d.ts +9 -0
- package/dist/components/vegetation/VegetationIvy.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationIvy.js +23 -0
- package/dist/components/vegetation/VegetationTree.d.ts +9 -0
- package/dist/components/vegetation/VegetationTree.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationTree.js +23 -0
- package/dist/components/vegetation/VegetationVegetable.d.ts +9 -0
- package/dist/components/vegetation/VegetationVegetable.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationVegetable.js +23 -0
- package/dist/components/vegetation/core/bush.d.ts +1256 -0
- package/dist/components/vegetation/core/bush.d.ts.map +1 -0
- package/dist/components/vegetation/core/bush.js +376 -0
- package/dist/components/vegetation/core/crops.d.ts +1033 -0
- package/dist/components/vegetation/core/crops.d.ts.map +1 -0
- package/dist/components/vegetation/core/crops.js +378 -0
- package/dist/components/vegetation/core/flowers.d.ts +648 -0
- package/dist/components/vegetation/core/flowers.d.ts.map +1 -0
- package/dist/components/vegetation/core/flowers.js +225 -0
- package/dist/components/vegetation/core/forest.d.ts +138 -0
- package/dist/components/vegetation/core/forest.d.ts.map +1 -0
- package/dist/components/vegetation/core/forest.js +310 -0
- package/dist/components/vegetation/core/fruit.d.ts +99 -0
- package/dist/components/vegetation/core/fruit.d.ts.map +1 -0
- package/dist/components/vegetation/core/fruit.js +77 -0
- package/dist/components/vegetation/core/grass.d.ts +103 -0
- package/dist/components/vegetation/core/grass.d.ts.map +1 -0
- package/dist/components/vegetation/core/grass.js +102 -0
- package/dist/components/vegetation/core/hedge.d.ts +193 -0
- package/dist/components/vegetation/core/hedge.d.ts.map +1 -0
- package/dist/components/vegetation/core/hedge.js +243 -0
- package/dist/components/vegetation/core/ivy.d.ts +213 -0
- package/dist/components/vegetation/core/ivy.d.ts.map +1 -0
- package/dist/components/vegetation/core/ivy.js +173 -0
- package/dist/components/vegetation/core/tree.d.ts +1117 -0
- package/dist/components/vegetation/core/tree.d.ts.map +1 -0
- package/dist/components/vegetation/core/tree.js +408 -0
- package/dist/components/vegetation/core/vegetable.d.ts +99 -0
- package/dist/components/vegetation/core/vegetable.d.ts.map +1 -0
- package/dist/components/vegetation/core/vegetable.js +76 -0
- package/dist/components/vegetation/index.d.ts +23 -0
- package/dist/components/vegetation/index.d.ts.map +1 -0
- package/dist/components/vegetation/index.js +14 -0
- package/dist/components/vegetation/produceCore.d.ts +929 -0
- package/dist/components/vegetation/produceCore.d.ts.map +1 -0
- package/dist/components/vegetation/produceCore.js +723 -0
- package/dist/components/vegetation/useVegetationInstance.d.ts +39 -0
- package/dist/components/vegetation/useVegetationInstance.d.ts.map +1 -0
- package/dist/components/vegetation/useVegetationInstance.js +45 -0
- package/dist/components/vegetation/vegetationCore.d.ts +412 -0
- package/dist/components/vegetation/vegetationCore.d.ts.map +1 -0
- package/dist/components/vegetation/vegetationCore.js +1728 -0
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +5 -0
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.js +39 -13
- package/dist/components/water/OceanSurface.d.ts.map +1 -1
- package/dist/components/water/OceanSurface.js +3 -2
- package/dist/components/water/WaterBody.d.ts.map +1 -1
- package/dist/components/water/WaterBody.js +31 -10
- package/dist/components/water/WaterFountain.d.ts +9 -0
- package/dist/components/water/WaterFountain.d.ts.map +1 -0
- package/dist/components/water/WaterFountain.js +24 -0
- package/dist/components/water/WaterStream.d.ts +9 -0
- package/dist/components/water/WaterStream.d.ts.map +1 -0
- package/dist/components/water/WaterStream.js +24 -0
- package/dist/components/water/WaterWaterfall.d.ts +9 -0
- package/dist/components/water/WaterWaterfall.d.ts.map +1 -0
- package/dist/components/water/WaterWaterfall.js +24 -0
- package/dist/components/water/core/fountain.d.ts +70 -0
- package/dist/components/water/core/fountain.d.ts.map +1 -0
- package/dist/components/water/core/fountain.js +619 -0
- package/dist/components/water/core/stream.d.ts +72 -0
- package/dist/components/water/core/stream.d.ts.map +1 -0
- package/dist/components/water/core/stream.js +167 -0
- package/dist/components/water/core/waterfall.d.ts +78 -0
- package/dist/components/water/core/waterfall.d.ts.map +1 -0
- package/dist/components/water/core/waterfall.js +325 -0
- package/dist/components/water/index.d.ts +8 -0
- package/dist/components/water/index.d.ts.map +1 -1
- package/dist/components/water/index.js +7 -0
- package/dist/components/water/types.d.ts +3 -0
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/components/water/useWaterInstance.d.ts +43 -0
- package/dist/components/water/useWaterInstance.d.ts.map +1 -0
- package/dist/components/water/useWaterInstance.js +89 -0
- package/dist/components/water/waterCore.d.ts +179 -0
- package/dist/components/water/waterCore.d.ts.map +1 -0
- package/dist/components/water/waterCore.js +516 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +9 -1
- package/dist/hooks/index.d.ts +7 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +5 -2
- package/dist/hooks/useActionPatch.d.ts +23 -0
- package/dist/hooks/useActionPatch.d.ts.map +1 -0
- package/dist/hooks/useActionPatch.js +38 -0
- package/dist/hooks/useCloudSun.d.ts.map +1 -1
- package/dist/hooks/useCloudSun.js +3 -2
- package/dist/hooks/useCommittedInstance.d.ts +6 -0
- package/dist/hooks/useCommittedInstance.d.ts.map +1 -0
- package/dist/hooks/useCommittedInstance.js +42 -0
- package/dist/hooks/useConfigLive.d.ts +1 -1
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.js +36 -20
- package/dist/hooks/useGridLayout.d.ts +7 -0
- package/dist/hooks/useGridLayout.d.ts.map +1 -0
- package/dist/hooks/useGridLayout.js +10 -0
- package/dist/hooks/useInteractionEffects.d.ts.map +1 -1
- package/dist/hooks/useInteractionEffects.js +48 -9
- package/dist/hooks/useLightLive.d.ts.map +1 -1
- package/dist/hooks/useLightLive.js +2 -0
- package/dist/hooks/useLinkStatus.d.ts +7 -0
- package/dist/hooks/useLinkStatus.d.ts.map +1 -0
- package/dist/hooks/useLinkStatus.js +20 -0
- package/dist/hooks/useMaterialApplication.d.ts +6 -1
- package/dist/hooks/useMaterialApplication.d.ts.map +1 -1
- package/dist/hooks/useMaterialApplication.js +7 -2
- package/dist/hooks/useOceanMaterial.d.ts +11 -1
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +185 -27
- package/dist/hooks/usePathAnimation.d.ts +8 -0
- package/dist/hooks/usePathAnimation.d.ts.map +1 -1
- package/dist/hooks/usePathAnimation.js +140 -59
- package/dist/hooks/useResolvedLayout.d.ts +10 -0
- package/dist/hooks/useResolvedLayout.d.ts.map +1 -0
- package/dist/hooks/useResolvedLayout.js +17 -0
- package/dist/hooks/useTimeLighting.d.ts +36 -0
- package/dist/hooks/useTimeLighting.d.ts.map +1 -0
- package/dist/hooks/useTimeLighting.js +67 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -1
- package/dist/operations/catalogue/shaderLayers.js +26 -3
- package/dist/render/renderLive.d.ts +11 -0
- package/dist/render/renderLive.d.ts.map +1 -0
- package/dist/render/renderLive.js +57 -0
- package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
- package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/oceanCore.glsl.js +35 -5
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +12 -0
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
- package/dist/shaders/ocean/OceanSurfaceMaterial.js +55 -7
- package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
- package/dist/shaders/terrain/TerrainMaterial.js +28 -0
- package/dist/triggers/kinds/change.js +1 -1
- package/dist/ui/UiLayers.d.ts +17 -1
- package/dist/ui/UiLayers.d.ts.map +1 -1
- package/dist/ui/UiLayers.js +76 -3
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/utils/composerHostedPass.d.ts +74 -0
- package/dist/utils/composerHostedPass.d.ts.map +1 -0
- package/dist/utils/composerHostedPass.js +63 -0
- package/dist/utils/geometryScript.d.ts +17 -0
- package/dist/utils/geometryScript.d.ts.map +1 -0
- package/dist/utils/geometryScript.js +92 -0
- package/dist/utils/geometryScript.worker.d.ts +2 -0
- package/dist/utils/geometryScript.worker.d.ts.map +1 -0
- package/dist/utils/geometryScript.worker.js +42 -0
- package/dist/utils/groundRegistry.d.ts +11 -0
- package/dist/utils/groundRegistry.d.ts.map +1 -0
- package/dist/utils/groundRegistry.js +39 -0
- package/dist/utils/instancingSupport.d.ts +9 -0
- package/dist/utils/instancingSupport.d.ts.map +1 -0
- package/dist/utils/instancingSupport.js +13 -0
- package/dist/utils/landPatch.d.ts +26 -5
- package/dist/utils/landPatch.d.ts.map +1 -1
- package/dist/utils/landPatch.js +124 -9
- package/dist/utils/layoutPlacement.d.ts +30 -0
- package/dist/utils/layoutPlacement.d.ts.map +1 -0
- package/dist/utils/layoutPlacement.js +113 -0
- package/dist/utils/linkRegistry.d.ts +15 -0
- package/dist/utils/linkRegistry.d.ts.map +1 -0
- package/dist/utils/linkRegistry.js +11 -0
- package/dist/utils/shapes.d.ts +28 -2
- package/dist/utils/shapes.d.ts.map +1 -1
- package/dist/utils/shapes.js +32 -3
- package/dist/utils/sharedParts.d.ts +61 -0
- package/dist/utils/sharedParts.d.ts.map +1 -0
- package/dist/utils/sharedParts.js +268 -0
- package/dist/utils/svgAsset.d.ts +6 -0
- package/dist/utils/svgAsset.d.ts.map +1 -0
- package/dist/utils/svgAsset.js +46 -0
- package/dist/utils/waterLight.d.ts +29 -0
- package/dist/utils/waterLight.d.ts.map +1 -0
- package/dist/utils/waterLight.js +67 -0
- package/dist/utils/waterReflection.d.ts +185 -0
- package/dist/utils/waterReflection.d.ts.map +1 -0
- package/dist/utils/waterReflection.js +616 -0
- package/package.json +4 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { applyEasing, interpolateValue } from '@3driseai/3drise-core';
|
|
1
|
+
import { applyEasing, interpolateValue, buildRunLine, pathLinePointAt, pathLineDirectionAt, pathLineHeading, } from '@3driseai/3drise-core';
|
|
2
|
+
import { Euler, Quaternion, Vector3 } from 'three';
|
|
2
3
|
import { DEFAULT_EASE } from './types.js';
|
|
3
4
|
// -----------------------------------------------------------------------------
|
|
4
5
|
// ids, paths
|
|
@@ -55,6 +56,26 @@ export function easeProgress(ease, p) {
|
|
|
55
56
|
* A model part's `visible` (node track) stays per frame — parts have no effects.
|
|
56
57
|
*/
|
|
57
58
|
export const isSwitchTrack = (track) => !!track.discrete || (!track.node && track.path === 'meshSettings.visible');
|
|
59
|
+
/** Where t falls between the keys: the key before (lo), after (hi), and the raw progress u between them (edges: lo === hi). */
|
|
60
|
+
function segmentAt(keys, t) {
|
|
61
|
+
const n = keys.length;
|
|
62
|
+
if (t <= keys[0].t)
|
|
63
|
+
return { lo: 0, hi: 0, u: 0 };
|
|
64
|
+
if (t >= keys[n - 1].t)
|
|
65
|
+
return { lo: n - 1, hi: n - 1, u: 0 };
|
|
66
|
+
// binary search: last key with k.t <= t
|
|
67
|
+
let lo = 0;
|
|
68
|
+
let hi = n - 1;
|
|
69
|
+
while (hi - lo > 1) {
|
|
70
|
+
const mid = (lo + hi) >> 1;
|
|
71
|
+
if (keys[mid].t <= t)
|
|
72
|
+
lo = mid;
|
|
73
|
+
else
|
|
74
|
+
hi = mid;
|
|
75
|
+
}
|
|
76
|
+
const span = keys[hi].t - keys[lo].t;
|
|
77
|
+
return { lo, hi, u: span > 0 ? (t - keys[lo].t) / span : 1 };
|
|
78
|
+
}
|
|
58
79
|
/**
|
|
59
80
|
* The track's value at time t. Before the first key: the first key's value;
|
|
60
81
|
* after the last: the last key's value. Keys must be sorted by t.
|
|
@@ -67,32 +88,138 @@ export function sampleTrack(track, t) {
|
|
|
67
88
|
// (an eased track holds its first value before it, so a move can start later than 0).
|
|
68
89
|
if (t < keys[0].t - 1e-9 && isSwitchTrack(track))
|
|
69
90
|
return undefined;
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
let lo = 0;
|
|
77
|
-
let hi = keys.length - 1;
|
|
78
|
-
while (hi - lo > 1) {
|
|
79
|
-
const mid = (lo + hi) >> 1;
|
|
80
|
-
if (keys[mid].t <= t)
|
|
81
|
-
lo = mid;
|
|
82
|
-
else
|
|
83
|
-
hi = mid;
|
|
91
|
+
if (isCurvedTrack(track)) {
|
|
92
|
+
const d = curveDistanceAt(track, t);
|
|
93
|
+
if (d !== null) {
|
|
94
|
+
const p = pathLinePointAt(keyCurve(track).line, d, tmpPoint);
|
|
95
|
+
return [p.x, p.y, p.z];
|
|
96
|
+
}
|
|
84
97
|
}
|
|
98
|
+
const { lo, hi, u } = segmentAt(keys, t);
|
|
85
99
|
const a = keys[lo];
|
|
100
|
+
if (lo === hi)
|
|
101
|
+
return a.value;
|
|
86
102
|
const b = keys[hi];
|
|
87
103
|
if (isSwitchTrack(track) || isSteppedValue(a.value) || isSteppedValue(b.value))
|
|
88
104
|
return a.value;
|
|
89
|
-
const
|
|
90
|
-
const p = span > 0 ? easeProgress(a.ease, (t - a.t) / span) : 1;
|
|
105
|
+
const p = u >= 1 ? 1 : easeProgress(a.ease, u);
|
|
91
106
|
// interpolateValue is type-aware (numbers, arrays, hex colours); the property name
|
|
92
107
|
// only disambiguates colour keys, so pass the path's last segment.
|
|
93
108
|
return interpolateValue(track.path.split('.').pop() ?? track.path, a.value, b.value, p);
|
|
94
109
|
}
|
|
95
110
|
// -----------------------------------------------------------------------------
|
|
111
|
+
// curved position tracks (Track.curve / smoothCorners / face)
|
|
112
|
+
// -----------------------------------------------------------------------------
|
|
113
|
+
//
|
|
114
|
+
// The keys are the points of one line — core buildPathLine, the line a layout path draws — and
|
|
115
|
+
// the object moves along it: between two keys it covers the stretch of line between them, at the
|
|
116
|
+
// speed the leaving key's ease gives. Built once per track object (edits make a new object) and
|
|
117
|
+
// read per frame. The line is in the track's own space (the object's parent), so the facing
|
|
118
|
+
// comes out in that space too.
|
|
119
|
+
/** A position track: an object's, or a model part's. The only tracks that can be curved. */
|
|
120
|
+
export const isPositionTrack = (track) => track.node ? track.path === 'position' : track.path === 'meshSettings.position';
|
|
121
|
+
/** An object's position track that turns the object to face its travel (drives its rotation). */
|
|
122
|
+
export const isFacingTrack = (track) => !!track.face && !track.node && track.path === 'meshSettings.position';
|
|
123
|
+
/** Drawn as one line through its keys instead of straight segments. */
|
|
124
|
+
export const isCurvedTrack = (track) => isPositionTrack(track) && ((track.curve ?? 0) > 0 || (track.smoothCorners ?? 0) > 0 || isFacingTrack(track));
|
|
125
|
+
const keyCurves = new WeakMap();
|
|
126
|
+
const clamp01 = (v) => Math.min(1, Math.max(0, Number(v) || 0));
|
|
127
|
+
const tmpPoint = new Vector3();
|
|
128
|
+
/**
|
|
129
|
+
* The track's line (core buildRunLine — the line a path bake times its keys on): null with fewer
|
|
130
|
+
* than two distinct [x,y,z] keys (it then samples as straight segments). A track that ends where
|
|
131
|
+
* it began is drawn as a closed loop.
|
|
132
|
+
*/
|
|
133
|
+
function keyCurve(track) {
|
|
134
|
+
const cached = keyCurves.get(track);
|
|
135
|
+
if (cached !== undefined)
|
|
136
|
+
return cached;
|
|
137
|
+
let out = null;
|
|
138
|
+
const points = [];
|
|
139
|
+
for (const k of track.keys) {
|
|
140
|
+
const v = k.value;
|
|
141
|
+
if (!Array.isArray(v) || v.length < 3) {
|
|
142
|
+
points.length = 0;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
points.push([Number(v[0]), Number(v[1]), Number(v[2])]);
|
|
146
|
+
}
|
|
147
|
+
if (points.length >= 2)
|
|
148
|
+
out = buildRunLine(points, { curve: clamp01(track.curve), smoothCorners: clamp01(track.smoothCorners) });
|
|
149
|
+
keyCurves.set(track, out);
|
|
150
|
+
return out;
|
|
151
|
+
}
|
|
152
|
+
/** Metres along the track's line at time t (null when it has no line). */
|
|
153
|
+
function curveDistanceAt(track, t) {
|
|
154
|
+
const c = keyCurve(track);
|
|
155
|
+
if (!c)
|
|
156
|
+
return null;
|
|
157
|
+
const { lo, hi, u } = segmentAt(track.keys, t);
|
|
158
|
+
if (lo === hi)
|
|
159
|
+
return c.at[lo];
|
|
160
|
+
const p = u >= 1 ? 1 : easeProgress(track.keys[lo].ease, u);
|
|
161
|
+
return c.at[lo] + (c.at[hi] - c.at[lo]) * p;
|
|
162
|
+
}
|
|
163
|
+
const tmpDir = new Vector3();
|
|
164
|
+
const tmpQuat = new Quaternion();
|
|
165
|
+
const tmpRest = new Quaternion();
|
|
166
|
+
const tmpEuler = new Euler();
|
|
167
|
+
const TAU = Math.PI * 2;
|
|
168
|
+
/**
|
|
169
|
+
* The rotation (Euler XYZ, radians) of an object facing its travel along the track at t: +Z along
|
|
170
|
+
* the line, pitching with the slope, no roll (core pathLineHeading — the path animation's own), with
|
|
171
|
+
* `rest` (the object's authored rotation) on top as its facing correction. Each angle is taken
|
|
172
|
+
* nearest to `rest`, so gliding in from the authored rotation never spins the long way round.
|
|
173
|
+
* Undefined when the track has no line.
|
|
174
|
+
*/
|
|
175
|
+
export function sampleTrackFacing(track, t, rest) {
|
|
176
|
+
const c = keyCurve(track);
|
|
177
|
+
const d = curveDistanceAt(track, t);
|
|
178
|
+
if (!c || d === null)
|
|
179
|
+
return undefined;
|
|
180
|
+
// a little behind to a little ahead: smooth through corners (short lines: a shorter look)
|
|
181
|
+
pathLineDirectionAt(c.line, d, Math.min(0.5, c.line.length / 20), tmpDir);
|
|
182
|
+
const r = rest && rest.length >= 3 ? rest : null;
|
|
183
|
+
if (r)
|
|
184
|
+
tmpRest.setFromEuler(tmpEuler.set(Number(r[0]) || 0, Number(r[1]) || 0, Number(r[2]) || 0));
|
|
185
|
+
if (!pathLineHeading(tmpDir, r ? tmpRest : null, tmpQuat))
|
|
186
|
+
return undefined;
|
|
187
|
+
tmpEuler.setFromQuaternion(tmpQuat, 'XYZ');
|
|
188
|
+
const out = [tmpEuler.x, tmpEuler.y, tmpEuler.z];
|
|
189
|
+
if (r)
|
|
190
|
+
for (let k = 0; k < 3; k++)
|
|
191
|
+
out[k] += Math.round(((Number(r[k]) || 0) - out[k]) / TAU) * TAU;
|
|
192
|
+
return out;
|
|
193
|
+
}
|
|
194
|
+
const faceTracks = new WeakMap();
|
|
195
|
+
const expanded = new WeakMap();
|
|
196
|
+
/** The facing track a position track drives, or undefined. */
|
|
197
|
+
export const faceSource = (track) => track.faceOf;
|
|
198
|
+
/**
|
|
199
|
+
* A clip's tracks as the runtime drives them: each facing position track adds its object's
|
|
200
|
+
* rotation, AFTER all the clip's own tracks — so inside the clip it wins over a rotation track on
|
|
201
|
+
* the same object (later proposals win). Cached per tracks array (no allocation per frame).
|
|
202
|
+
*/
|
|
203
|
+
export function expandTracks(tracks) {
|
|
204
|
+
const hit = expanded.get(tracks);
|
|
205
|
+
if (hit)
|
|
206
|
+
return hit;
|
|
207
|
+
const faces = [];
|
|
208
|
+
for (const t of tracks) {
|
|
209
|
+
if (t.muted || !t.keys.length || !isFacingTrack(t))
|
|
210
|
+
continue;
|
|
211
|
+
let f = faceTracks.get(t);
|
|
212
|
+
if (!f) {
|
|
213
|
+
f = { id: `${t.id}:face`, state: t.state, path: 'meshSettings.rotation', keys: t.keys, faceOf: t };
|
|
214
|
+
faceTracks.set(t, f);
|
|
215
|
+
}
|
|
216
|
+
faces.push(f);
|
|
217
|
+
}
|
|
218
|
+
const out = faces.length ? [...tracks, ...faces] : tracks;
|
|
219
|
+
expanded.set(tracks, out);
|
|
220
|
+
return out;
|
|
221
|
+
}
|
|
222
|
+
// -----------------------------------------------------------------------------
|
|
96
223
|
// key / track edits (pure — the slice stores the results)
|
|
97
224
|
// -----------------------------------------------------------------------------
|
|
98
225
|
export const sortKeys = (keys) => [...keys].sort((a, b) => a.t - b.t);
|
|
@@ -167,6 +294,25 @@ export function setKeysEase(clip, selection, ease) {
|
|
|
167
294
|
})),
|
|
168
295
|
};
|
|
169
296
|
}
|
|
297
|
+
/** Whether a track's keys can be "from current" (Keyframe.current): eased tracks only. */
|
|
298
|
+
export const canKeyFromCurrent = (track) => !isSwitchTrack(track);
|
|
299
|
+
/** Mark the selected keys "from current" (on) or back to their own value (off). Switch tracks are left alone. */
|
|
300
|
+
export function setKeysCurrent(clip, selection, on) {
|
|
301
|
+
return {
|
|
302
|
+
...clip,
|
|
303
|
+
tracks: clip.tracks.map(track => (!canKeyFromCurrent(track) || !track.keys.some(k => selection.has(k.id)) ? track : {
|
|
304
|
+
...track,
|
|
305
|
+
keys: track.keys.map(k => {
|
|
306
|
+
if (!selection.has(k.id))
|
|
307
|
+
return k;
|
|
308
|
+
if (on)
|
|
309
|
+
return { ...k, current: true };
|
|
310
|
+
const { current: _drop, ...rest } = k;
|
|
311
|
+
return rest;
|
|
312
|
+
}),
|
|
313
|
+
})),
|
|
314
|
+
};
|
|
315
|
+
}
|
|
170
316
|
export function setKeyValue(clip, keyId, value) {
|
|
171
317
|
return {
|
|
172
318
|
...clip,
|
|
@@ -7,6 +7,11 @@ export interface ElementSources {
|
|
|
7
7
|
clouds: unknown;
|
|
8
8
|
ocean: unknown;
|
|
9
9
|
terrain: unknown;
|
|
10
|
+
/** For 'time': the clock (sky.sunSystem supplies the multipliers). */
|
|
11
|
+
timeSettings?: unknown;
|
|
12
|
+
/** For 'render': the post-processing state and the HDR block (sky.sunSystem supplies the shadows). */
|
|
13
|
+
postProcessing?: unknown;
|
|
14
|
+
hdr?: unknown;
|
|
10
15
|
}
|
|
11
16
|
export declare const ENVIRONMENT_STATES: readonly ["sky", "clouds", "ocean", "terrain"];
|
|
12
17
|
export type EnvironmentState = typeof ENVIRONMENT_STATES[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementSettings.d.ts","sourceRoot":"","sources":["../../src/animationsV2/elementSettings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elementSettings.d.ts","sourceRoot":"","sources":["../../src/animationsV2/elementSettings.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sGAAsG;IACtG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,kBAAkB,gDAAiD,CAAC;AACjF,MAAM,MAAM,gBAAgB,GAAG,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACjE,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,gBACD,CAAC;AAE5D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,GAAG,CAY9E"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Authored settings of any animatable element, with applied action patches — the
|
|
2
2
|
// value a track starts from and returns to. Elements: an object id, 'camera', or an
|
|
3
|
-
// environment element ('sky' | 'clouds' | 'ocean' | 'terrain'; the first three are the ids actions use)
|
|
4
|
-
|
|
3
|
+
// environment element ('sky' | 'clouds' | 'ocean' | 'terrain'; the first three are the ids actions use),
|
|
4
|
+
// or one of the keyed views 'render' | 'time' (core/render/renderView), built from their stored parts.
|
|
5
|
+
import { SceneActions, applySettingsPatch, toRenderView, toTimeView } from '@3driseai/3drise-core';
|
|
5
6
|
export const ENVIRONMENT_STATES = ['sky', 'clouds', 'ocean', 'terrain'];
|
|
6
7
|
export const isEnvironmentState = (state) => ENVIRONMENT_STATES.includes(state);
|
|
7
8
|
export function resolveElementSettings(state, src) {
|
|
@@ -10,7 +11,9 @@ export function resolveElementSettings(state, src) {
|
|
|
10
11
|
: state === 'clouds' ? src.clouds
|
|
11
12
|
: state === 'ocean' ? src.ocean
|
|
12
13
|
: state === 'terrain' ? src.terrain
|
|
13
|
-
: src.
|
|
14
|
+
: state === 'time' ? toTimeView(src.timeSettings, src.sky?.sunSystem)
|
|
15
|
+
: state === 'render' ? toRenderView({ postProcessing: src.postProcessing, hdr: src.hdr, sunSystem: src.sky?.sunSystem })
|
|
16
|
+
: src.objects.find(o => o.id === state);
|
|
14
17
|
const patch = SceneActions.getPatch(state);
|
|
15
18
|
return base && patch ? applySettingsPatch(base, patch) : base;
|
|
16
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_DRIVER_SETTINGS } from './types.js';
|
|
2
|
-
import { uid } from './clipUtils.js';
|
|
2
|
+
import { expandTracks, uid } from './clipUtils.js';
|
|
3
3
|
const lookup = (clips, id) => (typeof clips === 'function' ? clips(id) : clips.get(id));
|
|
4
4
|
export const clipMap = (clips) => new Map(clips.map(c => [c.id, c]));
|
|
5
5
|
const safeSpeed = (s) => (Number.isFinite(s) && s > 0 ? s : 1);
|
|
@@ -157,7 +157,7 @@ export function findCueConflicts(seq, clips, getAction) {
|
|
|
157
157
|
for (const target of targets) {
|
|
158
158
|
const paths = patchPaths(target.patch);
|
|
159
159
|
for (const e of entries) {
|
|
160
|
-
for (const track of e.clip.tracks) {
|
|
160
|
+
for (const track of expandTracks(e.clip.tracks)) {
|
|
161
161
|
if (track.muted || track.node || track.state !== target.state || !track.keys.length)
|
|
162
162
|
continue;
|
|
163
163
|
if (paths.some(p => overlapsPath(p, track.path)))
|
|
@@ -234,7 +234,7 @@ export function findSequenceConflicts(seq, clips) {
|
|
|
234
234
|
if (upper.end <= upper.start)
|
|
235
235
|
continue; // nothing animates
|
|
236
236
|
const upperTargets = new Map();
|
|
237
|
-
upper.clip.tracks.forEach(t => {
|
|
237
|
+
expandTracks(upper.clip.tracks).forEach(t => {
|
|
238
238
|
if (!t.muted && t.keys.length)
|
|
239
239
|
upperTargets.set(targetKey(t.state, t.node, t.path), t);
|
|
240
240
|
});
|
|
@@ -247,7 +247,7 @@ export function findSequenceConflicts(seq, clips) {
|
|
|
247
247
|
if (!overlaps)
|
|
248
248
|
continue;
|
|
249
249
|
const seen = new Set();
|
|
250
|
-
lower.clip.tracks.forEach(t => {
|
|
250
|
+
expandTracks(lower.clip.tracks).forEach(t => {
|
|
251
251
|
if (t.muted || !t.keys.length)
|
|
252
252
|
return;
|
|
253
253
|
const k = targetKey(t.state, t.node, t.path);
|
|
@@ -10,6 +10,14 @@ export interface Keyframe {
|
|
|
10
10
|
value: KeyValue;
|
|
11
11
|
/** Easing of the segment LEAVING this key. */
|
|
12
12
|
ease?: EaseName;
|
|
13
|
+
/**
|
|
14
|
+
* "From current": the key takes the property's value as it is in the scene when the clip
|
|
15
|
+
* starts a run (a camera wherever the visitor orbited it, an object wherever another clip
|
|
16
|
+
* left it), read once per run and held for it — reverse, yoyo and loop return to it.
|
|
17
|
+
* `value` stays the fallback (nothing readable yet) and what the editor shows. Ignored on
|
|
18
|
+
* switch tracks (they don't ease).
|
|
19
|
+
*/
|
|
20
|
+
current?: boolean;
|
|
13
21
|
}
|
|
14
22
|
export interface Track {
|
|
15
23
|
id: string;
|
|
@@ -33,6 +41,21 @@ export interface Track {
|
|
|
33
41
|
* SceneActions patch layer — the element re-renders, as when an action changes it.
|
|
34
42
|
*/
|
|
35
43
|
discrete?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Position tracks only (an object's `meshSettings.position`, a part's `position`): the motion
|
|
46
|
+
* between keys is drawn as one line through them — core buildPathLine, the same line a layout
|
|
47
|
+
* path draws — instead of straight segments. 0 straight … 1 a smooth curve through the keys.
|
|
48
|
+
* Each key's ease still sets the speed along its stretch; the keys stay where they are in time.
|
|
49
|
+
*/
|
|
50
|
+
curve?: number;
|
|
51
|
+
/** Position tracks: 0 sharp corners … 1 round corners (arcs) at the keys (core smoothPathCorners). */
|
|
52
|
+
smoothCorners?: number;
|
|
53
|
+
/**
|
|
54
|
+
* An object's position track: the object turns to face where it travels (+Z along the line,
|
|
55
|
+
* pitching with the slope, no roll), its authored rotation on top as the facing correction.
|
|
56
|
+
* This drives its rotation: inside the clip it wins over a rotation track on the same object.
|
|
57
|
+
*/
|
|
58
|
+
face?: boolean;
|
|
36
59
|
}
|
|
37
60
|
export interface AnimationClip {
|
|
38
61
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/animationsV2/types.ts"],"names":[],"mappings":"AAMA,wFAAwF;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,MAAM,QAAQ,GAChB,QAAQ,GAAG,MAAM,GACjB,YAAY,GAAG,aAAa,GAAG,eAAe,GAC9C,aAAa,GAAG,cAAc,GAAG,gBAAgB,GACjD,aAAa,GAAG,cAAc,GAAG,gBAAgB,GACjD,YAAY,GAAG,aAAa,GAAG,eAAe,GAC9C,YAAY,GAAG,aAAa,GAAG,eAAe,GAC9C,YAAY,GAAG,aAAa,GAAG,eAAe,GAC9C,gBAAgB,GAAG,eAAe,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5D,MAAM,WAAW,QAAQ;IACvB,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,QAAQ,CAAC;IAChB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/animationsV2/types.ts"],"names":[],"mappings":"AAMA,wFAAwF;AACxF,OAA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 @@ export function createSceneHandle(getSource) {
|
|
|
183
183
|
},
|
|
184
184
|
};
|
|
185
185
|
// ----- values ----------------------------------------------------------------------
|
|
186
|
-
const ENVIRONMENT = ['camera', 'sky', 'clouds', 'ocean', 'terrain', 'time'];
|
|
186
|
+
const ENVIRONMENT = ['camera', 'sky', 'clouds', 'ocean', 'terrain', 'time', 'render'];
|
|
187
187
|
const COMPONENT = { x: 0, y: 1, z: 2 };
|
|
188
188
|
/** `engine/Door` -> { state: <object id>, node: 'Door' }; quiet when it is unknown (this runs on a poll). */
|
|
189
189
|
function target(ref) {
|
|
@@ -238,7 +238,7 @@ export function createSceneHandle(getSource) {
|
|
|
238
238
|
check(ref, path) {
|
|
239
239
|
const t = target(ref);
|
|
240
240
|
if (!t)
|
|
241
|
-
return `no target "${ref}". Use sky, camera, clouds, ocean, terrain, time or an object${ref.includes('/') ? ' (and sky/camera/… take no node)' : ''}.`;
|
|
241
|
+
return `no target "${ref}". Use sky, camera, clouds, ocean, terrain, time, render or an object${ref.includes('/') ? ' (and sky/camera/… take no node)' : ''}.`;
|
|
242
242
|
const c = t.node ? undefined : component(t.state, t.node, path);
|
|
243
243
|
if (!t.node && !ClipsRuntime.canSetLiveValue(t.state, c ? c.base : path))
|
|
244
244
|
return `"${path}" cannot be written live on ${ref}.`;
|
|
@@ -7,6 +7,9 @@ interface CreatedObjectProps extends ObjectReadyProps {
|
|
|
7
7
|
createdObject: CreatedObjectSettings;
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
shouldApply3driseMaterial?: boolean;
|
|
10
|
+
/** Changes when the renderer output is remounted for a reason the settings don't show (it became a
|
|
11
|
+
* link source, fell back…): the new meshes need the material applied again. */
|
|
12
|
+
structureKey?: string;
|
|
10
13
|
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
11
14
|
}
|
|
12
15
|
declare const CreatedObject: React.FC<CreatedObjectProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAWnE,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;AAKD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAWnE,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;oFACgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAKD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4G9C,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -16,7 +16,7 @@ import { useObjectEdges } from "../hooks/useObjectEdges.js";
|
|
|
16
16
|
import { useObjectReady } from "../hooks/useObjectReady.js";
|
|
17
17
|
/** One hovered part of an object: the intersected mesh (+ instance). */
|
|
18
18
|
const hoverKey = (e) => `${e.object?.uuid}/${e.instanceId ?? ''}`;
|
|
19
|
-
const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial = true, onObjectReady, onObjectDispose, handleObjectClick, }) => {
|
|
19
|
+
const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial = true, structureKey = '', onObjectReady, onObjectDispose, handleObjectClick, }) => {
|
|
20
20
|
const isSelected = false;
|
|
21
21
|
// const isSelected = useObjectSelection(createdObject.id);
|
|
22
22
|
// const { handleObjectClick: contextHandleObjectClick } = useSceneClick();
|
|
@@ -43,7 +43,11 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
|
|
|
43
43
|
const [materialPass, bumpMaterialPass] = useReducer((n) => n + 1, 0);
|
|
44
44
|
// Inside a group whose material is on, the group's material wins; off, the object's own comes back.
|
|
45
45
|
const groupMaterial = coveredBy(createdObject, useContext(GroupMaterialContext));
|
|
46
|
-
|
|
46
|
+
// A layout remounts the object's renderer (on / off, more copies, a variant mix): the new meshes
|
|
47
|
+
// mount with their default material, so the material goes on again when its structure changes.
|
|
48
|
+
const layout = createdObject.meshSettings?.layout;
|
|
49
|
+
const layoutStructure = (layout?.enabled ? `${layout.count}|${JSON.stringify(layout.variantMix ?? null)}` : 'off') + '|' + structureKey;
|
|
50
|
+
useMaterialApplication(meshRef, groupMaterial ?? createdObject.materialSettings, shouldApply3driseMaterial, bumpMaterialPass, layoutStructure);
|
|
47
51
|
// An object with no explicit flags takes its type's defaults (core's
|
|
48
52
|
// resolveShadowFlags): saved objects carry none, and reading them as false
|
|
49
53
|
// switched every shadow in every project off.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMtC,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,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,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,CA6DlD,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, memo } from "react";
|
|
3
|
-
import { Vector3 } from "three";
|
|
4
3
|
import MaterialLibrary from "./MaterialLibrary.js";
|
|
5
4
|
import ModelBoundary from "./ModelBoundary.js";
|
|
6
5
|
import ModelPrimitive from "./ModelPrimitive.js";
|
|
7
|
-
import { useWaterReflections } from "../hooks/useWaterReflections.js";
|
|
8
6
|
import { GeometryMesh } from "./GeometryShape.js";
|
|
9
7
|
import { useObjectReady } from "../hooks/useObjectReady.js";
|
|
10
8
|
const CustomPrimitive = memo(({ createdObject, slot = 0, onObjectReady, onObjectDispose, handleObjectClick, }) => {
|
|
@@ -50,13 +48,6 @@ const CustomPrimitive = memo(({ createdObject, slot = 0, onObjectReady, onObject
|
|
|
50
48
|
// }, [
|
|
51
49
|
// createdObject.config,
|
|
52
50
|
// ]);
|
|
53
|
-
const isWaterMaterial = createdObject.materialSettings.materialVariant === 'water' || createdObject.materialSettings.materialType === 'water';
|
|
54
|
-
useWaterReflections(createdObject.meshSettings.visible && isWaterMaterial ? meshRef : { current: null }, {
|
|
55
|
-
waterPosition: new Vector3(...createdObject.meshSettings.position),
|
|
56
|
-
resolution: 256,
|
|
57
|
-
updateFrequency: 1,
|
|
58
|
-
enabled: createdObject.meshSettings.visible && isWaterMaterial,
|
|
59
|
-
});
|
|
60
51
|
const useDreiMaterials = createdObject.materialSettings.materialType === "advanced";
|
|
61
52
|
// const obj = ObjectManager.getObject(createdObject.id);
|
|
62
53
|
const materialType = createdObject.materialSettings?.materialType || 'basic';
|
|
@@ -68,7 +59,7 @@ const CustomPrimitive = memo(({ createdObject, slot = 0, onObjectReady, onObject
|
|
|
68
59
|
// mode = 'outline';
|
|
69
60
|
// }
|
|
70
61
|
if (createdObject.type === 'mesh')
|
|
71
|
-
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 }, children: useDreiMaterials && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }) }, createdObject.id);
|
|
62
|
+
return _jsx("mesh", { ref: meshRef, name: createdObject.name, children: _jsx(GeometryMesh, { config: createdObject.config, shapeLayout: createdObject.layout?.shape, 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 }, children: useDreiMaterials && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }) }, createdObject.id);
|
|
72
63
|
// Models resolve asynchronously: ModelPrimitive suspends while its GLTF loads, so it
|
|
73
64
|
// needs its own boundary rather than rendering null forever when nothing preloaded it.
|
|
74
65
|
// ModelPrimitive owns its own ref and reports readiness: the meshRef above stays null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentManager.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentManager.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"EnvironmentManager.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGhF,OAAO,KAAK,EACR,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,K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9C;sEACkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAoBD,QAAA,MAAM,kBAAkB,8FA6GtB,CAAC;AAGH,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { Vector3 } from 'three';
|
|
4
4
|
import SkySystem from './SkySystem.js';
|
|
5
5
|
import HdrEnvironment, { isHdrActive } from './HdrEnvironment.js';
|
|
@@ -8,6 +8,8 @@ import TerrainBuilder from './TerrainBuilder.js';
|
|
|
8
8
|
import LandscapeBuilder from './LandscapeBuilder.js';
|
|
9
9
|
import OceanBuilder from './OceanBuilder.js';
|
|
10
10
|
import { useRuntimeSettings } from '../hooks/useRuntimeSettings.js';
|
|
11
|
+
import { useActionPatch, useRuntimeTime, useRuntimeSunSystem } from '../hooks/useActionPatch.js';
|
|
12
|
+
import { patchHdr } from '@3driseai/3drise-core';
|
|
11
13
|
const DEFAULT_HDR = {
|
|
12
14
|
visible: false,
|
|
13
15
|
name: null,
|
|
@@ -24,10 +26,14 @@ const DEFAULT_HDR = {
|
|
|
24
26
|
},
|
|
25
27
|
};
|
|
26
28
|
const ORIGIN = new Vector3(0, 0, 0);
|
|
27
|
-
const EnvironmentManager = forwardRef(({ timeSettings, environment, hdrSettings, skySettings, cloudsSettings, terrainSettings, landscapeSettings, oceanSettings, fogSettings, cubeCameraResolution = 512, skyboxScale = 100000, playerPosition = ORIGIN, onTimeOfDayChange, onTimeUpdate, driveTime = true, onObjectReady, onObjectDispose, }, ref) => {
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
const
|
|
29
|
+
const EnvironmentManager = forwardRef(({ timeSettings: authoredTime, environment, hdrSettings, skySettings, cloudsSettings, terrainSettings, landscapeSettings, oceanSettings, fogSettings, cubeCameraResolution = 512, skyboxScale = 100000, playerPosition = ORIGIN, onTimeOfDayChange, onTimeUpdate, driveTime = true, onObjectReady, onObjectDispose, }, ref) => {
|
|
30
|
+
// Authored settings + applied action patches (runtime only). 'render' and 'time'
|
|
31
|
+
// are keyed views: each part is laid over the settings it belongs to.
|
|
32
|
+
const renderPatch = useActionPatch('render');
|
|
33
|
+
const authoredHdr = hdrSettings ?? environment?.hdr ?? DEFAULT_HDR;
|
|
34
|
+
const hdr = useMemo(() => patchHdr(authoredHdr, renderPatch), [authoredHdr, renderPatch]);
|
|
35
|
+
const timeSettings = useRuntimeTime(authoredTime);
|
|
36
|
+
const sky = useRuntimeSunSystem(useRuntimeSettings('sky', skySettings ?? environment?.sky));
|
|
31
37
|
const clouds = useRuntimeSettings('clouds', cloudsSettings ?? environment?.clouds);
|
|
32
38
|
const terrain = useRuntimeSettings('terrain', terrainSettings ?? environment?.terrain);
|
|
33
39
|
const landscape = landscapeSettings ?? environment?.landscape;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ObjectReadyProps } from '../types/objectReady';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { BufferGeometry } from 'three';
|
|
4
|
+
import { type ShapeLayout } from '@3driseai/3drise-core';
|
|
4
5
|
import type { GeometryShapeConfig, MaterialSettings, ModeConfig, ObjectAnimations } from "@3driseai/3drise-core";
|
|
5
6
|
type Pt = [number, number, number];
|
|
6
7
|
type ModeData = {
|
|
@@ -18,6 +19,8 @@ type ModeData = {
|
|
|
18
19
|
};
|
|
19
20
|
export interface GeometryMeshProps extends ObjectReadyProps {
|
|
20
21
|
config: GeometryShapeConfig;
|
|
22
|
+
/** A layout applied to the shape (the object's layout.shape): its geometry reshaped, its ground holes drawn. */
|
|
23
|
+
shapeLayout?: ShapeLayout | null;
|
|
21
24
|
modeConfig?: ModeConfig;
|
|
22
25
|
materialSettings: MaterialSettings;
|
|
23
26
|
animations?: ObjectAnimations;
|
|
@@ -25,7 +28,7 @@ export interface GeometryMeshProps extends ObjectReadyProps {
|
|
|
25
28
|
/** Material for the solid path (defaults to a standard material). */
|
|
26
29
|
children?: ReactNode;
|
|
27
30
|
}
|
|
28
|
-
export declare function useShapeGeometry(options: GeometryShapeConfig | null | undefined): BufferGeometry;
|
|
31
|
+
export declare function useShapeGeometry(options: GeometryShapeConfig | null | undefined, shapeLayout?: ShapeLayout | null): BufferGeometry;
|
|
29
32
|
export declare function volumeFill(geo: BufferGeometry, count: number, oversample?: number): Float32Array;
|
|
30
33
|
/** area-weighted points on the skin — the keystone for the modes below */
|
|
31
34
|
export declare function surfaceScatter(geo: BufferGeometry, count: number): Float32Array;
|
|
@@ -42,7 +45,7 @@ export declare function plexus(geo: BufferGeometry, count: number, radiusMul: nu
|
|
|
42
45
|
segments: Pt[];
|
|
43
46
|
};
|
|
44
47
|
export declare function computeMode(geo: BufferGeometry, c: ModeConfig): ModeData;
|
|
45
|
-
export declare function GeometryMesh({ config, materialSettings, animations, modeConfig, color, children, onObjectReady, onObjectDispose }: GeometryMeshProps): import("react").JSX.Element;
|
|
48
|
+
export declare function GeometryMesh({ config, shapeLayout, materialSettings, animations, modeConfig, color, children, onObjectReady, onObjectDispose }: GeometryMeshProps): import("react").JSX.Element;
|
|
46
49
|
export declare function FitGroup({ geometry, radius, children }: {
|
|
47
50
|
geometry: BufferGeometry;
|
|
48
51
|
radius?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryShape.d.ts","sourceRoot":"","sources":["../../src/components/GeometryShape.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GeometryShape.d.ts","sourceRoot":"","sources":["../../src/components/GeometryShape.tsx"],"names":[],"mappings":"AAEA,OA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