@3driseai/3drise-viewer 0.1.42 → 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/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
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
// Emitted from Claude outputs/urban-lab/traffic.mjs by emit_object.mjs — edit the lab module and re-emit.
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// urban/traffic — headlight and tail-light streams along a road at night, and small cars (showCars)
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// Construction. The polyline (points, curve — the same path as a road) is sampled and
|
|
6
|
+
// baked into a small float texture: row 0 the positions, row 1 the tangents, over the
|
|
7
|
+
// arc length. Every car is four camera-facing sprites (two white head lamps, two red tail
|
|
8
|
+
// lamps) in ONE instanced draw: the vertex shader advances the car's phase along the path
|
|
9
|
+
// at `speed`, wraps it, reads position and tangent from the texture, offsets it to its lane
|
|
10
|
+
// (right-hand traffic: the two halves of the road run opposite ways), puts the head pair
|
|
11
|
+
// at the front and the tail pair at the back, and sizes the sprite in pixels. The fragment
|
|
12
|
+
// is a soft disc with a halo (premultiplied, additive-looking), brighter than 1 so bloom
|
|
13
|
+
// picks it up. Nothing is drawn by day (the night factor gates it), the motion is along the
|
|
14
|
+
// object's own path (internal).
|
|
15
|
+
// Cars (showCars): the family's low-poly crowd car (common buildCarGeometry, ~80 triangles) as ONE
|
|
16
|
+
// more instanced draw per stream, one instance per car; lamps and body share ONE car frame in the
|
|
17
|
+
// vertex shader (GLSL_CAR_FRAME: the centre on the path, the ends at fixed offsets along its forward —
|
|
18
|
+
// the lamps at the ends, the body between them; hidden while crossing the path's ends), painted from
|
|
19
|
+
// CAR_PALETTE, shaded like the street furniture (sun + the lamp list / a street grid's lamp field).
|
|
20
|
+
// Visible day and night; no CPU per frame, no shadows.
|
|
21
|
+
import * as THREE from 'three';
|
|
22
|
+
import { mulberry32, createSunUniforms, createLampUniforms, GLSL_FOG_PARS, GLSL_FOG_VERT_PARS, samplePath, FIXTURE_FRAG, buildCarGeometry, CAR_PALETTE } from '../urbanCore.js';
|
|
23
|
+
export const LIGHTING = ['auto', 'day', 'night'];
|
|
24
|
+
export const STRUCTURAL = ['points', 'curve', 'lanes', 'laneWidth', 'density', 'jitter', 'showCars', 'seed'];
|
|
25
|
+
export function createUniforms() {
|
|
26
|
+
// the sun block for the sprites' night factor, plus the lamp list and the fixture knobs the cars' shading reads
|
|
27
|
+
return Object.assign(createSunUniforms(), createLampUniforms(), {
|
|
28
|
+
uPaint: { value: new THREE.Color('#ffffff') },
|
|
29
|
+
uAccent: { value: new THREE.Color('#15171a') },
|
|
30
|
+
uLampColor: { value: new THREE.Color('#ffd9a0') },
|
|
31
|
+
uLampGlow: { value: 0 },
|
|
32
|
+
uRough: { value: 0.35 },
|
|
33
|
+
uPath: { value: null },
|
|
34
|
+
uPathLength: { value: 1 },
|
|
35
|
+
uTime: { value: 0 },
|
|
36
|
+
uSpeed: { value: 12.5 }, // m/s
|
|
37
|
+
uLaneWidth: { value: 3.5 },
|
|
38
|
+
uWidth: { value: 7 },
|
|
39
|
+
uHead: { value: new THREE.Color() },
|
|
40
|
+
uTail: { value: new THREE.Color() },
|
|
41
|
+
uIntensity: { value: 1 },
|
|
42
|
+
uSize: { value: 1 },
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export function applyConfig(u, c) {
|
|
46
|
+
if (c.speed !== undefined)
|
|
47
|
+
u.uSpeed.value = c.speed / 3.6;
|
|
48
|
+
if (c.headlightColor !== undefined)
|
|
49
|
+
u.uHead.value.set(c.headlightColor);
|
|
50
|
+
if (c.taillightColor !== undefined)
|
|
51
|
+
u.uTail.value.set(c.taillightColor);
|
|
52
|
+
if (c.intensity !== undefined)
|
|
53
|
+
u.uIntensity.value = c.intensity;
|
|
54
|
+
if (c.size !== undefined)
|
|
55
|
+
u.uSize.value = c.size;
|
|
56
|
+
if (c.lanes !== undefined && c.laneWidth !== undefined) {
|
|
57
|
+
u.uLaneWidth.value = c.laneWidth;
|
|
58
|
+
u.uWidth.value = Math.max(1, Math.round(c.lanes)) * c.laneWidth;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// ONE car frame, shared by the lamps and the car body (so they can never drift apart): the car's
|
|
62
|
+
// centre on the path in its lane, read ONCE, and its forward from the path's tangent there; its two
|
|
63
|
+
// ends (where its head and tail lamps sit) are fixed offsets 2.3 m either way along that forward.
|
|
64
|
+
// The path texture is not evenly spaced (cars slow near junctions — wanted), so reading the two ends
|
|
65
|
+
// from the path on their own squeezed and stretched a car's lamps (0.2–10 m apart instead of 4.6 m).
|
|
66
|
+
// A car crossing either end of the path is hidden (lamps and body together).
|
|
67
|
+
const GLSL_CAR_FRAME = /* glsl */ `
|
|
68
|
+
uniform sampler2D uPath; uniform float uPathLength; uniform float uTime; uniform float uSpeed;
|
|
69
|
+
const float CAR_HALF = 2.3;
|
|
70
|
+
vec3 pathAt(float s, float lane) {
|
|
71
|
+
float f = clamp(s / uPathLength, 0.0, 1.0);
|
|
72
|
+
vec3 p = texture2D(uPath, vec2(f, 0.25)).xyz;
|
|
73
|
+
vec3 t = normalize(texture2D(uPath, vec2(f, 0.75)).xyz);
|
|
74
|
+
return p + vec3(-t.z, 0.0, t.x) * lane; // to the lane: right of the path's +s direction
|
|
75
|
+
}
|
|
76
|
+
bool carFrame(float phase, float dir, float lane, out vec3 head, out vec3 tail) {
|
|
77
|
+
float c = phase * uPathLength + dir * uSpeed * uTime;
|
|
78
|
+
c = mod(mod(c, uPathLength) + uPathLength, uPathLength);
|
|
79
|
+
if (c < CAR_HALF || c > uPathLength - CAR_HALF) return false;
|
|
80
|
+
vec3 centre = pathAt(c, lane);
|
|
81
|
+
vec3 t = texture2D(uPath, vec2(clamp(c / uPathLength, 0.0, 1.0), 0.75)).xyz;
|
|
82
|
+
vec3 fx = normalize(vec3(t.x, 0.0, t.z) * dir); // the car's forward (flat)
|
|
83
|
+
head = centre + fx * CAR_HALF;
|
|
84
|
+
tail = centre - fx * CAR_HALF;
|
|
85
|
+
return true;
|
|
86
|
+
}`;
|
|
87
|
+
export const VERT = /* glsl */ `
|
|
88
|
+
attribute vec2 corner; // quad corner -1..1
|
|
89
|
+
attribute float aLane; // lane centre offset across the road (metres, signed)
|
|
90
|
+
attribute float aDir; // +1 along the path, -1 against
|
|
91
|
+
attribute float aPhase; // 0..1 the car's start along the path
|
|
92
|
+
attribute float aKind; // 0 head, 1 tail
|
|
93
|
+
attribute float aSide; // -1 left lamp, +1 right lamp
|
|
94
|
+
uniform float uSize; uniform float uNight;
|
|
95
|
+
varying vec2 vUv; varying float vKind;
|
|
96
|
+
${GLSL_FOG_VERT_PARS}
|
|
97
|
+
${GLSL_CAR_FRAME}
|
|
98
|
+
void main() {
|
|
99
|
+
vUv = corner; vKind = aKind;
|
|
100
|
+
vec3 head, tail;
|
|
101
|
+
if (!carFrame(aPhase, aDir, aLane, head, tail)) { gl_Position = vec4(0.0, 0.0, 2.0, 1.0); return; } // past the path's end: clipped
|
|
102
|
+
// the lamp pair at the car's end, 0.75 m either side of its axis, at lamp height
|
|
103
|
+
vec3 fx = normalize(vec3(head.x - tail.x, 0.0, head.z - tail.z));
|
|
104
|
+
vec3 fz = vec3(-fx.z, 0.0, fx.x);
|
|
105
|
+
vec3 p = (aKind < 0.5 ? head : tail) + fz * (aSide * 0.75) + vec3(0.0, 0.65, 0.0);
|
|
106
|
+
vec4 mvPosition = modelViewMatrix * vec4(p, 1.0);
|
|
107
|
+
// Camera-facing quad with a constant size on screen: px pixels on a 900 px tall viewport
|
|
108
|
+
// (bigger for head lamps). projectionMatrix[1][1] is 1 / tan(fov / 2), so the half-size in
|
|
109
|
+
// view space at depth d is px / 900 * d / P11. Clamped below so a close lamp stays a lamp.
|
|
110
|
+
// The floor scales with the object (a city scaled down keeps its lamps lamp-sized).
|
|
111
|
+
float sc = length(modelMatrix[0].xyz);
|
|
112
|
+
float px = (aKind < 0.5 ? 11.0 : 7.0) * uSize;
|
|
113
|
+
float d = max(-mvPosition.z, 0.5 * sc);
|
|
114
|
+
float h = max(px / 900.0 * d / projectionMatrix[1][1], 0.09 * sc);
|
|
115
|
+
mvPosition.xy += corner * h;
|
|
116
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
117
|
+
#include <fog_vertex>
|
|
118
|
+
}`;
|
|
119
|
+
export const FRAG = /* glsl */ `
|
|
120
|
+
precision highp float;
|
|
121
|
+
uniform vec3 uHead; uniform vec3 uTail; uniform float uIntensity; uniform float uNight;
|
|
122
|
+
varying vec2 vUv; varying float vKind;
|
|
123
|
+
${GLSL_FOG_PARS}
|
|
124
|
+
void main() {
|
|
125
|
+
float r = length(vUv);
|
|
126
|
+
if (r > 1.0) discard;
|
|
127
|
+
// A hot core with a soft halo; premultiplied, so it adds light without a square.
|
|
128
|
+
float core = 1.0 / exp(r * r * 9.0);
|
|
129
|
+
float halo = 1.0 / exp(r * 2.2) * 0.35;
|
|
130
|
+
float a = clamp(core + halo, 0.0, 1.0);
|
|
131
|
+
vec3 c = mix(uHead, uTail, vKind) * (vKind < 0.5 ? 2.4 : 1.6) * uIntensity * uNight;
|
|
132
|
+
vec3 col = c * (core * 1.0 + halo);
|
|
133
|
+
gl_FragColor = vec4(col, a * uNight);
|
|
134
|
+
#include <tonemapping_fragment>
|
|
135
|
+
#include <colorspace_fragment>
|
|
136
|
+
#include <fog_fragment>
|
|
137
|
+
}`;
|
|
138
|
+
// The cars: the low-poly car geometry (+x forward, y up) carried along the path like the lamps.
|
|
139
|
+
export const CAR_VERT = /* glsl */ `
|
|
140
|
+
attribute float aEmissive; attribute float aAccent;
|
|
141
|
+
attribute float aLane; attribute float aDir; attribute float aPhase; attribute vec3 aPaint;
|
|
142
|
+
varying vec3 vN; varying vec3 vP; varying float vE; varying float vA; varying vec3 vIC;
|
|
143
|
+
${GLSL_FOG_VERT_PARS}
|
|
144
|
+
${GLSL_CAR_FRAME}
|
|
145
|
+
void main() {
|
|
146
|
+
vE = aEmissive; vA = aAccent; vIC = aPaint; vN = vec3(0.0, 1.0, 0.0); vP = vec3(0.0);
|
|
147
|
+
vec3 head, tail;
|
|
148
|
+
if (!carFrame(aPhase, aDir, aLane, head, tail)) { gl_Position = vec4(0.0, 0.0, 2.0, 1.0); return; } // past the path's end: clipped
|
|
149
|
+
// the body between its lamps: centred on them, facing from tail to head (so a turn bends both alike)
|
|
150
|
+
vec3 fx = normalize(vec3(head.x - tail.x, 0.0, head.z - tail.z));
|
|
151
|
+
vec3 fz = vec3(-fx.z, 0.0, fx.x);
|
|
152
|
+
vec3 c = (head + tail) * 0.5;
|
|
153
|
+
vec3 local = fx * position.x + vec3(0.0, position.y, 0.0) + fz * position.z;
|
|
154
|
+
vec4 wp = modelMatrix * vec4(c + local, 1.0);
|
|
155
|
+
vP = wp.xyz;
|
|
156
|
+
vN = normalize(mat3(modelMatrix) * (fx * normal.x + vec3(0.0, normal.y, 0.0) + fz * normal.z));
|
|
157
|
+
vec4 mvPosition = viewMatrix * wp;
|
|
158
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
159
|
+
#include <fog_vertex>
|
|
160
|
+
}`;
|
|
161
|
+
export function createCarMaterial(u) {
|
|
162
|
+
return new THREE.ShaderMaterial({ uniforms: Object.assign(THREE.UniformsUtils.clone(THREE.UniformsLib.fog), u), vertexShader: CAR_VERT, fragmentShader: FIXTURE_FRAG, fog: true });
|
|
163
|
+
}
|
|
164
|
+
export function createMaterial(u) {
|
|
165
|
+
return new THREE.ShaderMaterial({
|
|
166
|
+
uniforms: Object.assign(THREE.UniformsUtils.clone(THREE.UniformsLib.fog), u), vertexShader: VERT, fragmentShader: FRAG, fog: true,
|
|
167
|
+
transparent: true, depthWrite: false, blending: THREE.CustomBlending, blendSrc: THREE.OneFactor, blendDst: THREE.OneMinusSrcAlphaFactor,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/** The path as a 2-row float texture: positions and tangents sampled uniformly over the arc length. */
|
|
171
|
+
export function pathTexture(samples) {
|
|
172
|
+
const n = Math.max(2, samples.length);
|
|
173
|
+
const data = new Float32Array(n * 2 * 4);
|
|
174
|
+
for (let i = 0; i < n; i++) {
|
|
175
|
+
const S = samples[Math.min(i, samples.length - 1)];
|
|
176
|
+
data.set([S.p.x, S.p.y, S.p.z, S.s], i * 4);
|
|
177
|
+
data.set([S.t.x, S.t.y, S.t.z, 0], (n + i) * 4);
|
|
178
|
+
}
|
|
179
|
+
const tex = new THREE.DataTexture(data, n, 2, THREE.RGBAFormat, THREE.FloatType);
|
|
180
|
+
tex.minFilter = THREE.LinearFilter;
|
|
181
|
+
tex.magFilter = THREE.LinearFilter;
|
|
182
|
+
tex.wrapS = THREE.ClampToEdgeWrapping;
|
|
183
|
+
tex.wrapT = THREE.ClampToEdgeWrapping;
|
|
184
|
+
tex.needsUpdate = true;
|
|
185
|
+
return tex;
|
|
186
|
+
}
|
|
187
|
+
/** The cars as instance attributes: per lane, density x length / 100 cars with jittered spacing; 4 sprites each. */
|
|
188
|
+
export function carInstances(c, length) {
|
|
189
|
+
const rng = mulberry32(c.seed * 2713 + 1);
|
|
190
|
+
const lanes = Math.max(1, Math.round(c.lanes)), W = lanes * c.laneWidth;
|
|
191
|
+
const lane = [], dir = [], phase = [], kind = [], side = [];
|
|
192
|
+
const car = { lane: [], dir: [], phase: [], paint: [] }; // one per car (showCars)
|
|
193
|
+
const col = new THREE.Color();
|
|
194
|
+
for (let l = 0; l < lanes; l++) {
|
|
195
|
+
const t = -W / 2 + (l + 0.5) * c.laneWidth;
|
|
196
|
+
// Right-hand traffic: lanes right of the centre line (t > 0) travel +s, the others -s.
|
|
197
|
+
const d = t > 0 ? 1 : -1;
|
|
198
|
+
const k = Math.max(1, Math.round(c.density * length / 100));
|
|
199
|
+
for (let i = 0; i < k; i++) {
|
|
200
|
+
const ph = (i + 0.5 + (rng() - 0.5) * c.jitter * 0.9) / k;
|
|
201
|
+
for (const kd of [0, 1])
|
|
202
|
+
for (const sd of [-1, 1]) {
|
|
203
|
+
lane.push(t);
|
|
204
|
+
dir.push(d);
|
|
205
|
+
phase.push(ph);
|
|
206
|
+
kind.push(kd);
|
|
207
|
+
side.push(sd);
|
|
208
|
+
}
|
|
209
|
+
col.set(CAR_PALETTE[Math.floor(rng() * CAR_PALETTE.length)]);
|
|
210
|
+
car.lane.push(t);
|
|
211
|
+
car.dir.push(d);
|
|
212
|
+
car.phase.push(ph);
|
|
213
|
+
car.paint.push(col.r, col.g, col.b);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return { lane, dir, phase, kind, side, count: lane.length, car };
|
|
217
|
+
}
|
|
218
|
+
export function build(u, c) {
|
|
219
|
+
const group = new THREE.Group();
|
|
220
|
+
// The path uniforms are this stream's own; everything else (sun, knobs, time) stays the SHARED
|
|
221
|
+
// objects of `u`, so a grid can hand one set to every street and the ring alike.
|
|
222
|
+
const pu = Object.assign({}, u, { uPath: { value: null }, uPathLength: { value: 1 } });
|
|
223
|
+
const mat = createMaterial(pu);
|
|
224
|
+
const carMat = createCarMaterial(pu);
|
|
225
|
+
let mesh = null, tex = null, carMesh = null, carGeo = null;
|
|
226
|
+
const rebuild = (cfg) => {
|
|
227
|
+
if (mesh) {
|
|
228
|
+
group.remove(mesh);
|
|
229
|
+
mesh.geometry.dispose();
|
|
230
|
+
mesh = null;
|
|
231
|
+
}
|
|
232
|
+
if (carMesh) {
|
|
233
|
+
group.remove(carMesh);
|
|
234
|
+
carMesh.geometry.dispose();
|
|
235
|
+
carMesh = null;
|
|
236
|
+
}
|
|
237
|
+
if (tex) {
|
|
238
|
+
tex.dispose();
|
|
239
|
+
tex = null;
|
|
240
|
+
}
|
|
241
|
+
const samples = samplePath(cfg.points, cfg.curve);
|
|
242
|
+
if (samples.length < 2)
|
|
243
|
+
return;
|
|
244
|
+
const L = samples[samples.length - 1].s;
|
|
245
|
+
tex = pathTexture(samples);
|
|
246
|
+
pu.uPath.value = tex;
|
|
247
|
+
pu.uPathLength.value = L;
|
|
248
|
+
const cars = carInstances(cfg, L);
|
|
249
|
+
const geo = new THREE.InstancedBufferGeometry();
|
|
250
|
+
geo.setAttribute('position', new THREE.BufferAttribute(new Float32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 3));
|
|
251
|
+
geo.setAttribute('corner', new THREE.BufferAttribute(new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]), 2));
|
|
252
|
+
geo.setIndex([0, 1, 2, 0, 2, 3]);
|
|
253
|
+
geo.setAttribute('aLane', new THREE.InstancedBufferAttribute(new Float32Array(cars.lane), 1));
|
|
254
|
+
geo.setAttribute('aDir', new THREE.InstancedBufferAttribute(new Float32Array(cars.dir), 1));
|
|
255
|
+
geo.setAttribute('aPhase', new THREE.InstancedBufferAttribute(new Float32Array(cars.phase), 1));
|
|
256
|
+
geo.setAttribute('aKind', new THREE.InstancedBufferAttribute(new Float32Array(cars.kind), 1));
|
|
257
|
+
geo.setAttribute('aSide', new THREE.InstancedBufferAttribute(new Float32Array(cars.side), 1));
|
|
258
|
+
geo.instanceCount = cars.count;
|
|
259
|
+
// Bounds: the path's box (selection + culling); the sprites sit on it.
|
|
260
|
+
const box = new THREE.Box3();
|
|
261
|
+
for (const s of samples)
|
|
262
|
+
box.expandByPoint(s.p);
|
|
263
|
+
box.expandByVector(new THREE.Vector3(cfg.lanes * cfg.laneWidth, 2, cfg.lanes * cfg.laneWidth));
|
|
264
|
+
geo.boundingBox = box;
|
|
265
|
+
geo.boundingSphere = box.getBoundingSphere(new THREE.Sphere());
|
|
266
|
+
mesh = new THREE.Mesh(geo, mat);
|
|
267
|
+
mesh.frustumCulled = false;
|
|
268
|
+
mesh.renderOrder = 10;
|
|
269
|
+
group.add(mesh);
|
|
270
|
+
// the cars under the lamps: one instance per car, the same phase / lane / direction
|
|
271
|
+
if (cfg.showCars && cars.car.lane.length) {
|
|
272
|
+
carGeo ??= buildCarGeometry();
|
|
273
|
+
const cg = new THREE.InstancedBufferGeometry();
|
|
274
|
+
for (const name of ['position', 'normal', 'aEmissive', 'aAccent'])
|
|
275
|
+
cg.setAttribute(name, carGeo.getAttribute(name));
|
|
276
|
+
cg.setIndex(carGeo.getIndex());
|
|
277
|
+
cg.setAttribute('aLane', new THREE.InstancedBufferAttribute(new Float32Array(cars.car.lane), 1));
|
|
278
|
+
cg.setAttribute('aDir', new THREE.InstancedBufferAttribute(new Float32Array(cars.car.dir), 1));
|
|
279
|
+
cg.setAttribute('aPhase', new THREE.InstancedBufferAttribute(new Float32Array(cars.car.phase), 1));
|
|
280
|
+
cg.setAttribute('aPaint', new THREE.InstancedBufferAttribute(new Float32Array(cars.car.paint), 3));
|
|
281
|
+
cg.instanceCount = cars.car.lane.length;
|
|
282
|
+
cg.boundingBox = box.clone();
|
|
283
|
+
cg.boundingSphere = geo.boundingSphere.clone();
|
|
284
|
+
carMesh = new THREE.Mesh(cg, carMat);
|
|
285
|
+
carMesh.frustumCulled = false;
|
|
286
|
+
group.add(carMesh);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
rebuild(c);
|
|
290
|
+
applyConfig(u, c);
|
|
291
|
+
return {
|
|
292
|
+
object: group,
|
|
293
|
+
materials: [mat, carMat],
|
|
294
|
+
uniformSets: [u],
|
|
295
|
+
apply(cfg) { applyConfig(u, cfg); },
|
|
296
|
+
rebuild(cfg) { rebuild(cfg); applyConfig(u, cfg); },
|
|
297
|
+
bounds() { return mesh ? mesh.geometry.boundingBox.clone() : new THREE.Box3(); },
|
|
298
|
+
update(dt) { u.uTime.value += dt; },
|
|
299
|
+
dispose() { if (mesh)
|
|
300
|
+
mesh.geometry.dispose(); if (carMesh)
|
|
301
|
+
carMesh.geometry.dispose(); if (carGeo)
|
|
302
|
+
carGeo.dispose(); if (tex)
|
|
303
|
+
tex.dispose(); mat.dispose(); carMat.dispose(); },
|
|
304
|
+
};
|
|
305
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './urbanCore';
|
|
2
|
+
export * from './textureSetResolver';
|
|
3
|
+
export { useUrbanInstance, resolveUrbanTextures } from './useUrbanInstance';
|
|
4
|
+
export type { UrbanInstance, UrbanVariantProps, UrbanCore } from './useUrbanInstance';
|
|
5
|
+
export type { UrbanBuildingProps } from './UrbanBuilding';
|
|
6
|
+
export { default as UrbanBuilding } from './UrbanBuilding';
|
|
7
|
+
export type { UrbanRoadProps } from './UrbanRoad';
|
|
8
|
+
export { default as UrbanRoad } from './UrbanRoad';
|
|
9
|
+
export type { UrbanBlockProps } from './UrbanBlock';
|
|
10
|
+
export { default as UrbanBlock } from './UrbanBlock';
|
|
11
|
+
export type { UrbanStreetFurnitureProps } from './UrbanStreetFurniture';
|
|
12
|
+
export { default as UrbanStreetFurniture } from './UrbanStreetFurniture';
|
|
13
|
+
export type { UrbanSkylineProps } from './UrbanSkyline';
|
|
14
|
+
export { default as UrbanSkyline } from './UrbanSkyline';
|
|
15
|
+
export type { UrbanPlazaProps } from './UrbanPlaza';
|
|
16
|
+
export { default as UrbanPlaza } from './UrbanPlaza';
|
|
17
|
+
export type { UrbanJunctionProps } from './UrbanJunction';
|
|
18
|
+
export { default as UrbanJunction } from './UrbanJunction';
|
|
19
|
+
export type { UrbanTrafficProps } from './UrbanTraffic';
|
|
20
|
+
export { default as UrbanTraffic } from './UrbanTraffic';
|
|
21
|
+
export type { UrbanSignageProps } from './UrbanSignage';
|
|
22
|
+
export { default as UrbanSignage } from './UrbanSignage';
|
|
23
|
+
export type { UrbanParkProps } from './UrbanPark';
|
|
24
|
+
export { default as UrbanPark } from './UrbanPark';
|
|
25
|
+
export type { UrbanParkingLotProps } from './UrbanParkingLot';
|
|
26
|
+
export { default as UrbanParkingLot } from './UrbanParkingLot';
|
|
27
|
+
export type { UrbanStreetGridProps } from './UrbanStreetGrid';
|
|
28
|
+
export { default as UrbanStreetGrid } from './UrbanStreetGrid';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/urban/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Urban variants (type 'urban', config.type set). One line per variant, written by the integrator.
|
|
2
|
+
export * from './urbanCore.js';
|
|
3
|
+
export * from './textureSetResolver.js';
|
|
4
|
+
export { useUrbanInstance, resolveUrbanTextures } from './useUrbanInstance.js';
|
|
5
|
+
export { default as UrbanBuilding } from './UrbanBuilding.js';
|
|
6
|
+
export { default as UrbanRoad } from './UrbanRoad.js';
|
|
7
|
+
export { default as UrbanBlock } from './UrbanBlock.js';
|
|
8
|
+
export { default as UrbanStreetFurniture } from './UrbanStreetFurniture.js';
|
|
9
|
+
export { default as UrbanSkyline } from './UrbanSkyline.js';
|
|
10
|
+
export { default as UrbanPlaza } from './UrbanPlaza.js';
|
|
11
|
+
export { default as UrbanJunction } from './UrbanJunction.js';
|
|
12
|
+
export { default as UrbanTraffic } from './UrbanTraffic.js';
|
|
13
|
+
export { default as UrbanSignage } from './UrbanSignage.js';
|
|
14
|
+
export { default as UrbanPark } from './UrbanPark.js';
|
|
15
|
+
export { default as UrbanParkingLot } from './UrbanParkingLot.js';
|
|
16
|
+
export { default as UrbanStreetGrid } from './UrbanStreetGrid.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UrbanTextureRef } from '@3driseai/3drise-core';
|
|
2
|
+
export type TextureSetResolver = (set: string) => UrbanTextureRef['maps'] | null;
|
|
3
|
+
export declare function setTextureSetResolver(fn: TextureSetResolver | null): void;
|
|
4
|
+
/** Bumps whenever the resolver (the library) changes, so a component can re-resolve. */
|
|
5
|
+
export declare function textureResolverVersion(): number;
|
|
6
|
+
/** The maps to draw with: the stored ones when there, else the library's (studio only). */
|
|
7
|
+
export declare function resolveTextureMaps(ref: UrbanTextureRef | undefined | null): UrbanTextureRef['maps'] | null;
|
|
8
|
+
//# sourceMappingURL=textureSetResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textureSetResolver.d.ts","sourceRoot":"","sources":["../../../src/components/urban/textureSetResolver.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAKjF,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAGzE;AACD,wFAAwF;AACxF,wBAAgB,sBAAsB,IAAI,MAAM,CAAoB;AAEpE,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAI1G"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let resolver = null;
|
|
2
|
+
let version = 0;
|
|
3
|
+
export function setTextureSetResolver(fn) {
|
|
4
|
+
resolver = fn;
|
|
5
|
+
version++;
|
|
6
|
+
}
|
|
7
|
+
/** Bumps whenever the resolver (the library) changes, so a component can re-resolve. */
|
|
8
|
+
export function textureResolverVersion() { return version; }
|
|
9
|
+
/** The maps to draw with: the stored ones when there, else the library's (studio only). */
|
|
10
|
+
export function resolveTextureMaps(ref) {
|
|
11
|
+
if (!ref || !ref.set)
|
|
12
|
+
return null;
|
|
13
|
+
if (ref.maps && ref.maps.color)
|
|
14
|
+
return ref.maps;
|
|
15
|
+
return resolver ? resolver(ref.set) : null;
|
|
16
|
+
}
|