@3driseai/3drise-viewer 0.1.42 → 0.1.44
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 +6 -4
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// Emitted from Claude outputs/vegetation-lab/flowers.mjs by gen_family.mjs — edit the lab module and re-emit.
|
|
2
|
+
// Flowers — vegetation object (lab module). Shared core: ./common.mjs (blades + petal cards).
|
|
3
|
+
// Construction: a bed or meadow of one species: each flower is a stalk (bent blade), a head of petal
|
|
4
|
+
// cards in the species' arrangement (flat ray florets, a cup, a spike, a crinkled bowl), a centre disc
|
|
5
|
+
// and a few leaves on the stalk. `bloom` folds every petal from a closed bud to open (each flower at
|
|
6
|
+
// its own moment, so a bed opens over a while), stalks lean and nod in the shared wind field, petals
|
|
7
|
+
// flutter and glow against the sun. Species: daisy, tulip, poppy, sunflower, cosmos, lavender spike.
|
|
8
|
+
import * as THREE from 'three';
|
|
9
|
+
import { mulberry32, setColor, createCommonUniforms, applyCommonConfig, updateCommon, QUALITY_V, LEAF_TYPES, bladeGeometry, setBlade, bladeMaterial, clumpedPositions, leafGeometry, setLeaf, unitBounds, leafMaterial, plantMesh, } from '../vegetationCore.js';
|
|
10
|
+
// petals: count, size (unit, at a 4 m bed), tilt (0 flat .. 1 cup), petal leaf type; centre size; stalk height; colours
|
|
11
|
+
// petals: count, size (unit, at a 4 m bed), tilt (0 flat .. 1 cup; negative recurves), cupNormal; rows of petals
|
|
12
|
+
// (rowShrink per row, inner rows more upright); centre size; stalk height; colours; spike (bells along the top);
|
|
13
|
+
// faceDown (hanging bells); sphere (a globe of florets); petalType (SDF) and leafType
|
|
14
|
+
export const SPECIES = {
|
|
15
|
+
daisy: { petals: 21, size: 0.013, tilt: 0.12, cupNormal: 0.25, centre: 0.0075, stalk: 0.75, stalkW: 0.003, leaves: 3, leafSize: 0.018, flower: '#fbf8ee', centreC: '#f0c030', per: 0.6 },
|
|
16
|
+
tulip: { petals: 6, size: 0.03, tilt: 0.85, cupNormal: 1.0, centre: 0.0, stalk: 0.85, stalkW: 0.008, leaves: 2, leafSize: 0.06, flower: '#e2362e', centreC: '#2a2a1a', per: 1, leafType: 'lanceolate' },
|
|
17
|
+
poppy: { petals: 5, size: 0.028, tilt: 0.35, cupNormal: 0.5, centre: 0.008, stalk: 0.8, stalkW: 0.004, leaves: 3, leafSize: 0.03, flower: '#d8261e', centreC: '#1e1a1e', per: 1 },
|
|
18
|
+
sunflower: { petals: 21, size: 0.026, tilt: 0.05, cupNormal: 0.15, centre: 0.028, stalk: 1, stalkW: 0.012, leaves: 4, leafSize: 0.055, flower: '#f3c12a', centreC: '#4a2a12', per: 0.14, lean: 0.3 },
|
|
19
|
+
cosmos: { petals: 8, size: 0.022, tilt: 0.15, cupNormal: 0.25, centre: 0.009, stalk: 0.9, stalkW: 0.003, leaves: 3, leafSize: 0.025, flower: '#ee9ac6', centreC: '#f2c230', per: 1 },
|
|
20
|
+
lavender: { petals: 24, size: 0.007, tilt: 0.6, cupNormal: 0.3, centre: 0.0, stalk: 0.9, stalkW: 0.003, leaves: 2, leafSize: 0.02, flower: '#8d73cf', centreC: '#8d73cf', per: 1.6, spike: 0.22, leafType: 'lanceolate' },
|
|
21
|
+
rose: { petals: 8, size: 0.022, tilt: 0.55, cupNormal: 0.9, rows: 4, rowShrink: 0.18, rowTilt: 0.12, centre: 0.0, stalk: 0.8, stalkW: 0.006, leaves: 4, leafSize: 0.03, flower: '#d8203a', centreC: '#5a1020', per: 0.7, petalType: 'round' },
|
|
22
|
+
peony: { petals: 10, size: 0.026, tilt: 0.4, cupNormal: 0.8, rows: 5, rowShrink: 0.15, rowTilt: 0.12, centre: 0.0, stalk: 0.7, stalkW: 0.007, leaves: 4, leafSize: 0.04, flower: '#f2a8c0', centreC: '#f0d060', per: 0.5, petalType: 'round' },
|
|
23
|
+
lily: { petals: 6, size: 0.038, tilt: 0.3, cupNormal: -0.5, centre: 0.006, stalk: 0.95, stalkW: 0.007, leaves: 5, leafSize: 0.04, flower: '#f7b24a', centreC: '#6a3a10', per: 0.4, petalType: 'lanceolate', leafType: 'lanceolate', lean: 0.25 },
|
|
24
|
+
iris: { petals: 3, size: 0.03, tilt: 0.75, cupNormal: 1.0, rows: 2, rowShrink: 0.0, rowTilt: -1.3, centre: 0.0, stalk: 0.95, stalkW: 0.006, leaves: 3, leafSize: 0.08, flower: '#5a4ab8', centreC: '#f0d040', per: 0.5, leafType: 'blade' },
|
|
25
|
+
dandelion: { petals: 26, size: 0.011, tilt: 0.08, cupNormal: 0.2, rows: 2, rowShrink: 0.3, rowTilt: 0.25, centre: 0.005, stalk: 0.4, stalkW: 0.004, leaves: 5, leafSize: 0.035, flower: '#f5c518', centreC: '#e0a010', per: 0.8, petalType: 'lanceolate', leafType: 'lobed' },
|
|
26
|
+
dandelionPuff: { petals: 70, size: 0.012, sphere: 0.012, centre: 0.004, stalk: 0.55, stalkW: 0.004, leaves: 5, leafSize: 0.035, flower: '#f4f2ea', centreC: '#c8c0a0', per: 0.6, petalType: 'blade', leafType: 'lobed' },
|
|
27
|
+
allium: { petals: 110, size: 0.008, sphere: 0.03, centre: 0.0, stalk: 1, stalkW: 0.006, leaves: 2, leafSize: 0.06, flower: '#9a5ac8', centreC: '#9a5ac8', per: 0.3, leafType: 'blade' },
|
|
28
|
+
clover: { petals: 36, size: 0.006, sphere: 0.008, centre: 0.0, stalk: 0.3, stalkW: 0.002, leaves: 3, leafSize: 0.02, flower: '#e8a0c0', centreC: '#e8a0c0', per: 1.5, leafType: 'round' },
|
|
29
|
+
bluebell: { petals: 6, size: 0.009, tilt: 0.85, cupNormal: 0.9, centre: 0.0, stalk: 0.6, stalkW: 0.003, leaves: 3, leafSize: 0.04, flower: '#5a6ad8', centreC: '#5a6ad8', per: 1.2, spike: 0.2, spikeN: 7, faceDown: 1, leafType: 'blade' },
|
|
30
|
+
foxglove: { petals: 5, size: 0.014, tilt: 0.9, cupNormal: 0.95, centre: 0.0, stalk: 1, stalkW: 0.006, leaves: 4, leafSize: 0.05, flower: '#c868b0', centreC: '#c868b0', per: 0.35, spike: 0.42, spikeN: 16, faceDown: 0.6 },
|
|
31
|
+
lupine: { petals: 6, size: 0.008, tilt: 0.7, cupNormal: 0.6, centre: 0.0, stalk: 1, stalkW: 0.005, leaves: 4, leafSize: 0.04, flower: '#6a4ac8', centreC: '#6a4ac8', per: 0.5, spike: 0.4, spikeN: 22, leafType: 'frond' },
|
|
32
|
+
marigold: { petals: 14, size: 0.014, tilt: 0.3, cupNormal: 0.6, rows: 3, rowShrink: 0.2, rowTilt: 0.15, centre: 0.004, stalk: 0.5, stalkW: 0.004, leaves: 4, leafSize: 0.025, flower: '#f2901e', centreC: '#c86a10', per: 1, petalType: 'round', leafType: 'frond' },
|
|
33
|
+
chrysanthemum: { petals: 20, size: 0.016, tilt: 0.25, cupNormal: 0.5, rows: 4, rowShrink: 0.16, rowTilt: 0.15, centre: 0.0, stalk: 0.7, stalkW: 0.005, leaves: 4, leafSize: 0.03, flower: '#f0d040', centreC: '#f0d040', per: 0.6, petalType: 'lanceolate', leafType: 'lobed' },
|
|
34
|
+
carnation: { petals: 12, size: 0.016, tilt: 0.5, cupNormal: 0.7, rows: 3, rowShrink: 0.15, rowTilt: 0.15, centre: 0.0, stalk: 0.8, stalkW: 0.004, leaves: 3, leafSize: 0.03, flower: '#f06a90', centreC: '#f06a90', per: 0.7, petalType: 'round', leafType: 'lanceolate' },
|
|
35
|
+
gerbera: { petals: 26, size: 0.018, tilt: 0.08, cupNormal: 0.2, rows: 2, rowShrink: 0.25, rowTilt: 0.2, centre: 0.012, stalk: 0.7, stalkW: 0.005, leaves: 3, leafSize: 0.04, flower: '#f25a3a', centreC: '#3a2a1a', per: 0.5, petalType: 'lanceolate', leafType: 'lobed' },
|
|
36
|
+
anemone: { petals: 7, size: 0.022, tilt: 0.2, cupNormal: 0.4, centre: 0.009, stalk: 0.6, stalkW: 0.003, leaves: 3, leafSize: 0.03, flower: '#e8406a', centreC: '#101018', per: 0.8, petalType: 'round', leafType: 'lobed' },
|
|
37
|
+
buttercup: { petals: 5, size: 0.011, tilt: 0.3, cupNormal: 0.6, centre: 0.004, stalk: 0.5, stalkW: 0.002, leaves: 3, leafSize: 0.022, flower: '#f8d020', centreC: '#e0b010', per: 1.3, petalType: 'round', leafType: 'lobed' },
|
|
38
|
+
pansy: { petals: 5, size: 0.02, tilt: 0.1, cupNormal: 0.3, centre: 0.005, stalk: 0.3, stalkW: 0.003, leaves: 3, leafSize: 0.025, flower: '#6a3ab8', centreC: '#f0d040', per: 1, petalType: 'round', leafType: 'round' },
|
|
39
|
+
crocus: { petals: 6, size: 0.022, tilt: 0.8, cupNormal: 0.9, centre: 0.0, stalk: 0.25, stalkW: 0.004, leaves: 4, leafSize: 0.05, flower: '#8a5ad0', centreC: '#f0a020', per: 1.2, leafType: 'blade' },
|
|
40
|
+
hibiscus: { petals: 5, size: 0.036, tilt: 0.2, cupNormal: 0.5, centre: 0.01, stalk: 0.7, stalkW: 0.006, leaves: 4, leafSize: 0.05, flower: '#e8203a', centreC: '#f0d040', per: 0.4, petalType: 'round' },
|
|
41
|
+
lotus: { petals: 12, size: 0.045, tilt: 0.45, cupNormal: 0.8, rows: 3, rowShrink: 0.2, rowTilt: 0.15, centre: 0.015, stalk: 0.45, stalkW: 0.008, leaves: 3, leafSize: 0.14, flower: '#f6b0c8', centreC: '#f0d060', per: 0.12, leafType: 'round' },
|
|
42
|
+
zinnia: { petals: 12, size: 0.016, tilt: 0.15, cupNormal: 0.3, rows: 3, rowShrink: 0.2, rowTilt: 0.12, centre: 0.008, stalk: 0.6, stalkW: 0.004, leaves: 3, leafSize: 0.03, flower: '#e03a8a', centreC: '#f0c030', per: 0.8, petalType: 'round' },
|
|
43
|
+
aster: { petals: 22, size: 0.012, tilt: 0.1, cupNormal: 0.2, rows: 2, rowShrink: 0.2, rowTilt: 0.15, centre: 0.007, stalk: 0.7, stalkW: 0.003, leaves: 4, leafSize: 0.025, flower: '#9a7ad8', centreC: '#f0c030', per: 0.9, petalType: 'lanceolate', leafType: 'lanceolate' },
|
|
44
|
+
cornflower: { petals: 10, size: 0.013, tilt: 0.25, cupNormal: 0.5, rows: 2, rowShrink: 0.3, rowTilt: 0.3, centre: 0.005, stalk: 0.75, stalkW: 0.003, leaves: 3, leafSize: 0.025, flower: '#3a5ad8', centreC: '#2a2a6a', per: 1, petalType: 'petal', leafType: 'lanceolate' },
|
|
45
|
+
snapdragon: { petals: 4, size: 0.011, tilt: 0.7, cupNormal: 0.8, centre: 0.0, stalk: 0.8, stalkW: 0.004, leaves: 4, leafSize: 0.03, flower: '#f0a0c0', centreC: '#f0a0c0', per: 0.6, spike: 0.3, spikeN: 12, faceDown: 0.2, leafType: 'lanceolate' },
|
|
46
|
+
orchid: { petals: 5, size: 0.022, tilt: 0.2, cupNormal: 0.4, centre: 0.007, stalk: 0.75, stalkW: 0.004, leaves: 2, leafSize: 0.06, flower: '#f2c0e0', centreC: '#a0207a', per: 0.4, spike: 0.3, spikeN: 5, faceDown: 0.25, petalType: 'round', leafType: 'blade' },
|
|
47
|
+
};
|
|
48
|
+
const FLOWER_BASE = 420;
|
|
49
|
+
export function createUniforms() { return Object.assign(createCommonUniforms(), { uLeafType: { value: LEAF_TYPES.indexOf('broadleaf') } }); }
|
|
50
|
+
export function applyConfig(u, c, mats) {
|
|
51
|
+
applyCommonConfig(u, Object.assign({}, c, { leafType: undefined }));
|
|
52
|
+
if (!mats)
|
|
53
|
+
return;
|
|
54
|
+
if (c.species !== undefined)
|
|
55
|
+
c = Object.assign({}, c, speciesColors(c));
|
|
56
|
+
if (c.flowerColor !== undefined)
|
|
57
|
+
setColor(mats.petalU.uColor, c.flowerColor);
|
|
58
|
+
if (c.centerColor !== undefined)
|
|
59
|
+
setColor(mats.centreU.uColor, c.centerColor);
|
|
60
|
+
if (c.color !== undefined && mats.underU) {
|
|
61
|
+
setColor(mats.underU.uColor, c.color);
|
|
62
|
+
}
|
|
63
|
+
if (c.shadeColor !== undefined && mats.underU)
|
|
64
|
+
setColor(mats.underU.uShadeColor, c.shadeColor);
|
|
65
|
+
if (c.bloom !== undefined)
|
|
66
|
+
mats.bloom.value = c.bloom;
|
|
67
|
+
if (c.headSize !== undefined) {
|
|
68
|
+
mats.petalU.uLeafSize.value = c.headSize;
|
|
69
|
+
mats.centreU.uLeafSize.value = c.headSize;
|
|
70
|
+
}
|
|
71
|
+
if (c.stemHeight !== undefined || c.growth !== undefined) {
|
|
72
|
+
if (c.stemHeight !== undefined)
|
|
73
|
+
mats.state.stem = c.stemHeight;
|
|
74
|
+
if (c.growth !== undefined)
|
|
75
|
+
mats.state.growth = c.growth;
|
|
76
|
+
mats.stalkU.uGrowth.value = mats.state.stem * mats.state.growth;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** A colour the user has not customised (it is some species' default) follows the current species. */
|
|
80
|
+
export function speciesColors(c) {
|
|
81
|
+
const sp = SPECIES[c.species] || SPECIES.daisy;
|
|
82
|
+
const defaults = Object.values(SPECIES);
|
|
83
|
+
const isDefault = (v, key) => !v || defaults.some((s) => s[key].toLowerCase() === String(v).toLowerCase());
|
|
84
|
+
return { flowerColor: isDefault(c.flowerColor, 'flower') ? sp.flower : c.flowerColor, centerColor: isDefault(c.centerColor, 'centreC') ? sp.centreC : c.centerColor };
|
|
85
|
+
}
|
|
86
|
+
export function build(u, c) {
|
|
87
|
+
const q = QUALITY_V[c.quality] || 1;
|
|
88
|
+
const sp = SPECIES[c.species] || SPECIES.daisy;
|
|
89
|
+
c = Object.assign({}, c, speciesColors(c));
|
|
90
|
+
const rnd = mulberry32((c.seed ?? 21) * 2654435761 + 41);
|
|
91
|
+
const n = Math.round(FLOWER_BASE * (c.density ?? 1) * q * sp.per);
|
|
92
|
+
const pts = clumpedPositions(n, rnd, c.clumping ?? 0.4, 0.02);
|
|
93
|
+
const stalkU = Object.assign({}, u, { uGrowth: { value: (c.stemHeight ?? 1) * (c.growth ?? 1) }, uLeafSize: { value: 1 } });
|
|
94
|
+
const petalU = Object.assign({}, u, { uLeafType: { value: LEAF_TYPES.indexOf(sp.petalType || 'petal') }, uColor: { value: new THREE.Color(c.flowerColor || sp.flower) }, uShadeColor: { value: new THREE.Color(sp.flower).multiplyScalar(0.55) }, uGrowth: stalkU.uGrowth, uFoliage: { value: 1 }, uSeason: { value: 0 }, uLeafSize: { value: c.headSize ?? 1 } });
|
|
95
|
+
const centreU = Object.assign({}, petalU, { uLeafType: { value: LEAF_TYPES.indexOf('round') }, uColor: { value: new THREE.Color(c.centerColor || sp.centreC) }, uShadeColor: { value: new THREE.Color(sp.centreC).multiplyScalar(0.6) }, uLeafSize: petalU.uLeafSize });
|
|
96
|
+
const leafU = Object.assign({}, u, { uLeafType: { value: LEAF_TYPES.indexOf(sp.leafType || 'broadleaf') }, uGrowth: stalkU.uGrowth });
|
|
97
|
+
const spikeN = sp.spike ? sp.petals : 0;
|
|
98
|
+
const stalks = bladeGeometry(n);
|
|
99
|
+
const petalCap = sp.sphere ? sp.petals : (sp.rows || 1) * Math.min(sp.petals, sp.spike ? 8 : 999) * (sp.spike ? (sp.spikeN || sp.petals) : 1);
|
|
100
|
+
const petalGeo = leafGeometry(n * petalCap), centreGeo = leafGeometry(Math.max(1, sp.centre > 0 ? n : 1)), leafGeo = leafGeometry(n * sp.leaves);
|
|
101
|
+
const along = new THREE.Vector3(), nrm = new THREE.Vector3(), up = new THREE.Vector3(0, 1, 0), pos = new THREE.Vector3(), root = new THREE.Vector3();
|
|
102
|
+
let pi = 0, ci = 0, li = 0;
|
|
103
|
+
for (let i = 0; i < n; i++) {
|
|
104
|
+
const p = pts[i];
|
|
105
|
+
const h = sp.stalk * (0.8 + 0.4 * rnd());
|
|
106
|
+
const yaw = rnd() * Math.PI * 2, lean = (sp.lean || 0.12) * rnd(), phase = rnd(), moment = rnd();
|
|
107
|
+
setBlade(stalks, i, p, h, sp.stalkW, yaw, rnd(), lean, phase, 0, 0);
|
|
108
|
+
// the head sits where the bent stalk ends (its curve: fwd * lean * H)
|
|
109
|
+
const fwd = new THREE.Vector3(-Math.sin(yaw), 0, Math.cos(yaw));
|
|
110
|
+
pos.set(p.x, h * 0.985, p.z).addScaledVector(fwd, lean * h);
|
|
111
|
+
root.set(p.x, 0, p.z);
|
|
112
|
+
// the head faces up and a little along the lean; sunflowers face the sun side
|
|
113
|
+
const face = new THREE.Vector3(fwd.x * (0.3 + lean * 2), 1, fwd.z * (0.3 + lean * 2)).normalize();
|
|
114
|
+
const perp = new THREE.Vector3().crossVectors(face, Math.abs(face.y) < 0.9 ? up : new THREE.Vector3(1, 0, 0)).normalize();
|
|
115
|
+
const rows = sp.rows || 1, perRow = sp.petals;
|
|
116
|
+
if (sp.sphere) {
|
|
117
|
+
// a globe of florets (dandelion clock, allium, clover): petals on a Fibonacci sphere around the head
|
|
118
|
+
const n = sp.petals, R = sp.sphere;
|
|
119
|
+
for (let k = 0; k < n; k++) {
|
|
120
|
+
const yy = 1 - 2 * (k + 0.5) / n, rr = Math.sqrt(1 - yy * yy), ang = k * 2.39996;
|
|
121
|
+
const dir = new THREE.Vector3(Math.cos(ang) * rr, yy, Math.sin(ang) * rr);
|
|
122
|
+
const at = pos.clone().addScaledVector(dir, R * 0.35);
|
|
123
|
+
nrm.crossVectors(dir, perp).normalize();
|
|
124
|
+
setLeaf(petalGeo, pi, at, dir, nrm, sp.size * (0.85 + 0.3 * rnd()), rnd(), h, 1, phase, 0.4, 0, 0);
|
|
125
|
+
petalGeo.attributes.aInfoA.setW(pi, moment);
|
|
126
|
+
petalGeo.attributes.aRoot.setXYZ(pi, root.x, root.y, root.z);
|
|
127
|
+
pi++;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
const spikeN = sp.spike ? (sp.spikeN || sp.petals) : 1;
|
|
132
|
+
const heads = sp.spike ? spikeN : 1;
|
|
133
|
+
for (let hh = 0; hh < heads; hh++) {
|
|
134
|
+
// a spike: small heads along the top of the stalk, facing out (and down for bells)
|
|
135
|
+
let hFace = face.clone(), at = pos.clone();
|
|
136
|
+
if (sp.spike) {
|
|
137
|
+
const a0 = hh * 2.4 + rnd() * 0.5, ty = hh / heads;
|
|
138
|
+
at = pos.clone().addScaledVector(face, -sp.spike * ty);
|
|
139
|
+
hFace = new THREE.Vector3(Math.cos(a0), 0.4 - (sp.faceDown || 0) * 1.3, Math.sin(a0)).normalize();
|
|
140
|
+
at.addScaledVector(hFace, 0.004);
|
|
141
|
+
}
|
|
142
|
+
else if (sp.faceDown)
|
|
143
|
+
hFace = new THREE.Vector3(hFace.x, -hFace.y * sp.faceDown, hFace.z).normalize();
|
|
144
|
+
const hPerp = new THREE.Vector3().crossVectors(hFace, Math.abs(hFace.y) < 0.9 ? up : new THREE.Vector3(1, 0, 0)).normalize();
|
|
145
|
+
const petN = sp.spike ? Math.min(perRow, 8) : perRow;
|
|
146
|
+
for (let r = 0; r < rows; r++) {
|
|
147
|
+
const scale = 1 - r * (sp.rowShrink || 0), tilt = Math.min(0.98, sp.tilt + r * (sp.rowTilt || 0)), cupN = sp.cupNormal + r * (sp.rowTilt || 0) * 0.5;
|
|
148
|
+
const rAt = at.clone().addScaledVector(hFace, r * 0.004);
|
|
149
|
+
for (let k = 0; k < petN; k++) {
|
|
150
|
+
const a = (k + 0.5 * (r % 2)) / petN * Math.PI * 2 + rnd() * 0.15;
|
|
151
|
+
along.copy(hPerp).applyAxisAngle(hFace, a).multiplyScalar(1 - Math.abs(tilt)).addScaledVector(hFace, tilt).normalize();
|
|
152
|
+
nrm.copy(hFace).multiplyScalar(1 - Math.abs(cupN)).addScaledVector(hPerp.clone().applyAxisAngle(hFace, a), -cupN).normalize();
|
|
153
|
+
if (pi >= petalGeo.instanceCount)
|
|
154
|
+
break;
|
|
155
|
+
setLeaf(petalGeo, pi, rAt, along, nrm, sp.size * scale * (0.85 + 0.3 * rnd()), rnd(), h, 1, phase, 0.4, 0, 0);
|
|
156
|
+
petalGeo.attributes.aInfoA.setW(pi, moment);
|
|
157
|
+
petalGeo.attributes.aRoot.setXYZ(pi, root.x, root.y, root.z);
|
|
158
|
+
pi++;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (sp.centre > 0) {
|
|
164
|
+
setLeaf(centreGeo, ci, pos.clone().addScaledVector(face, 0.002), perp, face, sp.centre, rnd(), h, 1, phase, 0.4, 0, 0);
|
|
165
|
+
centreGeo.attributes.aRoot.setXYZ(ci, root.x, root.y, root.z);
|
|
166
|
+
ci++;
|
|
167
|
+
}
|
|
168
|
+
for (let k = 0; k < sp.leaves; k++) {
|
|
169
|
+
const t = 0.15 + 0.5 * rnd(), a = rnd() * Math.PI * 2;
|
|
170
|
+
const lp = new THREE.Vector3(p.x, h * t, p.z).addScaledVector(fwd, lean * h * t * t);
|
|
171
|
+
along.set(Math.cos(a), 0.5 + 0.5 * rnd(), Math.sin(a)).normalize();
|
|
172
|
+
nrm.set(Math.cos(a), 1.2, Math.sin(a)).normalize();
|
|
173
|
+
setLeaf(leafGeo, li, lp, along, nrm, sp.leafSize * (0.8 + 0.4 * rnd()), rnd(), h * t, 0.8, phase, 0.5, 0, 0);
|
|
174
|
+
leafGeo.attributes.aRoot.setXYZ(li, root.x, root.y, root.z);
|
|
175
|
+
li++;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
petalGeo.instanceCount = pi;
|
|
179
|
+
centreGeo.instanceCount = Math.max(ci, 0);
|
|
180
|
+
leafGeo.instanceCount = li;
|
|
181
|
+
for (const g of [stalks, petalGeo, centreGeo, leafGeo]) {
|
|
182
|
+
for (const k of ['aPos', 'aInfoA', 'aInfoB', 'aQuat', 'aRoot'])
|
|
183
|
+
if (g.attributes[k])
|
|
184
|
+
g.attributes[k].needsUpdate = true;
|
|
185
|
+
unitBounds(g);
|
|
186
|
+
}
|
|
187
|
+
// undergrowth: a sward of short blades the flowers stand in
|
|
188
|
+
const nU = Math.round(9000 * (c.undergrowth ?? 0.6) * q);
|
|
189
|
+
const under = bladeGeometry(Math.max(1, nU));
|
|
190
|
+
const upts = clumpedPositions(Math.max(1, nU), rnd, 0.3, 0.01);
|
|
191
|
+
for (let i = 0; i < nU; i++)
|
|
192
|
+
setBlade(under, i, upts[i], (0.18 + 0.2 * rnd()) * sp.stalk, 0.008 * (0.8 + 0.5 * rnd()), rnd() * Math.PI * 2, rnd(), 0.5 + 0.6 * rnd(), rnd(), 0, 0);
|
|
193
|
+
under.instanceCount = nU;
|
|
194
|
+
for (const k of ['aPos', 'aInfoA', 'aInfoB'])
|
|
195
|
+
under.attributes[k].needsUpdate = true;
|
|
196
|
+
unitBounds(under);
|
|
197
|
+
const underU = Object.assign({}, u, { uGrowth: stalkU.uGrowth, uColor: { value: new THREE.Color(c.color || '#5e9a3c').multiplyScalar(1.05) }, uShadeColor: { value: new THREE.Color(c.shadeColor || '#244a1c') } });
|
|
198
|
+
const underPair = bladeMaterial(underU, { translucency: 0.5 });
|
|
199
|
+
const stalkPair = bladeMaterial(stalkU, { translucency: 0.4, taper: 0.3 });
|
|
200
|
+
const petalPair = leafMaterial(petalU, { translucency: 0.75, veins: 0.0, roughness: 0.9, bloom: true, curl: 0.5, underside: 0.08 });
|
|
201
|
+
petalPair.material.envMapIntensity = 0.2;
|
|
202
|
+
const centrePair = leafMaterial(centreU, { translucency: 0.1, veins: 0, roughness: 0.95, underside: 0 });
|
|
203
|
+
const leafPair = leafMaterial(leafU, { translucency: 0.5, veins: 0.4 });
|
|
204
|
+
const object = new THREE.Group();
|
|
205
|
+
object.name = 'flowers';
|
|
206
|
+
object.add(plantMesh(under, underPair, 'undergrowth'), plantMesh(stalks, stalkPair, 'stalks'), plantMesh(leafGeo, leafPair, 'leaves'), plantMesh(petalGeo, petalPair, 'petals'));
|
|
207
|
+
if (sp.centre > 0)
|
|
208
|
+
object.add(plantMesh(centreGeo, centrePair, 'centres'));
|
|
209
|
+
const mats = { petalU, centreU, stalkU, underU, bloom: petalPair.material.userData.uniforms.uBloom, state: { stem: c.stemHeight ?? 1, growth: c.growth ?? 1 } };
|
|
210
|
+
applyConfig(u, c, mats);
|
|
211
|
+
return {
|
|
212
|
+
object,
|
|
213
|
+
materials: [underPair.material, stalkPair.material, petalPair.material, centrePair.material, leafPair.material],
|
|
214
|
+
apply: function (cfg) { applyConfig(u, cfg, mats); },
|
|
215
|
+
update: function (dt, camera, sunWorld) { updateCommon(u, object, camera, dt, sunWorld); },
|
|
216
|
+
stats: { flowers: n, petals: pi },
|
|
217
|
+
dispose: function () { for (const g of [under, stalks, petalGeo, centreGeo, leafGeo])
|
|
218
|
+
g.dispose(); for (const p of [underPair, stalkPair, petalPair, centrePair, leafPair]) {
|
|
219
|
+
p.material.dispose();
|
|
220
|
+
p.depth.dispose();
|
|
221
|
+
} },
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
|
|
225
|
+
export const STRUCTURAL = ['species', 'clumping', 'density', 'quality', 'seed', 'undergrowth'];
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare const MIXES: {
|
|
3
|
+
temperate: {
|
|
4
|
+
trees: (string | number)[][];
|
|
5
|
+
under: string[];
|
|
6
|
+
};
|
|
7
|
+
conifer: {
|
|
8
|
+
trees: (string | number)[][];
|
|
9
|
+
under: string[];
|
|
10
|
+
};
|
|
11
|
+
birch: {
|
|
12
|
+
trees: (string | number)[][];
|
|
13
|
+
under: string[];
|
|
14
|
+
};
|
|
15
|
+
autumn: {
|
|
16
|
+
trees: (string | number)[][];
|
|
17
|
+
under: string[];
|
|
18
|
+
};
|
|
19
|
+
mediterranean: {
|
|
20
|
+
trees: (string | number)[][];
|
|
21
|
+
under: string[];
|
|
22
|
+
};
|
|
23
|
+
tropical: {
|
|
24
|
+
trees: (string | number)[][];
|
|
25
|
+
under: string[];
|
|
26
|
+
};
|
|
27
|
+
savanna: {
|
|
28
|
+
trees: (string | number)[][];
|
|
29
|
+
under: string[];
|
|
30
|
+
};
|
|
31
|
+
blossom: {
|
|
32
|
+
trees: (string | number)[][];
|
|
33
|
+
under: string[];
|
|
34
|
+
};
|
|
35
|
+
winter: {
|
|
36
|
+
trees: (string | number)[][];
|
|
37
|
+
under: string[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare function createUniforms(): {
|
|
41
|
+
uTime: {
|
|
42
|
+
value: number;
|
|
43
|
+
};
|
|
44
|
+
uWindPhase: {
|
|
45
|
+
value: number;
|
|
46
|
+
};
|
|
47
|
+
uWindDir: {
|
|
48
|
+
value: THREE.Vector2;
|
|
49
|
+
};
|
|
50
|
+
uWindStrength: {
|
|
51
|
+
value: number;
|
|
52
|
+
};
|
|
53
|
+
uTurb: {
|
|
54
|
+
value: number;
|
|
55
|
+
};
|
|
56
|
+
uSpeed: {
|
|
57
|
+
value: number;
|
|
58
|
+
};
|
|
59
|
+
uSway: {
|
|
60
|
+
value: number;
|
|
61
|
+
};
|
|
62
|
+
uFlutter: {
|
|
63
|
+
value: number;
|
|
64
|
+
};
|
|
65
|
+
uScale: {
|
|
66
|
+
value: THREE.Vector3;
|
|
67
|
+
};
|
|
68
|
+
uMean: {
|
|
69
|
+
value: number;
|
|
70
|
+
};
|
|
71
|
+
uOpacity: {
|
|
72
|
+
value: number;
|
|
73
|
+
};
|
|
74
|
+
uColor: {
|
|
75
|
+
value: THREE.Color;
|
|
76
|
+
};
|
|
77
|
+
uShadeColor: {
|
|
78
|
+
value: THREE.Color;
|
|
79
|
+
};
|
|
80
|
+
uSeason: {
|
|
81
|
+
value: number;
|
|
82
|
+
};
|
|
83
|
+
uFoliage: {
|
|
84
|
+
value: number;
|
|
85
|
+
};
|
|
86
|
+
uLeafType: {
|
|
87
|
+
value: number;
|
|
88
|
+
};
|
|
89
|
+
uLeafSize: {
|
|
90
|
+
value: number;
|
|
91
|
+
};
|
|
92
|
+
uGrowth: {
|
|
93
|
+
value: number;
|
|
94
|
+
};
|
|
95
|
+
uSunDirView: {
|
|
96
|
+
value: THREE.Vector3;
|
|
97
|
+
};
|
|
98
|
+
uViewPos: {
|
|
99
|
+
value: THREE.Vector3;
|
|
100
|
+
};
|
|
101
|
+
uLodK: {
|
|
102
|
+
value: number;
|
|
103
|
+
};
|
|
104
|
+
uLodOrtho: {
|
|
105
|
+
value: number;
|
|
106
|
+
};
|
|
107
|
+
uLodBias: {
|
|
108
|
+
value: number;
|
|
109
|
+
};
|
|
110
|
+
uImpReady: {
|
|
111
|
+
value: number;
|
|
112
|
+
};
|
|
113
|
+
uBake: {
|
|
114
|
+
value: number;
|
|
115
|
+
};
|
|
116
|
+
uBakeView: {
|
|
117
|
+
value: THREE.Matrix3;
|
|
118
|
+
};
|
|
119
|
+
uBakeDepth: {
|
|
120
|
+
value: THREE.Vector2;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
export declare function applyConfig(u: any, c: any, plants: any): void;
|
|
124
|
+
export declare function build(u: any, c: any): {
|
|
125
|
+
object: THREE.Group<THREE.Object3DEventMap>;
|
|
126
|
+
materials: any[];
|
|
127
|
+
apply: (cfg: any) => void;
|
|
128
|
+
update: (dt: any, camera: any, sunWorld: any, renderer: any) => void;
|
|
129
|
+
stats: {
|
|
130
|
+
trees: number;
|
|
131
|
+
undergrowth: number;
|
|
132
|
+
species: number;
|
|
133
|
+
};
|
|
134
|
+
dispose: () => void;
|
|
135
|
+
};
|
|
136
|
+
/** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
|
|
137
|
+
export declare const STRUCTURAL: string[];
|
|
138
|
+
//# sourceMappingURL=forest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forest.d.ts","sourceRoot":"","sources":["../../../../src/components/vegetation/core/forest.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUjB,CAAC;AAUF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC;AAqBnE,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,MAAM,KAAA,QAIvC;AAUD,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;;;EA8KzB;AAED,8GAA8G;AAC9G,eAAO,MAAM,UAAU,UAAyF,CAAC"}
|