@3driseai/3drise-viewer 0.1.42 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animationsV2/ClipsRuntime.d.ts +16 -1
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +144 -25
- package/dist/animationsV2/appliers.d.ts +9 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +62 -2
- package/dist/animationsV2/clipUtils.d.ts +30 -0
- package/dist/animationsV2/clipUtils.d.ts.map +1 -1
- package/dist/animationsV2/clipUtils.js +163 -17
- package/dist/animationsV2/elementSettings.d.ts +5 -0
- package/dist/animationsV2/elementSettings.d.ts.map +1 -1
- package/dist/animationsV2/elementSettings.js +6 -3
- package/dist/animationsV2/sequenceUtils.js +4 -4
- package/dist/animationsV2/types.d.ts +23 -0
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +2 -2
- package/dist/components/CreatedObject.d.ts +3 -0
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +6 -2
- package/dist/components/CustomPrimitive.d.ts.map +1 -1
- package/dist/components/CustomPrimitive.js +1 -10
- package/dist/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/EnvironmentManager.js +11 -5
- package/dist/components/GeometryShape.d.ts +5 -2
- package/dist/components/GeometryShape.d.ts.map +1 -1
- package/dist/components/GeometryShape.js +71 -10
- package/dist/components/LandObject.d.ts.map +1 -1
- package/dist/components/LandObject.js +1 -1
- package/dist/components/LayoutInstances.d.ts +2 -1
- package/dist/components/LayoutInstances.d.ts.map +1 -1
- package/dist/components/LayoutInstances.js +39 -6
- package/dist/components/LightObject.d.ts.map +1 -1
- package/dist/components/LightObject.js +3 -0
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +62 -13
- package/dist/components/OceanBuilder.d.ts +2 -0
- package/dist/components/OceanBuilder.d.ts.map +1 -1
- package/dist/components/OceanBuilder.js +2 -1
- package/dist/components/RenderEffects.d.ts +8 -0
- package/dist/components/RenderEffects.d.ts.map +1 -0
- package/dist/components/RenderEffects.js +120 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +18 -9
- package/dist/components/SportsObject.d.ts +9 -0
- package/dist/components/SportsObject.d.ts.map +1 -0
- package/dist/components/SportsObject.js +20 -0
- package/dist/components/UrbanObject.d.ts +9 -0
- package/dist/components/UrbanObject.d.ts.map +1 -0
- package/dist/components/UrbanObject.js +28 -0
- package/dist/components/VegetationObject.d.ts +9 -0
- package/dist/components/VegetationObject.d.ts.map +1 -0
- package/dist/components/VegetationObject.js +26 -0
- package/dist/components/WaterObject.d.ts +15 -0
- package/dist/components/WaterObject.d.ts.map +1 -0
- package/dist/components/WaterObject.js +29 -0
- package/dist/components/index.d.ts +7 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +6 -1
- package/dist/components/land/LandPatch.d.ts +3 -1
- package/dist/components/land/LandPatch.d.ts.map +1 -1
- package/dist/components/land/LandPatch.js +80 -7
- package/dist/components/layout/InstancedLayout.d.ts +19 -0
- package/dist/components/layout/InstancedLayout.d.ts.map +1 -0
- package/dist/components/layout/InstancedLayout.js +154 -0
- package/dist/components/layout/LayoutGrounds.d.ts +19 -0
- package/dist/components/layout/LayoutGrounds.d.ts.map +1 -0
- package/dist/components/layout/LayoutGrounds.js +104 -0
- package/dist/components/layout/LinkProxies.d.ts +5 -0
- package/dist/components/layout/LinkProxies.d.ts.map +1 -0
- package/dist/components/layout/LinkProxies.js +51 -0
- package/dist/components/layout/LinkedSource.d.ts +14 -0
- package/dist/components/layout/LinkedSource.d.ts.map +1 -0
- package/dist/components/layout/LinkedSource.js +129 -0
- package/dist/components/projector/Projector.d.ts +14 -0
- package/dist/components/projector/Projector.d.ts.map +1 -0
- package/dist/components/projector/Projector.js +44 -0
- package/dist/components/projector/index.d.ts +4 -0
- package/dist/components/projector/index.d.ts.map +1 -0
- package/dist/components/projector/index.js +2 -0
- package/dist/components/projector/projectorCore.d.ts +19 -0
- package/dist/components/projector/projectorCore.d.ts.map +1 -0
- package/dist/components/projector/projectorCore.js +545 -0
- package/dist/components/sports/SportsBall.d.ts +9 -0
- package/dist/components/sports/SportsBall.d.ts.map +1 -0
- package/dist/components/sports/SportsBall.js +23 -0
- package/dist/components/sports/SportsCourt.d.ts +9 -0
- package/dist/components/sports/SportsCourt.d.ts.map +1 -0
- package/dist/components/sports/SportsCourt.js +23 -0
- package/dist/components/sports/SportsEquipment.d.ts +9 -0
- package/dist/components/sports/SportsEquipment.d.ts.map +1 -0
- package/dist/components/sports/SportsEquipment.js +23 -0
- package/dist/components/sports/SportsGoal.d.ts +9 -0
- package/dist/components/sports/SportsGoal.d.ts.map +1 -0
- package/dist/components/sports/SportsGoal.js +23 -0
- package/dist/components/sports/core/ball.d.ts +166 -0
- package/dist/components/sports/core/ball.d.ts.map +1 -0
- package/dist/components/sports/core/ball.js +402 -0
- package/dist/components/sports/core/court.d.ts +442 -0
- package/dist/components/sports/core/court.d.ts.map +1 -0
- package/dist/components/sports/core/court.js +658 -0
- package/dist/components/sports/core/equipment.d.ts +103 -0
- package/dist/components/sports/core/equipment.d.ts.map +1 -0
- package/dist/components/sports/core/equipment.js +403 -0
- package/dist/components/sports/core/goal.d.ts +98 -0
- package/dist/components/sports/core/goal.d.ts.map +1 -0
- package/dist/components/sports/core/goal.js +44 -0
- package/dist/components/sports/index.d.ts +11 -0
- package/dist/components/sports/index.d.ts.map +1 -0
- package/dist/components/sports/index.js +8 -0
- package/dist/components/sports/sportsCore.d.ts +195 -0
- package/dist/components/sports/sportsCore.d.ts.map +1 -0
- package/dist/components/sports/sportsCore.js +758 -0
- package/dist/components/sports/useSportsInstance.d.ts +35 -0
- package/dist/components/sports/useSportsInstance.d.ts.map +1 -0
- package/dist/components/sports/useSportsInstance.js +47 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +14 -0
- package/dist/components/urban/UrbanBlock.d.ts +9 -0
- package/dist/components/urban/UrbanBlock.d.ts.map +1 -0
- package/dist/components/urban/UrbanBlock.js +23 -0
- package/dist/components/urban/UrbanBuilding.d.ts +9 -0
- package/dist/components/urban/UrbanBuilding.d.ts.map +1 -0
- package/dist/components/urban/UrbanBuilding.js +23 -0
- package/dist/components/urban/UrbanJunction.d.ts +9 -0
- package/dist/components/urban/UrbanJunction.d.ts.map +1 -0
- package/dist/components/urban/UrbanJunction.js +23 -0
- package/dist/components/urban/UrbanPark.d.ts +9 -0
- package/dist/components/urban/UrbanPark.d.ts.map +1 -0
- package/dist/components/urban/UrbanPark.js +23 -0
- package/dist/components/urban/UrbanParkingLot.d.ts +9 -0
- package/dist/components/urban/UrbanParkingLot.d.ts.map +1 -0
- package/dist/components/urban/UrbanParkingLot.js +23 -0
- package/dist/components/urban/UrbanPlaza.d.ts +9 -0
- package/dist/components/urban/UrbanPlaza.d.ts.map +1 -0
- package/dist/components/urban/UrbanPlaza.js +23 -0
- package/dist/components/urban/UrbanRoad.d.ts +9 -0
- package/dist/components/urban/UrbanRoad.d.ts.map +1 -0
- package/dist/components/urban/UrbanRoad.js +23 -0
- package/dist/components/urban/UrbanSignage.d.ts +9 -0
- package/dist/components/urban/UrbanSignage.d.ts.map +1 -0
- package/dist/components/urban/UrbanSignage.js +23 -0
- package/dist/components/urban/UrbanSkyline.d.ts +9 -0
- package/dist/components/urban/UrbanSkyline.d.ts.map +1 -0
- package/dist/components/urban/UrbanSkyline.js +23 -0
- package/dist/components/urban/UrbanStreetFurniture.d.ts +9 -0
- package/dist/components/urban/UrbanStreetFurniture.d.ts.map +1 -0
- package/dist/components/urban/UrbanStreetFurniture.js +23 -0
- package/dist/components/urban/UrbanStreetGrid.d.ts +9 -0
- package/dist/components/urban/UrbanStreetGrid.d.ts.map +1 -0
- package/dist/components/urban/UrbanStreetGrid.js +34 -0
- package/dist/components/urban/UrbanTraffic.d.ts +9 -0
- package/dist/components/urban/UrbanTraffic.d.ts.map +1 -0
- package/dist/components/urban/UrbanTraffic.js +23 -0
- package/dist/components/urban/core/block.d.ts +119 -0
- package/dist/components/urban/core/block.d.ts.map +1 -0
- package/dist/components/urban/core/block.js +266 -0
- package/dist/components/urban/core/building.d.ts +128 -0
- package/dist/components/urban/core/building.d.ts.map +1 -0
- package/dist/components/urban/core/building.js +741 -0
- package/dist/components/urban/core/junction.d.ts +152 -0
- package/dist/components/urban/core/junction.d.ts.map +1 -0
- package/dist/components/urban/core/junction.js +617 -0
- package/dist/components/urban/core/park.d.ts +67 -0
- package/dist/components/urban/core/park.d.ts.map +1 -0
- package/dist/components/urban/core/park.js +176 -0
- package/dist/components/urban/core/parkingLot.d.ts +82 -0
- package/dist/components/urban/core/parkingLot.d.ts.map +1 -0
- package/dist/components/urban/core/parkingLot.js +284 -0
- package/dist/components/urban/core/plaza.d.ts +24 -0
- package/dist/components/urban/core/plaza.d.ts.map +1 -0
- package/dist/components/urban/core/plaza.js +243 -0
- package/dist/components/urban/core/road.d.ts +113 -0
- package/dist/components/urban/core/road.d.ts.map +1 -0
- package/dist/components/urban/core/road.js +347 -0
- package/dist/components/urban/core/signage.d.ts +83 -0
- package/dist/components/urban/core/signage.d.ts.map +1 -0
- package/dist/components/urban/core/signage.js +209 -0
- package/dist/components/urban/core/skyline.d.ts +100 -0
- package/dist/components/urban/core/skyline.d.ts.map +1 -0
- package/dist/components/urban/core/skyline.js +89 -0
- package/dist/components/urban/core/streetFurniture.d.ts +75 -0
- package/dist/components/urban/core/streetFurniture.d.ts.map +1 -0
- package/dist/components/urban/core/streetFurniture.js +193 -0
- package/dist/components/urban/core/streetGrid.d.ts +134 -0
- package/dist/components/urban/core/streetGrid.d.ts.map +1 -0
- package/dist/components/urban/core/streetGrid.js +422 -0
- package/dist/components/urban/core/traffic.d.ts +125 -0
- package/dist/components/urban/core/traffic.d.ts.map +1 -0
- package/dist/components/urban/core/traffic.js +305 -0
- package/dist/components/urban/index.d.ts +29 -0
- package/dist/components/urban/index.d.ts.map +1 -0
- package/dist/components/urban/index.js +16 -0
- package/dist/components/urban/textureSetResolver.d.ts +8 -0
- package/dist/components/urban/textureSetResolver.d.ts.map +1 -0
- package/dist/components/urban/textureSetResolver.js +16 -0
- package/dist/components/urban/urbanCore.d.ts +262 -0
- package/dist/components/urban/urbanCore.d.ts.map +1 -0
- package/dist/components/urban/urbanCore.js +928 -0
- package/dist/components/urban/useUrbanInstance.d.ts +53 -0
- package/dist/components/urban/useUrbanInstance.d.ts.map +1 -0
- package/dist/components/urban/useUrbanInstance.js +100 -0
- package/dist/components/vegetation/VegetationBush.d.ts +9 -0
- package/dist/components/vegetation/VegetationBush.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationBush.js +23 -0
- package/dist/components/vegetation/VegetationCrops.d.ts +9 -0
- package/dist/components/vegetation/VegetationCrops.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationCrops.js +23 -0
- package/dist/components/vegetation/VegetationFlowers.d.ts +9 -0
- package/dist/components/vegetation/VegetationFlowers.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationFlowers.js +23 -0
- package/dist/components/vegetation/VegetationForest.d.ts +9 -0
- package/dist/components/vegetation/VegetationForest.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationForest.js +23 -0
- package/dist/components/vegetation/VegetationFruit.d.ts +9 -0
- package/dist/components/vegetation/VegetationFruit.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationFruit.js +23 -0
- package/dist/components/vegetation/VegetationGrass.d.ts +9 -0
- package/dist/components/vegetation/VegetationGrass.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationGrass.js +23 -0
- package/dist/components/vegetation/VegetationHedge.d.ts +9 -0
- package/dist/components/vegetation/VegetationHedge.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationHedge.js +23 -0
- package/dist/components/vegetation/VegetationIvy.d.ts +9 -0
- package/dist/components/vegetation/VegetationIvy.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationIvy.js +23 -0
- package/dist/components/vegetation/VegetationTree.d.ts +9 -0
- package/dist/components/vegetation/VegetationTree.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationTree.js +23 -0
- package/dist/components/vegetation/VegetationVegetable.d.ts +9 -0
- package/dist/components/vegetation/VegetationVegetable.d.ts.map +1 -0
- package/dist/components/vegetation/VegetationVegetable.js +23 -0
- package/dist/components/vegetation/core/bush.d.ts +1256 -0
- package/dist/components/vegetation/core/bush.d.ts.map +1 -0
- package/dist/components/vegetation/core/bush.js +376 -0
- package/dist/components/vegetation/core/crops.d.ts +1033 -0
- package/dist/components/vegetation/core/crops.d.ts.map +1 -0
- package/dist/components/vegetation/core/crops.js +378 -0
- package/dist/components/vegetation/core/flowers.d.ts +648 -0
- package/dist/components/vegetation/core/flowers.d.ts.map +1 -0
- package/dist/components/vegetation/core/flowers.js +225 -0
- package/dist/components/vegetation/core/forest.d.ts +138 -0
- package/dist/components/vegetation/core/forest.d.ts.map +1 -0
- package/dist/components/vegetation/core/forest.js +310 -0
- package/dist/components/vegetation/core/fruit.d.ts +99 -0
- package/dist/components/vegetation/core/fruit.d.ts.map +1 -0
- package/dist/components/vegetation/core/fruit.js +77 -0
- package/dist/components/vegetation/core/grass.d.ts +103 -0
- package/dist/components/vegetation/core/grass.d.ts.map +1 -0
- package/dist/components/vegetation/core/grass.js +102 -0
- package/dist/components/vegetation/core/hedge.d.ts +193 -0
- package/dist/components/vegetation/core/hedge.d.ts.map +1 -0
- package/dist/components/vegetation/core/hedge.js +243 -0
- package/dist/components/vegetation/core/ivy.d.ts +213 -0
- package/dist/components/vegetation/core/ivy.d.ts.map +1 -0
- package/dist/components/vegetation/core/ivy.js +173 -0
- package/dist/components/vegetation/core/tree.d.ts +1117 -0
- package/dist/components/vegetation/core/tree.d.ts.map +1 -0
- package/dist/components/vegetation/core/tree.js +408 -0
- package/dist/components/vegetation/core/vegetable.d.ts +99 -0
- package/dist/components/vegetation/core/vegetable.d.ts.map +1 -0
- package/dist/components/vegetation/core/vegetable.js +76 -0
- package/dist/components/vegetation/index.d.ts +23 -0
- package/dist/components/vegetation/index.d.ts.map +1 -0
- package/dist/components/vegetation/index.js +14 -0
- package/dist/components/vegetation/produceCore.d.ts +929 -0
- package/dist/components/vegetation/produceCore.d.ts.map +1 -0
- package/dist/components/vegetation/produceCore.js +723 -0
- package/dist/components/vegetation/useVegetationInstance.d.ts +39 -0
- package/dist/components/vegetation/useVegetationInstance.d.ts.map +1 -0
- package/dist/components/vegetation/useVegetationInstance.js +45 -0
- package/dist/components/vegetation/vegetationCore.d.ts +412 -0
- package/dist/components/vegetation/vegetationCore.d.ts.map +1 -0
- package/dist/components/vegetation/vegetationCore.js +1728 -0
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +5 -0
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.js +39 -13
- package/dist/components/water/OceanSurface.d.ts.map +1 -1
- package/dist/components/water/OceanSurface.js +3 -2
- package/dist/components/water/WaterBody.d.ts.map +1 -1
- package/dist/components/water/WaterBody.js +31 -10
- package/dist/components/water/WaterFountain.d.ts +9 -0
- package/dist/components/water/WaterFountain.d.ts.map +1 -0
- package/dist/components/water/WaterFountain.js +24 -0
- package/dist/components/water/WaterStream.d.ts +9 -0
- package/dist/components/water/WaterStream.d.ts.map +1 -0
- package/dist/components/water/WaterStream.js +24 -0
- package/dist/components/water/WaterWaterfall.d.ts +9 -0
- package/dist/components/water/WaterWaterfall.d.ts.map +1 -0
- package/dist/components/water/WaterWaterfall.js +24 -0
- package/dist/components/water/core/fountain.d.ts +70 -0
- package/dist/components/water/core/fountain.d.ts.map +1 -0
- package/dist/components/water/core/fountain.js +619 -0
- package/dist/components/water/core/stream.d.ts +72 -0
- package/dist/components/water/core/stream.d.ts.map +1 -0
- package/dist/components/water/core/stream.js +167 -0
- package/dist/components/water/core/waterfall.d.ts +78 -0
- package/dist/components/water/core/waterfall.d.ts.map +1 -0
- package/dist/components/water/core/waterfall.js +325 -0
- package/dist/components/water/index.d.ts +8 -0
- package/dist/components/water/index.d.ts.map +1 -1
- package/dist/components/water/index.js +7 -0
- package/dist/components/water/types.d.ts +3 -0
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/components/water/useWaterInstance.d.ts +43 -0
- package/dist/components/water/useWaterInstance.d.ts.map +1 -0
- package/dist/components/water/useWaterInstance.js +89 -0
- package/dist/components/water/waterCore.d.ts +179 -0
- package/dist/components/water/waterCore.d.ts.map +1 -0
- package/dist/components/water/waterCore.js +516 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +9 -1
- package/dist/hooks/index.d.ts +7 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +5 -2
- package/dist/hooks/useActionPatch.d.ts +23 -0
- package/dist/hooks/useActionPatch.d.ts.map +1 -0
- package/dist/hooks/useActionPatch.js +38 -0
- package/dist/hooks/useCloudSun.d.ts.map +1 -1
- package/dist/hooks/useCloudSun.js +3 -2
- package/dist/hooks/useCommittedInstance.d.ts +6 -0
- package/dist/hooks/useCommittedInstance.d.ts.map +1 -0
- package/dist/hooks/useCommittedInstance.js +42 -0
- package/dist/hooks/useConfigLive.d.ts +1 -1
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
- package/dist/hooks/useContinuousEffects.js +36 -20
- package/dist/hooks/useGridLayout.d.ts +7 -0
- package/dist/hooks/useGridLayout.d.ts.map +1 -0
- package/dist/hooks/useGridLayout.js +10 -0
- package/dist/hooks/useInteractionEffects.d.ts.map +1 -1
- package/dist/hooks/useInteractionEffects.js +48 -9
- package/dist/hooks/useLightLive.d.ts.map +1 -1
- package/dist/hooks/useLightLive.js +2 -0
- package/dist/hooks/useLinkStatus.d.ts +7 -0
- package/dist/hooks/useLinkStatus.d.ts.map +1 -0
- package/dist/hooks/useLinkStatus.js +20 -0
- package/dist/hooks/useMaterialApplication.d.ts +6 -1
- package/dist/hooks/useMaterialApplication.d.ts.map +1 -1
- package/dist/hooks/useMaterialApplication.js +7 -2
- package/dist/hooks/useOceanMaterial.d.ts +11 -1
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +185 -27
- package/dist/hooks/usePathAnimation.d.ts +8 -0
- package/dist/hooks/usePathAnimation.d.ts.map +1 -1
- package/dist/hooks/usePathAnimation.js +140 -59
- package/dist/hooks/useResolvedLayout.d.ts +10 -0
- package/dist/hooks/useResolvedLayout.d.ts.map +1 -0
- package/dist/hooks/useResolvedLayout.js +17 -0
- package/dist/hooks/useTimeLighting.d.ts +36 -0
- package/dist/hooks/useTimeLighting.d.ts.map +1 -0
- package/dist/hooks/useTimeLighting.js +67 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -1
- package/dist/operations/catalogue/shaderLayers.js +26 -3
- package/dist/render/renderLive.d.ts +11 -0
- package/dist/render/renderLive.d.ts.map +1 -0
- package/dist/render/renderLive.js +57 -0
- package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
- package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/oceanCore.glsl.js +35 -5
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +12 -0
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
- package/dist/shaders/ocean/OceanSurfaceMaterial.js +55 -7
- package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
- package/dist/shaders/terrain/TerrainMaterial.js +28 -0
- package/dist/triggers/kinds/change.js +1 -1
- package/dist/utils/composerHostedPass.d.ts +74 -0
- package/dist/utils/composerHostedPass.d.ts.map +1 -0
- package/dist/utils/composerHostedPass.js +63 -0
- package/dist/utils/geometryScript.d.ts +17 -0
- package/dist/utils/geometryScript.d.ts.map +1 -0
- package/dist/utils/geometryScript.js +92 -0
- package/dist/utils/geometryScript.worker.d.ts +2 -0
- package/dist/utils/geometryScript.worker.d.ts.map +1 -0
- package/dist/utils/geometryScript.worker.js +42 -0
- package/dist/utils/groundRegistry.d.ts +11 -0
- package/dist/utils/groundRegistry.d.ts.map +1 -0
- package/dist/utils/groundRegistry.js +39 -0
- package/dist/utils/instancingSupport.d.ts +9 -0
- package/dist/utils/instancingSupport.d.ts.map +1 -0
- package/dist/utils/instancingSupport.js +13 -0
- package/dist/utils/landPatch.d.ts +26 -5
- package/dist/utils/landPatch.d.ts.map +1 -1
- package/dist/utils/landPatch.js +124 -9
- package/dist/utils/layoutPlacement.d.ts +30 -0
- package/dist/utils/layoutPlacement.d.ts.map +1 -0
- package/dist/utils/layoutPlacement.js +113 -0
- package/dist/utils/linkRegistry.d.ts +15 -0
- package/dist/utils/linkRegistry.d.ts.map +1 -0
- package/dist/utils/linkRegistry.js +11 -0
- package/dist/utils/shapes.d.ts +28 -2
- package/dist/utils/shapes.d.ts.map +1 -1
- package/dist/utils/shapes.js +32 -3
- package/dist/utils/sharedParts.d.ts +61 -0
- package/dist/utils/sharedParts.d.ts.map +1 -0
- package/dist/utils/sharedParts.js +268 -0
- package/dist/utils/svgAsset.d.ts +6 -0
- package/dist/utils/svgAsset.d.ts.map +1 -0
- package/dist/utils/svgAsset.js +46 -0
- package/dist/utils/waterLight.d.ts +29 -0
- package/dist/utils/waterLight.d.ts.map +1 -0
- package/dist/utils/waterLight.js +67 -0
- package/dist/utils/waterReflection.d.ts +185 -0
- package/dist/utils/waterReflection.d.ts.map +1 -0
- package/dist/utils/waterReflection.js +616 -0
- package/package.json +4 -3
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare const SPECIES: {
|
|
3
|
+
englishIvy: {
|
|
4
|
+
leaf: string;
|
|
5
|
+
size: number;
|
|
6
|
+
color: string;
|
|
7
|
+
shade: string;
|
|
8
|
+
bark: string;
|
|
9
|
+
autumn: string[];
|
|
10
|
+
};
|
|
11
|
+
virginiaCreeper: {
|
|
12
|
+
leaf: string;
|
|
13
|
+
size: number;
|
|
14
|
+
color: string;
|
|
15
|
+
shade: string;
|
|
16
|
+
bark: string;
|
|
17
|
+
autumn: string[];
|
|
18
|
+
};
|
|
19
|
+
bougainvillea: {
|
|
20
|
+
leaf: string;
|
|
21
|
+
size: number;
|
|
22
|
+
color: string;
|
|
23
|
+
shade: string;
|
|
24
|
+
bark: string;
|
|
25
|
+
autumn: string[];
|
|
26
|
+
flower: {
|
|
27
|
+
petals: number;
|
|
28
|
+
size: number;
|
|
29
|
+
color: string;
|
|
30
|
+
head: number;
|
|
31
|
+
cup: number;
|
|
32
|
+
};
|
|
33
|
+
flowersAlways: number;
|
|
34
|
+
};
|
|
35
|
+
jasmine: {
|
|
36
|
+
leaf: string;
|
|
37
|
+
size: number;
|
|
38
|
+
color: string;
|
|
39
|
+
shade: string;
|
|
40
|
+
bark: string;
|
|
41
|
+
autumn: string[];
|
|
42
|
+
flower: {
|
|
43
|
+
petals: number;
|
|
44
|
+
size: number;
|
|
45
|
+
color: string;
|
|
46
|
+
head: number;
|
|
47
|
+
cup: number;
|
|
48
|
+
};
|
|
49
|
+
flowersAlways: number;
|
|
50
|
+
};
|
|
51
|
+
wisteria: {
|
|
52
|
+
leaf: string;
|
|
53
|
+
size: number;
|
|
54
|
+
color: string;
|
|
55
|
+
shade: string;
|
|
56
|
+
bark: string;
|
|
57
|
+
autumn: string[];
|
|
58
|
+
flower: {
|
|
59
|
+
petals: number;
|
|
60
|
+
size: number;
|
|
61
|
+
color: string;
|
|
62
|
+
head: number;
|
|
63
|
+
cup: number;
|
|
64
|
+
hang: boolean;
|
|
65
|
+
};
|
|
66
|
+
flowersAlways: number;
|
|
67
|
+
};
|
|
68
|
+
climbingRose: {
|
|
69
|
+
leaf: string;
|
|
70
|
+
size: number;
|
|
71
|
+
color: string;
|
|
72
|
+
shade: string;
|
|
73
|
+
bark: string;
|
|
74
|
+
autumn: string[];
|
|
75
|
+
flower: {
|
|
76
|
+
petals: number;
|
|
77
|
+
size: number;
|
|
78
|
+
color: string;
|
|
79
|
+
head: number;
|
|
80
|
+
cup: number;
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
flowersAlways: number;
|
|
84
|
+
};
|
|
85
|
+
honeysuckle: {
|
|
86
|
+
leaf: string;
|
|
87
|
+
size: number;
|
|
88
|
+
color: string;
|
|
89
|
+
shade: string;
|
|
90
|
+
bark: string;
|
|
91
|
+
autumn: string[];
|
|
92
|
+
flower: {
|
|
93
|
+
petals: number;
|
|
94
|
+
size: number;
|
|
95
|
+
color: string;
|
|
96
|
+
head: number;
|
|
97
|
+
cup: number;
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
flowersAlways: number;
|
|
101
|
+
};
|
|
102
|
+
grapevine: {
|
|
103
|
+
leaf: string;
|
|
104
|
+
size: number;
|
|
105
|
+
color: string;
|
|
106
|
+
shade: string;
|
|
107
|
+
bark: string;
|
|
108
|
+
autumn: string[];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export declare function createUniforms(): {
|
|
112
|
+
uTime: {
|
|
113
|
+
value: number;
|
|
114
|
+
};
|
|
115
|
+
uWindPhase: {
|
|
116
|
+
value: number;
|
|
117
|
+
};
|
|
118
|
+
uWindDir: {
|
|
119
|
+
value: THREE.Vector2;
|
|
120
|
+
};
|
|
121
|
+
uWindStrength: {
|
|
122
|
+
value: number;
|
|
123
|
+
};
|
|
124
|
+
uTurb: {
|
|
125
|
+
value: number;
|
|
126
|
+
};
|
|
127
|
+
uSpeed: {
|
|
128
|
+
value: number;
|
|
129
|
+
};
|
|
130
|
+
uSway: {
|
|
131
|
+
value: number;
|
|
132
|
+
};
|
|
133
|
+
uFlutter: {
|
|
134
|
+
value: number;
|
|
135
|
+
};
|
|
136
|
+
uScale: {
|
|
137
|
+
value: THREE.Vector3;
|
|
138
|
+
};
|
|
139
|
+
uMean: {
|
|
140
|
+
value: number;
|
|
141
|
+
};
|
|
142
|
+
uOpacity: {
|
|
143
|
+
value: number;
|
|
144
|
+
};
|
|
145
|
+
uColor: {
|
|
146
|
+
value: THREE.Color;
|
|
147
|
+
};
|
|
148
|
+
uShadeColor: {
|
|
149
|
+
value: THREE.Color;
|
|
150
|
+
};
|
|
151
|
+
uSeason: {
|
|
152
|
+
value: number;
|
|
153
|
+
};
|
|
154
|
+
uFoliage: {
|
|
155
|
+
value: number;
|
|
156
|
+
};
|
|
157
|
+
uLeafType: {
|
|
158
|
+
value: number;
|
|
159
|
+
};
|
|
160
|
+
uLeafSize: {
|
|
161
|
+
value: number;
|
|
162
|
+
};
|
|
163
|
+
uGrowth: {
|
|
164
|
+
value: number;
|
|
165
|
+
};
|
|
166
|
+
uSunDirView: {
|
|
167
|
+
value: THREE.Vector3;
|
|
168
|
+
};
|
|
169
|
+
uViewPos: {
|
|
170
|
+
value: THREE.Vector3;
|
|
171
|
+
};
|
|
172
|
+
uLodK: {
|
|
173
|
+
value: number;
|
|
174
|
+
};
|
|
175
|
+
uLodOrtho: {
|
|
176
|
+
value: number;
|
|
177
|
+
};
|
|
178
|
+
uLodBias: {
|
|
179
|
+
value: number;
|
|
180
|
+
};
|
|
181
|
+
uImpReady: {
|
|
182
|
+
value: number;
|
|
183
|
+
};
|
|
184
|
+
uBake: {
|
|
185
|
+
value: number;
|
|
186
|
+
};
|
|
187
|
+
uBakeView: {
|
|
188
|
+
value: THREE.Matrix3;
|
|
189
|
+
};
|
|
190
|
+
uBakeDepth: {
|
|
191
|
+
value: THREE.Vector2;
|
|
192
|
+
};
|
|
193
|
+
} & {
|
|
194
|
+
uLeafType: {
|
|
195
|
+
value: number;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
export declare function speciesColors(c: any): any;
|
|
199
|
+
export declare function applyConfig(u: any, c: any, mats: any): void;
|
|
200
|
+
export declare function build(u: any, c: any): {
|
|
201
|
+
object: THREE.Group<THREE.Object3DEventMap>;
|
|
202
|
+
materials: THREE.MeshStandardMaterial[];
|
|
203
|
+
apply: (cfg2: any) => void;
|
|
204
|
+
update: (dt: any, camera: any, sunWorld: any) => void;
|
|
205
|
+
stats: {
|
|
206
|
+
vines: number;
|
|
207
|
+
leaves: number;
|
|
208
|
+
};
|
|
209
|
+
dispose: () => void;
|
|
210
|
+
};
|
|
211
|
+
/** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
|
|
212
|
+
export declare const STRUCTURAL: string[];
|
|
213
|
+
//# sourceMappingURL=ivy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ivy.d.ts","sourceRoot":"","sources":["../../../../src/components/vegetation/core/ivy.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASnB,CAAC;AAKF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2G;AAEzI,wBAAgB,aAAa,CAAC,CAAC,KAAA,OAQ9B;AAED,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,IAAI,KAAA,QAOrC;AAiDD,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA;;;;;;;;;;EAuCzB;AAED,8GAA8G;AAC9G,eAAO,MAAM,UAAU,UAAoF,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// Emitted from Claude outputs/vegetation-lab/ivy.mjs by gen_family.mjs — edit the lab module and re-emit.
|
|
2
|
+
// vegetation/core/ivy — Ivy (type 'vegetation', config.type 'ivy'). Shared core: ../vegetationCore.
|
|
3
|
+
// Construction: climbing vines on the faces of the object's box (place the box against a wall or
|
|
4
|
+
// around a pillar): each vine is a 2-D random walk up the face — upward tropism, wander, a chance to
|
|
5
|
+
// branch at each step, thinning as it climbs — mapped onto the face a few centimetres proud of it.
|
|
6
|
+
// Leaves (ivy's three-lobed cards) hang off the vines facing away from the wall, older and bigger
|
|
7
|
+
// low down, young and small at the tips. `growth` draws the vines from the ground up (the part past
|
|
8
|
+
// the growth front collapses onto its axis, leaves past it are not there yet), so ivy can be animated
|
|
9
|
+
// climbing a wall. Wind: only the leaves flutter and the loose tips sway. Size: the box's faces.
|
|
10
|
+
import * as THREE from 'three';
|
|
11
|
+
import { mulberry32, setColor, createCommonUniforms, applyCommonConfig, updateCommon, QUALITY_V, LEAF_TYPES, branchGeometry, leafGeometry, fillLeaves, unitBounds, barkMaterial, leafMaterial, plantMesh, flowerHeads, } from '../vegetationCore.js';
|
|
12
|
+
// species: leaf type and size, colours, autumn turn, flowers at the vine tips (hang = racemes)
|
|
13
|
+
export const SPECIES = {
|
|
14
|
+
englishIvy: { leaf: 'heart', size: 1, color: '#3f7a2e', shade: '#1a3617', bark: '#5a4a38', autumn: ['#c89a2a', '#8a3a1a'] },
|
|
15
|
+
virginiaCreeper: { leaf: 'maple', size: 1.2, color: '#4f8a3a', shade: '#1e3a1a', bark: '#5a4a38', autumn: ['#d8402a', '#7a1a1a'] },
|
|
16
|
+
bougainvillea: { leaf: 'broadleaf', size: 0.7, color: '#4f8a3a', shade: '#1e3a1a', bark: '#6a5a4a', autumn: ['#c89a3a', '#8a5a2a'], flower: { petals: 3, size: 0.03, color: '#e0207a', head: 6, cup: 0.3 }, flowersAlways: 1 },
|
|
17
|
+
jasmine: { leaf: 'round', size: 0.5, color: '#3f7a3a', shade: '#1a3a1f', bark: '#5a5a48', autumn: ['#9a9a4a', '#6a6a3a'], flower: { petals: 5, size: 0.012, color: '#fbf8f0', head: 4, cup: 0.2 }, flowersAlways: 0.8 },
|
|
18
|
+
wisteria: { leaf: 'frond', size: 1.3, color: '#5f9a4a', shade: '#2a4a1f', bark: '#6a5a48', autumn: ['#d8b84a', '#9a7a2a'], flower: { petals: 4, size: 0.012, color: '#b8a0e8', head: 26, cup: 0.5, hang: true }, flowersAlways: 0.9 },
|
|
19
|
+
climbingRose: { leaf: 'broadleaf', size: 0.7, color: '#3f7a2e', shade: '#1a3617', bark: '#5a4a38', autumn: ['#c89a3a', '#8a5a2a'], flower: { petals: 8, size: 0.03, color: '#e85a7a', head: 1, cup: 0.7, type: 'round' }, flowersAlways: 0.6 },
|
|
20
|
+
honeysuckle: { leaf: 'round', size: 0.8, color: '#5f9a4a', shade: '#2a4a1f', bark: '#6a5a48', autumn: ['#c8a84a', '#8a6a3a'], flower: { petals: 5, size: 0.016, color: '#f6e0a0', head: 5, cup: 0.6, type: 'lanceolate' }, flowersAlways: 0.7 },
|
|
21
|
+
grapevine: { leaf: 'maple', size: 1.5, color: '#5f9a3a', shade: '#2a4a1f', bark: '#5a4a38', autumn: ['#d8a82a', '#8a4a1a'] },
|
|
22
|
+
};
|
|
23
|
+
const FACES = { back: [[0, 0, -1]], front: [[0, 0, 1]], sides: [[0, 0, -1], [0, 0, 1]], around: [[0, 0, -1], [1, 0, 0], [0, 0, 1], [-1, 0, 0]] };
|
|
24
|
+
const LEAF_BASE = 5000;
|
|
25
|
+
export function createUniforms() { return Object.assign(createCommonUniforms(), { uLeafType: { value: LEAF_TYPES.indexOf('heart') } }); }
|
|
26
|
+
export function speciesColors(c) {
|
|
27
|
+
const sp = SPECIES[c.species] || SPECIES.englishIvy;
|
|
28
|
+
const all = Object.values(SPECIES);
|
|
29
|
+
const out = Object.create(null); // only the keys set below override the config
|
|
30
|
+
if (!c.color || all.some((s) => s.color.toLowerCase() === c.color.toLowerCase()))
|
|
31
|
+
out.color = sp.color;
|
|
32
|
+
if (!c.shadeColor || all.some((s) => s.shade.toLowerCase() === c.shadeColor.toLowerCase()))
|
|
33
|
+
out.shadeColor = sp.shade;
|
|
34
|
+
if (!c.barkColor || all.some((s) => s.bark.toLowerCase() === c.barkColor.toLowerCase()))
|
|
35
|
+
out.barkColor = sp.bark;
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
export function applyConfig(u, c, mats) {
|
|
39
|
+
if (c.species !== undefined) {
|
|
40
|
+
c = Object.assign({}, c, speciesColors(c));
|
|
41
|
+
u.uLeafType.value = Math.max(0, LEAF_TYPES.indexOf((SPECIES[c.species] || SPECIES.englishIvy).leaf));
|
|
42
|
+
}
|
|
43
|
+
applyCommonConfig(u, Object.assign({}, c, { leafType: undefined }));
|
|
44
|
+
if (!mats)
|
|
45
|
+
return;
|
|
46
|
+
if (c.barkColor !== undefined)
|
|
47
|
+
setColor(mats.bark.userData.uniforms.uBarkColor, c.barkColor);
|
|
48
|
+
if (c.flowers !== undefined && mats.flowerU)
|
|
49
|
+
mats.flowerU.uFoliage.value = c.flowers;
|
|
50
|
+
if (c.flowerColor !== undefined && c.flowerColor !== '#ffffff' && mats.flowerU)
|
|
51
|
+
setColor(mats.flowerU.uColor, c.flowerColor);
|
|
52
|
+
}
|
|
53
|
+
/** Vines on one face: 2-D walks (s across 0..1, h up 0..1) → 3-D on the face, proud by `off`. */
|
|
54
|
+
function growFace(normal, c, rnd, branches, leaves, off) {
|
|
55
|
+
const n = new THREE.Vector3(...normal);
|
|
56
|
+
const right = new THREE.Vector3().crossVectors(new THREE.Vector3(0, 1, 0), n).normalize();
|
|
57
|
+
const toWorld = (s, h, lift) => new THREE.Vector3().addScaledVector(right, s - 0.5).addScaledVector(n, 0.5 - off - lift).setY(h);
|
|
58
|
+
const reach = c.reach ?? 1, branching = c.branching ?? 0.5;
|
|
59
|
+
const stack = [];
|
|
60
|
+
const nV = Math.max(1, Math.round(c.vines ?? 7));
|
|
61
|
+
for (let i = 0; i < nV; i++)
|
|
62
|
+
stack.push({ s: (i + 0.3 + 0.4 * rnd()) / nV, h: 0, dir: (rnd() - 0.5) * 0.6, r: 0.006, dist: 0, level: 0, phase: rnd() });
|
|
63
|
+
const step = 0.035;
|
|
64
|
+
let maxDist = 1e-6;
|
|
65
|
+
while (stack.length) {
|
|
66
|
+
const v = stack.pop();
|
|
67
|
+
const pts = [], radii = [], dist = [];
|
|
68
|
+
let { s, h, dir, r } = v, d = v.dist;
|
|
69
|
+
const len = (0.4 + 0.6 * rnd()) * reach * (v.level ? 0.5 : 1.2);
|
|
70
|
+
let travelled = 0;
|
|
71
|
+
pts.push(toWorld(s, h, 0));
|
|
72
|
+
radii.push(r);
|
|
73
|
+
dist.push(d);
|
|
74
|
+
while (travelled < len && h < reach * 0.98 && r > 0.0012) {
|
|
75
|
+
// tropism: mostly up, wandering; a vine that reaches the top edge turns sideways
|
|
76
|
+
dir += (rnd() - 0.5) * 0.9;
|
|
77
|
+
dir *= 0.85;
|
|
78
|
+
if (h > reach * 0.9)
|
|
79
|
+
dir += (dir > 0 ? 1 : -1) * 0.4;
|
|
80
|
+
const ang = dir;
|
|
81
|
+
s += Math.sin(ang) * step;
|
|
82
|
+
h += Math.cos(ang) * step * (0.6 + 0.4 * rnd());
|
|
83
|
+
if (s < 0.03 || s > 0.97) {
|
|
84
|
+
dir = -dir * 1.5;
|
|
85
|
+
s = Math.min(0.97, Math.max(0.03, s));
|
|
86
|
+
}
|
|
87
|
+
travelled += step;
|
|
88
|
+
d += step;
|
|
89
|
+
r *= 0.985;
|
|
90
|
+
pts.push(toWorld(s, h, 0.002 * rnd()));
|
|
91
|
+
radii.push(r);
|
|
92
|
+
dist.push(d);
|
|
93
|
+
if (rnd() < branching * 0.18 && v.level < 3 && r > 0.002)
|
|
94
|
+
stack.push({ s, h, dir: dir + (rnd() < 0.5 ? 1 : -1) * (0.8 + rnd() * 0.8), r: r * 0.7, dist: d, level: v.level + 1, phase: rnd() });
|
|
95
|
+
// a leaf every step or two: facing out from the wall, older (bigger) low down
|
|
96
|
+
// leaves: two or three a step, lying flat against the wall (along in the wall plane, pointing
|
|
97
|
+
// sideways and down; normal out of the wall), older and bigger low down
|
|
98
|
+
const nLeaf = 2 + Math.floor(rnd() * 2);
|
|
99
|
+
for (let k = 0; k < nLeaf; k++) {
|
|
100
|
+
const side = rnd() < 0.5 ? -1 : 1;
|
|
101
|
+
const along = new THREE.Vector3().addScaledVector(right, side * (0.4 + 0.6 * rnd())).addScaledVector(n, 0.15 * rnd()).setY(-0.3 - 0.7 * rnd()).normalize();
|
|
102
|
+
const nrm = new THREE.Vector3().addScaledVector(n, 1).addScaledVector(right, (rnd() - 0.5) * 0.4).setY((rnd() - 0.3) * 0.4).normalize();
|
|
103
|
+
const age = Math.min(1, 1.2 - h / Math.max(reach, 0.1));
|
|
104
|
+
leaves.push({ pos: toWorld(s + (rnd() - 0.5) * 0.02, h + (rnd() - 0.5) * 0.02, 0.015 + 0.03 * rnd()), along, normal: nrm, size: (0.05 + 0.04 * age) * (0.8 + 0.4 * rnd()), hf: h, ao: 0.6 + 0.4 * rnd(), phase: v.phase, flex: 0.25, order: rnd(), grow: d });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (d > maxDist)
|
|
108
|
+
maxDist = d;
|
|
109
|
+
if (pts.length > 1)
|
|
110
|
+
branches.push({ level: v.level, pts, radii, hf0: v.h, phase: v.phase, flex: 0.08, dist });
|
|
111
|
+
}
|
|
112
|
+
return maxDist;
|
|
113
|
+
}
|
|
114
|
+
export function build(u, c) {
|
|
115
|
+
const q = QUALITY_V[c.quality] || 1;
|
|
116
|
+
const sp = SPECIES[c.species] || SPECIES.englishIvy;
|
|
117
|
+
c = Object.assign({}, c, speciesColors(c));
|
|
118
|
+
const rnd = mulberry32((c.seed ?? 13) * 2654435761 + 131);
|
|
119
|
+
const faces = FACES[c.faces] || FACES.back;
|
|
120
|
+
const branches = [], leaves = [];
|
|
121
|
+
let maxDist = 1e-6;
|
|
122
|
+
for (const f of faces)
|
|
123
|
+
maxDist = Math.max(maxDist, growFace(f, c, rnd, branches, leaves, 0.02));
|
|
124
|
+
// growth: distance along the vine normalised to the longest vine
|
|
125
|
+
for (const b of branches) {
|
|
126
|
+
b.grow = b.dist.map((d) => d / maxDist);
|
|
127
|
+
b.flex = 0.08;
|
|
128
|
+
}
|
|
129
|
+
for (const l of leaves) {
|
|
130
|
+
l.grow = l.grow / maxDist;
|
|
131
|
+
l.size *= sp.size;
|
|
132
|
+
}
|
|
133
|
+
// leaf budget
|
|
134
|
+
let picked = leaves;
|
|
135
|
+
const target = Math.round(LEAF_BASE * (c.density ?? 1) * q * faces.length);
|
|
136
|
+
if (picked.length > target) {
|
|
137
|
+
picked = [];
|
|
138
|
+
for (let i = 0; i < target; i++)
|
|
139
|
+
picked.push(leaves[Math.floor(rnd() * leaves.length)]);
|
|
140
|
+
}
|
|
141
|
+
const barkPair = barkMaterial(u, { barkColor: c.barkColor || '#5a4a38', ridges: 0.4 });
|
|
142
|
+
const leafPair = leafMaterial(u, { translucency: 0.45, veins: 0.7, autumnA: sp.autumn[0], autumnB: sp.autumn[1] });
|
|
143
|
+
// flowers at the vine tips
|
|
144
|
+
const tipsB = branches.filter((b) => b.level >= 1 || branches.length < 8);
|
|
145
|
+
const fl = sp.flower || { petals: 5, size: 0.015, color: '#fbf8f0', head: 3, cup: 0.3 };
|
|
146
|
+
const heads = flowerHeads(u, tipsB.length ? tipsB : branches, rnd, Object.assign({}, fl, { color: c.flowerColor && c.flowerColor !== '#ffffff' ? c.flowerColor : fl.color }), Math.round(700 * q / Math.max(1, Math.sqrt(fl.head || 1))));
|
|
147
|
+
const barkGeo = branchGeometry(branches, { sides: [5, 4, 4, 3] });
|
|
148
|
+
unitBounds(barkGeo);
|
|
149
|
+
const leafGeo = leafGeometry(Math.max(1, picked.length));
|
|
150
|
+
fillLeaves(leafGeo, picked);
|
|
151
|
+
unitBounds(leafGeo);
|
|
152
|
+
const object = new THREE.Group();
|
|
153
|
+
object.name = 'ivy';
|
|
154
|
+
object.add(plantMesh(barkGeo, barkPair, 'vines'), plantMesh(leafGeo, leafPair, 'leaves'), plantMesh(heads.geo, heads.pair, 'flowers'));
|
|
155
|
+
const mats = { bark: barkPair.material, flowerU: heads.U };
|
|
156
|
+
const cfg = Object.assign({}, c);
|
|
157
|
+
if (sp.flowersAlways && (c.flowers ?? 0) === 0)
|
|
158
|
+
cfg.flowers = sp.flowersAlways;
|
|
159
|
+
applyConfig(u, cfg, mats);
|
|
160
|
+
return {
|
|
161
|
+
object,
|
|
162
|
+
materials: [barkPair.material, leafPair.material, heads.pair.material],
|
|
163
|
+
apply: function (cfg2) { applyConfig(u, cfg2, mats); },
|
|
164
|
+
update: function (dt, camera, sunWorld) { updateCommon(u, object, camera, dt, sunWorld); },
|
|
165
|
+
stats: { vines: branches.length, leaves: picked.length },
|
|
166
|
+
dispose: function () { barkGeo.dispose(); leafGeo.dispose(); heads.geo.dispose(); for (const p of [barkPair, leafPair, heads.pair]) {
|
|
167
|
+
p.material.dispose();
|
|
168
|
+
p.depth.dispose();
|
|
169
|
+
} },
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/** Knobs whose change rebuilds the plant (dispose + build); every other knob is a live push through apply. */
|
|
173
|
+
export const STRUCTURAL = ['species', 'faces', 'vines', 'branching', 'reach', 'density', 'quality', 'seed'];
|