@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 @@
|
|
|
1
|
+
{"version":3,"file":"crops.d.ts","sourceRoot":"","sources":["../../../../src/components/vegetation/core/crops.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkKnB,CAAC;AAEF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC;AAEnE,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,IAAI,KAAA,QAWrC;AAED,wBAAgB,aAAa,CAAC,CAAC,KAAA,OAO9B;AAED,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;;;EA6GzB;AAED,8GAA8G;AAC9G,eAAO,MAAM,UAAU,UAA4D,CAAC"}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
// Emitted from Claude outputs/vegetation-lab/crops.mjs by gen_family.mjs — edit the lab module and re-emit.
|
|
2
|
+
// Crops — vegetation object (lab module). Shared core: ./common.mjs + ./produce.mjs.
|
|
3
|
+
// Construction: a planted bed: rows of one crop on ridged soil. Each plant is a small branching model
|
|
4
|
+
// of the species' habit (a staked tomato vine, a corn stalk with blade leaves, a lettuce rosette, a
|
|
5
|
+
// sprawling pumpkin vine…) with shaped leaves, and the species' produce (the fruit/vegetable engine's
|
|
6
|
+
// pieces) set on the plant. `growth` grows every plant from its root — seedlings to full plants, the
|
|
7
|
+
// produce setting late and `ripeness` colouring it. Wind as the rest of the family.
|
|
8
|
+
import * as THREE from 'three';
|
|
9
|
+
import { mulberry32, createCommonUniforms, applyCommonConfig, updateCommon, QUALITY_V, LEAF_TYPES, generatePlant, branchGeometry, leafGeometry, fillLeaves, unitBounds, barkMaterial, leafMaterial, plantMesh, NOISE_GLSL_V, flowerHeads, } from '../vegetationCore.js';
|
|
10
|
+
import { PRODUCE, buildPiece, produceMaterial, instancePieces, applyKind } from '../produceCore.js';
|
|
11
|
+
// plant habits (unit plant: height ~1 before scaling to the row); kind = the produce piece, perPlant, where it sits
|
|
12
|
+
export const SPECIES = {
|
|
13
|
+
tomato: {
|
|
14
|
+
kind: 'tomato', perPlant: 7, pieceSize: 0.1, hang: true, leaf: 'lobed', bark: '#5a7a3a', height: 1,
|
|
15
|
+
levels: 2, droop: 0.2, twist: 0.3, photo: 0.6,
|
|
16
|
+
trunk: { length: 0.02, radius: 0.012, taper: 0, segments: 2, flex: 0.2 },
|
|
17
|
+
level: [{ count: 3, length: 45, radius: 0.8, downAngle: 15, downVar: 20, curve: 10, segments: 6, start: 0 }, { count: 6, length: 0.35, radius: 0.5, downAngle: 60, downVar: 30, curve: 10, segments: 3, start: 0.15 }],
|
|
18
|
+
leaves: { perLength: 14, size: 0.09, sizeVar: 0.3, spread: 0.8, lift: 0.1, fromLevel: 1, tuft: 2, start: 0.2 },
|
|
19
|
+
},
|
|
20
|
+
pepper: {
|
|
21
|
+
kind: 'pepper', perPlant: 4, pieceSize: 0.12, hang: true, leaf: 'broadleaf', bark: '#5a7a3a', height: 0.7,
|
|
22
|
+
levels: 2, droop: 0.1, twist: 0.3, photo: 0.6,
|
|
23
|
+
trunk: { length: 0.3, radius: 0.012, taper: 0.2, segments: 3, flex: 0.1 },
|
|
24
|
+
level: [{ count: 4, length: 1.6, radius: 0.6, downAngle: 40, downVar: 25, curve: 15, segments: 4, start: 0.6 }, { count: 4, length: 0.5, radius: 0.5, downAngle: 45, downVar: 30, curve: 10, segments: 3, start: 0.2 }],
|
|
25
|
+
leaves: { perLength: 20, size: 0.08, sizeVar: 0.3, spread: 0.8, lift: 0.2, fromLevel: 0, tuft: 2, start: 0.2 },
|
|
26
|
+
},
|
|
27
|
+
corn: {
|
|
28
|
+
kind: 'corn', perPlant: 1, pieceSize: 0.16, hang: false, onStalk: 0.5, leaf: 'blade', bark: '#7a9a4a', height: 1.3,
|
|
29
|
+
levels: 0, droop: 0, twist: 0.05, photo: 0,
|
|
30
|
+
trunk: { length: 1, radius: 0.016, taper: 0.5, segments: 8, flex: 0.15 },
|
|
31
|
+
level: [],
|
|
32
|
+
leaves: { perLength: 10, size: 0.22, sizeVar: 0.25, spread: 1.2, lift: 0.5, fromLevel: -1, tuft: 1, start: 0.1, faceUp: 0.3 },
|
|
33
|
+
},
|
|
34
|
+
lettuce: {
|
|
35
|
+
kind: null, perPlant: 0, leaf: 'round', bark: '#8aa868', height: 0.35,
|
|
36
|
+
levels: 1, droop: -0.3, twist: 0.2, photo: 0.8,
|
|
37
|
+
trunk: { length: 0.03, radius: 0.015, taper: 0, segments: 2, flex: 0.05 },
|
|
38
|
+
level: [{ count: 16, length: 8, radius: 0.4, downAngle: 55, downVar: 40, curve: -40, segments: 3, start: 0 }],
|
|
39
|
+
leaves: { perBranch: 1, size: 0.2, sizeVar: 0.2, spread: 0, lift: 0.6, fromLevel: 0, tuft: 1, start: 0.9, faceUp: 1 },
|
|
40
|
+
},
|
|
41
|
+
cabbage: {
|
|
42
|
+
kind: null, perPlant: 0, leaf: 'round', bark: '#8aa868', height: 0.4,
|
|
43
|
+
levels: 1, droop: -0.6, twist: 0.1, photo: 1.2,
|
|
44
|
+
trunk: { length: 0.03, radius: 0.015, taper: 0, segments: 2, flex: 0.05 },
|
|
45
|
+
level: [{ count: 22, length: 7, radius: 0.4, downAngle: 50, downVar: 45, curve: -70, segments: 3, start: 0 }],
|
|
46
|
+
leaves: { perBranch: 1, size: 0.2, sizeVar: 0.15, spread: 0, lift: 0.9, fromLevel: 0, tuft: 1, start: 0.85, faceUp: 1 },
|
|
47
|
+
},
|
|
48
|
+
pumpkin: {
|
|
49
|
+
kind: 'pumpkin', perPlant: 2, pieceSize: 0.28, hang: false, ground: true, leaf: 'lobed', bark: '#6a8a3a', height: 0.45,
|
|
50
|
+
levels: 1, droop: 1.6, twist: 0.4, photo: 0,
|
|
51
|
+
trunk: { length: 0.03, radius: 0.012, taper: 0, segments: 2, flex: 0.1 },
|
|
52
|
+
level: [{ count: 5, length: 40, radius: 0.6, downAngle: 80, downVar: 20, curve: 10, segments: 7, start: 0 }],
|
|
53
|
+
leaves: { perLength: 6, size: 0.22, sizeVar: 0.3, spread: 0.3, lift: 1.5, fromLevel: 0, tuft: 1, start: 0.1, faceUp: 1 },
|
|
54
|
+
},
|
|
55
|
+
strawberry: {
|
|
56
|
+
kind: 'strawberry', perPlant: 5, pieceSize: 0.07, hang: true, low: true, leaf: 'lobed', bark: '#5a7a3a', height: 0.3,
|
|
57
|
+
levels: 1, droop: 0.4, twist: 0.3, photo: 0.6,
|
|
58
|
+
trunk: { length: 0.03, radius: 0.01, taper: 0, segments: 2, flex: 0.1 },
|
|
59
|
+
level: [{ count: 12, length: 9, radius: 0.4, downAngle: 50, downVar: 40, curve: -20, segments: 3, start: 0 }],
|
|
60
|
+
leaves: { perBranch: 3, size: 0.12, sizeVar: 0.2, spread: 0.5, lift: 0.3, fromLevel: 0, tuft: 1, start: 0.7, faceUp: 0.8 },
|
|
61
|
+
},
|
|
62
|
+
eggplant: {
|
|
63
|
+
kind: 'eggplant', perPlant: 3, pieceSize: 0.16, hang: true, leaf: 'broadleaf', bark: '#5a6a4a', height: 0.8,
|
|
64
|
+
levels: 2, droop: 0.1, twist: 0.3, photo: 0.6,
|
|
65
|
+
trunk: { length: 0.3, radius: 0.012, taper: 0.2, segments: 3, flex: 0.1 },
|
|
66
|
+
level: [{ count: 4, length: 1.6, radius: 0.6, downAngle: 45, downVar: 25, curve: 15, segments: 4, start: 0.6 }, { count: 4, length: 0.5, radius: 0.5, downAngle: 45, downVar: 30, curve: 10, segments: 3, start: 0.2 }],
|
|
67
|
+
leaves: { perLength: 16, size: 0.11, sizeVar: 0.3, spread: 0.8, lift: 0.2, fromLevel: 0, tuft: 2, start: 0.2 }, leafColor: '#4f7a4a',
|
|
68
|
+
},
|
|
69
|
+
chili: {
|
|
70
|
+
kind: 'chili', perPlant: 9, pieceSize: 0.1, hang: true, leaf: 'lanceolate', bark: '#5a7a3a', height: 0.6,
|
|
71
|
+
levels: 2, droop: 0.1, twist: 0.3, photo: 0.6,
|
|
72
|
+
trunk: { length: 0.3, radius: 0.01, taper: 0.2, segments: 3, flex: 0.1 },
|
|
73
|
+
level: [{ count: 5, length: 1.4, radius: 0.6, downAngle: 40, downVar: 25, curve: 15, segments: 4, start: 0.6 }, { count: 4, length: 0.5, radius: 0.5, downAngle: 45, downVar: 30, curve: 10, segments: 3, start: 0.2 }],
|
|
74
|
+
leaves: { perLength: 24, size: 0.07, sizeVar: 0.3, spread: 0.8, lift: 0.2, fromLevel: 0, tuft: 2, start: 0.2 },
|
|
75
|
+
},
|
|
76
|
+
cucumber: {
|
|
77
|
+
kind: 'cucumber', perPlant: 4, pieceSize: 0.2, hang: true, leaf: 'lobed', bark: '#6a8a3a', height: 0.9,
|
|
78
|
+
levels: 2, droop: 0.3, twist: 0.4, photo: 0.5,
|
|
79
|
+
trunk: { length: 0.02, radius: 0.01, taper: 0, segments: 2, flex: 0.2 },
|
|
80
|
+
level: [{ count: 3, length: 45, radius: 0.8, downAngle: 20, downVar: 20, curve: 10, segments: 6, start: 0 }, { count: 6, length: 0.3, radius: 0.5, downAngle: 60, downVar: 30, curve: 10, segments: 3, start: 0.15 }],
|
|
81
|
+
leaves: { perLength: 14, size: 0.12, sizeVar: 0.3, spread: 0.8, lift: 0.1, fromLevel: 0, tuft: 2, start: 0.2 },
|
|
82
|
+
},
|
|
83
|
+
zucchini: {
|
|
84
|
+
kind: 'zucchini', perPlant: 3, pieceSize: 0.32, hang: false, ground: true, leaf: 'lobed', bark: '#6a8a3a', height: 0.55,
|
|
85
|
+
levels: 1, droop: -0.2, twist: 0.3, photo: 0.8,
|
|
86
|
+
trunk: { length: 0.03, radius: 0.015, taper: 0, segments: 2, flex: 0.05 },
|
|
87
|
+
level: [{ count: 14, length: 12, radius: 0.4, downAngle: 55, downVar: 35, curve: -30, segments: 3, start: 0 }],
|
|
88
|
+
leaves: { perBranch: 1, size: 0.2, sizeVar: 0.2, spread: 0, lift: 0.5, fromLevel: 0, tuft: 1, start: 0.9, faceUp: 1 },
|
|
89
|
+
},
|
|
90
|
+
watermelon: {
|
|
91
|
+
kind: 'watermelon', perPlant: 2, pieceSize: 0.45, hang: false, ground: true, leaf: 'lobed', bark: '#6a8a3a', height: 0.35,
|
|
92
|
+
levels: 1, droop: 1.6, twist: 0.4, photo: 0,
|
|
93
|
+
trunk: { length: 0.03, radius: 0.012, taper: 0, segments: 2, flex: 0.1 },
|
|
94
|
+
level: [{ count: 5, length: 40, radius: 0.6, downAngle: 80, downVar: 20, curve: 10, segments: 7, start: 0 }],
|
|
95
|
+
leaves: { perLength: 6, size: 0.18, sizeVar: 0.3, spread: 0.3, lift: 1.5, fromLevel: 0, tuft: 1, start: 0.1, faceUp: 1 },
|
|
96
|
+
},
|
|
97
|
+
cauliflower: {
|
|
98
|
+
kind: 'cauliflower', perPlant: 1, pieceSize: 0.3, hang: false, ground: true, leaf: 'round', bark: '#8aa868', height: 0.4,
|
|
99
|
+
levels: 1, droop: -0.3, twist: 0.2, photo: 0.8,
|
|
100
|
+
trunk: { length: 0.03, radius: 0.015, taper: 0, segments: 2, flex: 0.05 },
|
|
101
|
+
level: [{ count: 14, length: 8, radius: 0.4, downAngle: 55, downVar: 40, curve: -40, segments: 3, start: 0 }],
|
|
102
|
+
leaves: { perBranch: 1, size: 0.16, sizeVar: 0.2, spread: 0, lift: 0.6, fromLevel: 0, tuft: 1, start: 0.9, faceUp: 1 }, leafColor: '#7fa85a',
|
|
103
|
+
},
|
|
104
|
+
cabbageHead: {
|
|
105
|
+
kind: 'cabbage', perPlant: 1, pieceSize: 0.42, hang: false, ground: true, leaf: 'round', bark: '#8aa868', height: 0.35,
|
|
106
|
+
levels: 1, droop: -0.5, twist: 0.1, photo: 1.0,
|
|
107
|
+
trunk: { length: 0.03, radius: 0.015, taper: 0, segments: 2, flex: 0.05 },
|
|
108
|
+
level: [{ count: 12, length: 7, radius: 0.4, downAngle: 60, downVar: 40, curve: -50, segments: 3, start: 0 }],
|
|
109
|
+
leaves: { perBranch: 1, size: 0.15, sizeVar: 0.15, spread: 0, lift: 0.8, fromLevel: 0, tuft: 1, start: 0.85, faceUp: 1 }, leafColor: '#7fb05a',
|
|
110
|
+
},
|
|
111
|
+
onion: {
|
|
112
|
+
kind: 'onion', perPlant: 1, pieceSize: 0.14, hang: false, ground: true, leaf: 'blade', bark: '#7a9a4a', height: 0.6,
|
|
113
|
+
levels: 1, droop: 0.2, twist: 0.05, photo: 1,
|
|
114
|
+
trunk: { length: 0.02, radius: 0.01, taper: 0, segments: 2, flex: 0.2 },
|
|
115
|
+
level: [{ count: 9, length: 30, radius: 0.5, downAngle: 15, downVar: 15, curve: 12, segments: 5, start: 0 }],
|
|
116
|
+
leaves: { perLength: 3, size: 0.2, sizeVar: 0.2, spread: 0.2, lift: 0.8, fromLevel: 0, tuft: 1, start: 0.3, faceUp: 0.5 },
|
|
117
|
+
},
|
|
118
|
+
carrot: {
|
|
119
|
+
kind: null, perPlant: 0, leaf: 'frond', bark: '#7a9a4a', height: 0.4,
|
|
120
|
+
levels: 1, droop: 0.3, twist: 0.1, photo: 0.8,
|
|
121
|
+
trunk: { length: 0.02, radius: 0.01, taper: 0, segments: 2, flex: 0.15 },
|
|
122
|
+
level: [{ count: 12, length: 18, radius: 0.4, downAngle: 30, downVar: 30, curve: 10, segments: 4, start: 0 }],
|
|
123
|
+
leaves: { perBranch: 3, size: 0.12, sizeVar: 0.2, spread: 0.6, lift: 0.2, fromLevel: 0, tuft: 1, start: 0.5, faceUp: 0.8 },
|
|
124
|
+
},
|
|
125
|
+
potato: {
|
|
126
|
+
kind: null, perPlant: 0, leaf: 'broadleaf', bark: '#5a7a3a', height: 0.6,
|
|
127
|
+
levels: 2, droop: 0.2, twist: 0.3, photo: 0.6,
|
|
128
|
+
trunk: { length: 0.02, radius: 0.012, taper: 0, segments: 2, flex: 0.15 },
|
|
129
|
+
level: [{ count: 5, length: 30, radius: 0.7, downAngle: 30, downVar: 25, curve: 10, segments: 5, start: 0 }, { count: 6, length: 0.35, radius: 0.5, downAngle: 60, downVar: 30, curve: 10, segments: 3, start: 0.15 }],
|
|
130
|
+
leaves: { perLength: 16, size: 0.08, sizeVar: 0.3, spread: 0.8, lift: 0.1, fromLevel: 1, tuft: 2, start: 0.2 },
|
|
131
|
+
},
|
|
132
|
+
beans: {
|
|
133
|
+
kind: 'beans', perPlant: 8, pieceSize: 0.14, hang: true, leaf: 'heart', bark: '#5a8a3a', height: 1.4,
|
|
134
|
+
levels: 2, droop: 0.05, twist: 0.3, photo: 0.9,
|
|
135
|
+
trunk: { length: 1, radius: 0.008, taper: 0.3, segments: 8, flex: 0.2 },
|
|
136
|
+
level: [{ count: 10, length: 0.18, radius: 0.5, downAngle: 60, downVar: 30, curve: 10, segments: 3, start: 0.1 }, { count: 2, length: 0.5, radius: 0.5, downAngle: 40, downVar: 30, curve: 0, segments: 2, start: 0.3 }],
|
|
137
|
+
leaves: { perLength: 20, size: 0.1, sizeVar: 0.3, spread: 0.8, lift: 0.1, fromLevel: 0, tuft: 2, start: 0.1 },
|
|
138
|
+
},
|
|
139
|
+
peas: {
|
|
140
|
+
kind: 'peaPod', perPlant: 8, pieceSize: 0.1, hang: true, leaf: 'round', bark: '#5a8a3a', height: 1.0,
|
|
141
|
+
levels: 2, droop: 0.05, twist: 0.3, photo: 0.9,
|
|
142
|
+
trunk: { length: 1, radius: 0.006, taper: 0.3, segments: 8, flex: 0.25 },
|
|
143
|
+
level: [{ count: 12, length: 0.16, radius: 0.5, downAngle: 55, downVar: 30, curve: 10, segments: 3, start: 0.1 }, { count: 2, length: 0.5, radius: 0.5, downAngle: 40, downVar: 30, curve: 0, segments: 2, start: 0.3 }],
|
|
144
|
+
leaves: { perLength: 24, size: 0.06, sizeVar: 0.3, spread: 0.8, lift: 0.1, fromLevel: 0, tuft: 2, start: 0.1 },
|
|
145
|
+
},
|
|
146
|
+
wheat: {
|
|
147
|
+
kind: 'wheatHead', perPlant: 1, pieceSize: 0.1, hang: false, onStalk: 0.98, leaf: 'blade', bark: '#9ab860', height: 1.0,
|
|
148
|
+
levels: 0, droop: 0.05, twist: 0.05, photo: 0,
|
|
149
|
+
trunk: { length: 1, radius: 0.004, taper: 0.2, segments: 6, flex: 0.3 },
|
|
150
|
+
level: [],
|
|
151
|
+
leaves: { perLength: 4, size: 0.14, sizeVar: 0.3, spread: 1.2, lift: 0.6, fromLevel: -1, tuft: 1, start: 0.1, faceUp: 0.3 }, leafColor: '#a8b858', shade: '#6a7a3a', dense: 3,
|
|
152
|
+
},
|
|
153
|
+
sunflower: {
|
|
154
|
+
kind: 'sunflowerHead', perPlant: 1, pieceSize: 0.3, hang: false, onStalk: 0.99, tiltHead: 1.1, leaf: 'broadleaf', bark: '#6a8a3a', height: 1.5,
|
|
155
|
+
levels: 0, droop: 0.0, twist: 0.05, photo: 0,
|
|
156
|
+
trunk: { length: 1, radius: 0.012, taper: 0.3, segments: 8, flex: 0.1 },
|
|
157
|
+
level: [],
|
|
158
|
+
leaves: { perLength: 7, size: 0.09, sizeVar: 0.3, spread: 1.0, lift: 0.3, fromLevel: -1, tuft: 1, start: 0.15, faceUp: 0.6 },
|
|
159
|
+
},
|
|
160
|
+
vineyard: {
|
|
161
|
+
kind: 'grapes', perPlant: 5, pieceSize: 0.22, hang: true, leaf: 'maple', bark: '#5a4a3a', height: 1.1,
|
|
162
|
+
levels: 2, droop: 0.2, twist: 0.5, photo: 0.4,
|
|
163
|
+
trunk: { length: 0.45, radius: 0.03, taper: 0.2, curve: 5, segments: 4, flex: 0.03, splits: 2, splitAngle: 85, splitLength: 0.9, splitRadius: 0.6 },
|
|
164
|
+
level: [{ count: 1, length: 0.2, radius: 0.6, downAngle: 60, downVar: 30, curve: 0, segments: 2, start: 0.9 }, { count: 8, length: 0.9, radius: 0.5, downAngle: -40, downVar: 30, curve: -10, segments: 4, start: 0.1 }],
|
|
165
|
+
leaves: { perLength: 30, size: 0.1, sizeVar: 0.3, spread: 0.8, lift: 0.3, fromLevel: 1, tuft: 2, start: 0.1 }, leafColor: '#5f9a3a',
|
|
166
|
+
},
|
|
167
|
+
lavenderRows: {
|
|
168
|
+
kind: null, perPlant: 0, leaf: 'lanceolate', bark: '#8a8a70', height: 0.5,
|
|
169
|
+
levels: 1, droop: -0.05, twist: 0.3, photo: 1.0,
|
|
170
|
+
trunk: { length: 0.02, radius: 0.02, taper: 0, segments: 2, flex: 0.1 },
|
|
171
|
+
level: [{ count: 30, length: 25, radius: 0.35, downAngle: 40, downVar: 50, curve: -20, curveVar: 0.8, segments: 5, start: 0 }],
|
|
172
|
+
leaves: { perLength: 60, size: 0.035, sizeVar: 0.3, spread: 0.6, lift: 0.5, fromLevel: 0, tuft: 2, start: 0.1, faceUp: 0.5 }, leafColor: '#8aa07a', shade: '#3f4f36', blossom: { petals: 7, size: 0.025, color: '#9a7fd6', head: 1, cup: 0.6 },
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
export function createUniforms() { return createCommonUniforms(); }
|
|
176
|
+
export function applyConfig(u, c, mats) {
|
|
177
|
+
if (c.species !== undefined)
|
|
178
|
+
c = Object.assign({}, c, speciesColors(c));
|
|
179
|
+
applyCommonConfig(u, Object.assign({}, c, { leafType: undefined }));
|
|
180
|
+
if (c.species !== undefined)
|
|
181
|
+
u.uLeafType.value = Math.max(0, LEAF_TYPES.indexOf((SPECIES[c.species] || SPECIES.tomato).leaf));
|
|
182
|
+
if (!mats)
|
|
183
|
+
return;
|
|
184
|
+
if (mats.skin) {
|
|
185
|
+
const o = mats.skin.userData.uniforms;
|
|
186
|
+
if (c.ripeness !== undefined)
|
|
187
|
+
o.uRipeness.value = c.ripeness;
|
|
188
|
+
if (c.produce !== undefined)
|
|
189
|
+
mats.produceU.value = c.produce;
|
|
190
|
+
}
|
|
191
|
+
if (c.soilColor !== undefined && mats.soil)
|
|
192
|
+
mats.soil.color.set(c.soilColor);
|
|
193
|
+
}
|
|
194
|
+
export function speciesColors(c) {
|
|
195
|
+
const sp = SPECIES[c.species] || SPECIES.tomato;
|
|
196
|
+
const all = Object.values(SPECIES);
|
|
197
|
+
const out = Object.create(null); // only the keys set below override the config
|
|
198
|
+
if (!c.color || c.color.toLowerCase() === '#4f8f36' || all.some((s) => s['leafColor'] && s['leafColor'].toLowerCase() === c.color.toLowerCase()))
|
|
199
|
+
out.color = sp.leafColor || '#4f8f36';
|
|
200
|
+
if (!c.shadeColor || c.shadeColor.toLowerCase() === '#1f3f1a' || all.some((s) => s['shade'] && s['shade'].toLowerCase() === c.shadeColor.toLowerCase()))
|
|
201
|
+
out.shadeColor = sp.shade || '#1f3f1a';
|
|
202
|
+
return out;
|
|
203
|
+
}
|
|
204
|
+
export function build(u, c) {
|
|
205
|
+
const q = QUALITY_V[c.quality] || 1;
|
|
206
|
+
const sp = SPECIES[c.species] || SPECIES.tomato;
|
|
207
|
+
c = Object.assign({}, c, speciesColors(c));
|
|
208
|
+
const rnd = mulberry32((c.seed ?? 9) * 2654435761 + 77);
|
|
209
|
+
const rows = Math.max(1, Math.round(c.rows ?? 5)), spacing = Math.max(0.04, c.spacing ?? 0.12);
|
|
210
|
+
const perRow = Math.max(1, Math.floor(0.92 / spacing)) * (sp.dense || 1);
|
|
211
|
+
const rowGap = 1 / rows;
|
|
212
|
+
// the plant scale: it fills its row width and its share of the row, and the box height
|
|
213
|
+
const sxz = Math.min(rowGap, spacing) * 1.3, sy = Math.min(1, sp.height);
|
|
214
|
+
const plants = [];
|
|
215
|
+
const branchesAll = [], leavesAll = [], pieces = [];
|
|
216
|
+
for (let r = 0; r < rows; r++)
|
|
217
|
+
for (let i = 0; i < perRow; i++) {
|
|
218
|
+
const root = new THREE.Vector3(-0.5 + rowGap * (r + 0.5) + (rnd() - 0.5) * rowGap * 0.1, 0, -0.46 + 0.92 * (i + 0.5) / perRow + (rnd() - 0.5) * spacing * 0.3);
|
|
219
|
+
const P = Object.assign({}, sp, { leaves: Object.assign({}, sp.leaves) });
|
|
220
|
+
const plant = generatePlant(P, rnd);
|
|
221
|
+
// fit this plant: unit height → sy, width → sxz; move to its root
|
|
222
|
+
let maxY = 1e-6, maxR = 1e-6;
|
|
223
|
+
for (const b of plant.branches)
|
|
224
|
+
for (const p of b.pts) {
|
|
225
|
+
maxY = Math.max(maxY, p.y);
|
|
226
|
+
maxR = Math.max(maxR, Math.hypot(p.x, p.z));
|
|
227
|
+
}
|
|
228
|
+
for (const l of plant.leaves) {
|
|
229
|
+
maxY = Math.max(maxY, l.pos.y + l.size * 0.5);
|
|
230
|
+
maxR = Math.max(maxR, Math.hypot(l.pos.x, l.pos.z) + l.size * 0.5);
|
|
231
|
+
}
|
|
232
|
+
const S = new THREE.Vector3(Math.min(sxz / (2 * maxR), sy / maxY * 1.2), sy / maxY, Math.min(sxz / (2 * maxR), sy / maxY * 1.2));
|
|
233
|
+
const sr = Math.sqrt(S.x * S.y);
|
|
234
|
+
const yaw = rnd() * Math.PI * 2, cy = Math.cos(yaw), sy2 = Math.sin(yaw);
|
|
235
|
+
const place = (p) => { p.multiply(S); const x = p.x * cy - p.z * sy2, z = p.x * sy2 + p.z * cy; p.set(x, Math.max(p.y, 0.003), z).add(root); return p; };
|
|
236
|
+
const rot = (v) => { v.multiply(S); const x = v.x * cy - v.z * sy2, z = v.x * sy2 + v.z * cy; v.set(x, v.y, z).normalize(); return v; };
|
|
237
|
+
for (const b of plant.branches) {
|
|
238
|
+
for (const p of b.pts)
|
|
239
|
+
place(p);
|
|
240
|
+
for (let k = 0; k < b.radii.length; k++)
|
|
241
|
+
b.radii[k] *= sr;
|
|
242
|
+
b.root = root;
|
|
243
|
+
b.hf0 = Math.min(1, b.pts[0].y);
|
|
244
|
+
branchesAll.push(b);
|
|
245
|
+
}
|
|
246
|
+
for (const l of plant.leaves) {
|
|
247
|
+
place(l.pos);
|
|
248
|
+
rot(l.along);
|
|
249
|
+
rot(l.normal);
|
|
250
|
+
l.size *= sr;
|
|
251
|
+
l.hf = Math.min(1, l.pos.y);
|
|
252
|
+
l.root = root;
|
|
253
|
+
l.grow = 0;
|
|
254
|
+
leavesAll.push(l);
|
|
255
|
+
}
|
|
256
|
+
// produce on the plant
|
|
257
|
+
if (sp.kind && sp.perPlant > 0) {
|
|
258
|
+
const n = sp.perPlant;
|
|
259
|
+
for (let k = 0; k < n; k++) {
|
|
260
|
+
let at;
|
|
261
|
+
if (sp.ground) {
|
|
262
|
+
const b = plant.branches[Math.floor(rnd() * plant.branches.length)];
|
|
263
|
+
const p = b.pts[Math.floor(rnd() * b.pts.length)];
|
|
264
|
+
at = new THREE.Vector3(p.x + (rnd() - 0.5) * sxz * 0.3, 0, p.z + (rnd() - 0.5) * sxz * 0.3);
|
|
265
|
+
}
|
|
266
|
+
else if (sp.onStalk !== undefined) {
|
|
267
|
+
const b = plant.branches[0];
|
|
268
|
+
const p = b.pts[Math.min(b.pts.length - 1, Math.max(0, Math.floor(b.pts.length * (sp.onStalk + 0.15 * (rnd() - 0.5)))))];
|
|
269
|
+
at = p.clone();
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
const l = plant.leaves[Math.floor(rnd() * plant.leaves.length)];
|
|
273
|
+
at = l.pos.clone().add(new THREE.Vector3(0, sp.low ? -0.01 : -0.02, 0));
|
|
274
|
+
if (sp.low)
|
|
275
|
+
at.y = Math.min(at.y, 0.03);
|
|
276
|
+
}
|
|
277
|
+
pieces.push({ at, root, hf: Math.min(1, at.y), hash: rnd(), yaw: rnd() * Math.PI * 2, scale: sp.pieceSize * sr * 1.6 * (0.8 + 0.4 * rnd()), tilt: sp.hang ? Math.PI + (rnd() - 0.5) * 0.6 : (sp.onStalk !== undefined ? -(sp.tiltHead || 0.4) : (rnd() - 0.5) * 0.3) });
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
plants.push(root);
|
|
281
|
+
}
|
|
282
|
+
// canopy depth per plant is not meaningful: outer leaves everywhere
|
|
283
|
+
for (const l of leavesAll) {
|
|
284
|
+
l.ao = 0.6 + 0.4 * rnd();
|
|
285
|
+
l.order = rnd();
|
|
286
|
+
}
|
|
287
|
+
const barkPair = barkMaterial(u, { barkColor: sp.bark, ridges: 0.3 });
|
|
288
|
+
const leafPair = leafMaterial(u, { translucency: 0.55, veins: 0.6 });
|
|
289
|
+
const barkGeo = branchGeometry(branchesAll, { sides: [5, 5, 4, 3] });
|
|
290
|
+
unitBounds(barkGeo);
|
|
291
|
+
const leafGeo = leafGeometry(Math.max(1, leavesAll.length));
|
|
292
|
+
fillLeaves(leafGeo, leavesAll);
|
|
293
|
+
unitBounds(leafGeo);
|
|
294
|
+
const object = new THREE.Group();
|
|
295
|
+
object.name = 'crops';
|
|
296
|
+
object.add(plantMesh(barkGeo, barkPair, 'stems'), plantMesh(leafGeo, leafPair, 'leaves'));
|
|
297
|
+
const mats = { skin: null, produceU: null, soil: null };
|
|
298
|
+
const disposables = [barkGeo, leafGeo], pairs = [barkPair, leafPair];
|
|
299
|
+
if (sp.blossom) {
|
|
300
|
+
const tips = branchesAll.filter((b) => b.level >= 0);
|
|
301
|
+
const heads = flowerHeads(u, tips, rnd, sp.blossom, Math.round(2000 * q));
|
|
302
|
+
object.add(plantMesh(heads.geo, heads.pair, 'flowers'));
|
|
303
|
+
disposables.push(heads.geo);
|
|
304
|
+
pairs.push(heads.pair);
|
|
305
|
+
}
|
|
306
|
+
if (pieces.length) {
|
|
307
|
+
const piece = buildPiece(sp.kind, c.seed ?? 9, 0.9);
|
|
308
|
+
const ext = Math.max(piece.height, piece.width);
|
|
309
|
+
piece.geo.scale(1 / ext, 1 / ext, 1 / ext);
|
|
310
|
+
const pg = instancePieces(piece.geo, pieces.length);
|
|
311
|
+
pieces.forEach((p, i) => {
|
|
312
|
+
pg.attributes.aXf.setXYZW(i, p.at.x, p.at.y, p.at.z, p.yaw);
|
|
313
|
+
pg.attributes.aTilt.setXYZW(i, 1, 0, p.tilt, p.scale);
|
|
314
|
+
pg.attributes.aPiece.setXYZW(i, p.hash, i / pieces.length, rnd(), 1);
|
|
315
|
+
pg.attributes.aRoot.setXYZ(i, p.root.x, p.root.y, p.root.z);
|
|
316
|
+
});
|
|
317
|
+
unitBounds(pg);
|
|
318
|
+
const skinPair = produceMaterial(u);
|
|
319
|
+
const o = skinPair.material.userData.uniforms, PR = PRODUCE[sp.kind];
|
|
320
|
+
applyKind(skinPair.material, PR);
|
|
321
|
+
o.uGloss.value = PR.gloss;
|
|
322
|
+
o.uCount.value = 1;
|
|
323
|
+
o.uSizeVar.value = 0;
|
|
324
|
+
o.uPieceH.value = 1;
|
|
325
|
+
// the produce knob hides a share of the pieces: the material reads it as the squeeze-free "count" gate via uFoliage-like order
|
|
326
|
+
mats.produceU = { value: c.produce ?? 1 };
|
|
327
|
+
skinPair.material.onBeforeCompile = ((orig) => (shader, renderer) => { orig(shader, renderer); shader.uniforms.uProduce = mats.produceU; shader.vertexShader = shader.vertexShader.replace('uniform float uRipeness, uCount, uSizeVar, uPieceH;', 'uniform float uRipeness, uCount, uSizeVar, uPieceH, uProduce;').replace('float sc = aTilt.w * (1.0 + uSizeVar * (aPiece.x - 0.5));', 'float sc = aTilt.w * (1.0 + uSizeVar * (aPiece.x - 0.5)) * step(aPiece.y, uProduce);'); })(skinPair.material.onBeforeCompile);
|
|
328
|
+
skinPair.material.customProgramCacheKey = () => 'veg-produce-crop';
|
|
329
|
+
skinPair.depth.onBeforeCompile = ((orig) => (shader, renderer) => { orig(shader, renderer); shader.uniforms.uProduce = mats.produceU; shader.vertexShader = shader.vertexShader.replace('uniform float uRipeness, uCount, uSizeVar, uPieceH;', 'uniform float uRipeness, uCount, uSizeVar, uPieceH, uProduce;').replace('float sc = aTilt.w * (1.0 + uSizeVar * (aPiece.x - 0.5));', 'float sc = aTilt.w * (1.0 + uSizeVar * (aPiece.x - 0.5)) * step(aPiece.y, uProduce);'); })(skinPair.depth.onBeforeCompile);
|
|
330
|
+
skinPair.depth.customProgramCacheKey = () => 'veg-produce-crop-depth';
|
|
331
|
+
mats.skin = skinPair.material;
|
|
332
|
+
object.add(plantMesh(pg, skinPair, 'produce'));
|
|
333
|
+
disposables.push(pg, piece.geo);
|
|
334
|
+
pairs.push(skinPair);
|
|
335
|
+
}
|
|
336
|
+
if (c.soil !== false) {
|
|
337
|
+
// ridged soil: a plane with a cosine ridge under each row, dark earth with clods
|
|
338
|
+
const g = new THREE.PlaneGeometry(1, 1, 96, 24);
|
|
339
|
+
g.rotateX(-Math.PI / 2);
|
|
340
|
+
const pa = g.attributes.position;
|
|
341
|
+
for (let i = 0; i < pa.count; i++) {
|
|
342
|
+
const x = pa.getX(i), z = pa.getZ(i);
|
|
343
|
+
const ridge = 0.5 + 0.5 * Math.cos((x + 0.5) * rows * Math.PI * 2 - Math.PI);
|
|
344
|
+
pa.setY(i, 0.012 * ridge + 0.003 * Math.sin(x * 90 + z * 70) + 0.0005);
|
|
345
|
+
}
|
|
346
|
+
g.computeVertexNormals();
|
|
347
|
+
const soilMat = new THREE.MeshStandardMaterial({ color: c.soilColor || '#5a4532', roughness: 1 });
|
|
348
|
+
soilMat.defines = { USE_UV: '' };
|
|
349
|
+
soilMat.onBeforeCompile = (shader) => {
|
|
350
|
+
shader.fragmentShader = shader.fragmentShader.replace('#include <common>', `#include <common>\n${NOISE_GLSL_V}`).replace('#include <map_fragment>', `
|
|
351
|
+
vec2 sq = vUv * 40.0;
|
|
352
|
+
diffuseColor.rgb *= 0.75 + 0.5 * fbm2v(sq) * (0.6 + 0.6 * vnoise2v(sq * 4.0));`);
|
|
353
|
+
};
|
|
354
|
+
soilMat.customProgramCacheKey = () => 'veg-soil';
|
|
355
|
+
const soil = new THREE.Mesh(g, soilMat);
|
|
356
|
+
soil.receiveShadow = true;
|
|
357
|
+
soil.raycast = function () { };
|
|
358
|
+
object.add(soil);
|
|
359
|
+
mats.soil = soilMat;
|
|
360
|
+
disposables.push(g);
|
|
361
|
+
}
|
|
362
|
+
applyConfig(u, c, mats);
|
|
363
|
+
return {
|
|
364
|
+
object,
|
|
365
|
+
materials: pairs.map((p) => p.material),
|
|
366
|
+
apply: function (cfg) { applyConfig(u, cfg, mats); },
|
|
367
|
+
update: function (dt, camera, sunWorld) { updateCommon(u, object, camera, dt, sunWorld); },
|
|
368
|
+
stats: { plants: plants.length, leaves: leavesAll.length, produce: pieces.length },
|
|
369
|
+
dispose: function () { for (const g of disposables)
|
|
370
|
+
g.dispose(); for (const p of pairs) {
|
|
371
|
+
p.material.dispose();
|
|
372
|
+
p.depth.dispose();
|
|
373
|
+
} if (mats.soil)
|
|
374
|
+
mats.soil.dispose(); },
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
/** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
|
|
378
|
+
export const STRUCTURAL = ['species', 'rows', 'spacing', 'soil', 'quality', 'seed'];
|