@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,545 @@
|
|
|
1
|
+
// Generated from Claude outputs/lights-lab/projector.mjs (the approved lab module) by
|
|
2
|
+
// emit_object.mjs — edit there and regenerate.
|
|
3
|
+
//
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// projector — a stadium floodlight bank (lab module, light family)
|
|
6
|
+
// =============================================================================
|
|
7
|
+
//
|
|
8
|
+
// One real THREE.SpotLight at the bank centre does the lighting; at arena throw
|
|
9
|
+
// a bank of heads reads as one source. Everything else is the fixture and what
|
|
10
|
+
// the eye sees of the light:
|
|
11
|
+
//
|
|
12
|
+
// - Pool: an asymmetric flood. The optic is a rectangle in tangent space
|
|
13
|
+
// (horizontal half-angle `spread`, vertical = spread * aspect), so the pool on
|
|
14
|
+
// the pitch is a rectangle. Drawn as a soft rectangular mask on SpotLight.map;
|
|
15
|
+
// the spot's cone is the circle through the rectangle's corners.
|
|
16
|
+
// - Source: the fixture is self-lit and overexposed, like a stadium head seen
|
|
17
|
+
// at night. Every LED TIR lens blazes from anywhere in front and fills harder
|
|
18
|
+
// when the eye stands inside the beam (the eye's position in each head's beam
|
|
19
|
+
// rectangle drives it); a tight glow hugs each head. No haze in the air: the
|
|
20
|
+
// light is judged by what it does to the scene.
|
|
21
|
+
// - Lamp: 'led' is instant (fade = warmup) and can run show modes (chase,
|
|
22
|
+
// strobe, breathe). 'metalHalide' strikes (blue-white arc flashes), comes up
|
|
23
|
+
// dim and mercury-violet, warms to its colour over `warmup`; switched off it
|
|
24
|
+
// leaves an ember and refuses to restrike until it has cooled (`restrike`).
|
|
25
|
+
// Heads come on one by one in a fixed order, `stagger` apart.
|
|
26
|
+
//
|
|
27
|
+
// Internal only: heads tilt in their yokes (articulation). Pan, position and the
|
|
28
|
+
// mast are the parent transform / the user's own meshes.
|
|
29
|
+
//
|
|
30
|
+
import * as THREE from 'three';
|
|
31
|
+
import { mergeGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
|
|
32
|
+
import { DEFAULT_LIGHTS } from '@3driseai/3drise-core';
|
|
33
|
+
import { kelvinToColor } from '../lightBulb/kelvin.js';
|
|
34
|
+
/** The defaults live in core (DEFAULT_LIGHTS.projector); this is that table. */
|
|
35
|
+
export const DEFAULTS = DEFAULT_LIGHTS.projector;
|
|
36
|
+
export const STRUCTURAL = ['lamp', 'columns', 'rows', 'aspect', 'edgeSoftness'];
|
|
37
|
+
// Head dimensions (metres, object space). A 1–1.5 kW LED flood head.
|
|
38
|
+
const HW = 0.62, HH = 0.44, HD = 0.11;
|
|
39
|
+
const GAP_X = 0.1, GAP_Y = 0.2;
|
|
40
|
+
const MAX_HEADS = 24;
|
|
41
|
+
const LENS_GRID = [7, 5];
|
|
42
|
+
const MERCURY = new THREE.Color(0.55, 0.62, 1.0);
|
|
43
|
+
const ARC = new THREE.Color(0.8, 0.88, 1.0);
|
|
44
|
+
const EMBER = new THREE.Color(1.0, 0.36, 0.08);
|
|
45
|
+
const clamp = (v, a, b) => Math.min(Math.max(v, a), b);
|
|
46
|
+
const num = (v, f) => (typeof v === 'number' && isFinite(v) ? v : f);
|
|
47
|
+
const smooth = (a, b, x) => { const t = clamp((x - a) / (b - a), 0, 1); return t * t * (3 - 2 * t); };
|
|
48
|
+
const hash = (n) => { const s = Math.sin(n * 127.1 + 311.7) * 43758.5453; return s - Math.floor(s); };
|
|
49
|
+
const noise1 = (x) => { const i = Math.floor(x), f = x - i, u = f * f * (3 - 2 * f); return hash(i) * (1 - u) + hash(i + 1) * u; };
|
|
50
|
+
// -----------------------------------------------------------------------------
|
|
51
|
+
// Geometry
|
|
52
|
+
// -----------------------------------------------------------------------------
|
|
53
|
+
/** One head's housing: body, back fins, bezel, visor. Lens face at +Z. */
|
|
54
|
+
function headGeometry() {
|
|
55
|
+
const parts = [];
|
|
56
|
+
const body = new THREE.BoxGeometry(HW, HH, HD);
|
|
57
|
+
parts.push(body);
|
|
58
|
+
// Cast-aluminium heat-sink fins on the back, vertical.
|
|
59
|
+
const fins = 11;
|
|
60
|
+
for (let i = 0; i < fins; i++) {
|
|
61
|
+
const f = new THREE.BoxGeometry(0.012, HH * 0.86, 0.075);
|
|
62
|
+
f.translate(-HW * 0.44 + (i / (fins - 1)) * HW * 0.88, 0, -HD / 2 - 0.037);
|
|
63
|
+
parts.push(f);
|
|
64
|
+
}
|
|
65
|
+
// Bezel frame proud of the lens.
|
|
66
|
+
const bz = 0.022, bd = 0.025;
|
|
67
|
+
for (const [w, h, x, y] of [[HW, bz, 0, HH / 2 - bz / 2], [HW, bz, 0, -HH / 2 + bz / 2], [bz, HH, HW / 2 - bz / 2, 0], [bz, HH, -HW / 2 + bz / 2, 0]]) {
|
|
68
|
+
const b = new THREE.BoxGeometry(w, h, bd);
|
|
69
|
+
b.translate(x, y, HD / 2 + bd / 2 - 0.004);
|
|
70
|
+
parts.push(b);
|
|
71
|
+
}
|
|
72
|
+
// Glare visor over the top, angled down at the front.
|
|
73
|
+
const visor = new THREE.BoxGeometry(HW * 1.02, 0.008, 0.16);
|
|
74
|
+
visor.translate(0, 0, 0.08);
|
|
75
|
+
visor.rotateX(0.18);
|
|
76
|
+
visor.translate(0, HH / 2 + 0.006, HD / 2 - 0.02);
|
|
77
|
+
parts.push(visor);
|
|
78
|
+
const g = mergeGeometries(parts.map((p) => p.toNonIndexed()));
|
|
79
|
+
parts.forEach((p) => p.dispose());
|
|
80
|
+
return g;
|
|
81
|
+
}
|
|
82
|
+
/** Yoke: a U-bracket around the head, pivoting on the head's horizontal axis. */
|
|
83
|
+
function yokeGeometry() {
|
|
84
|
+
const parts = [];
|
|
85
|
+
for (const s of [-1, 1]) {
|
|
86
|
+
const arm = new THREE.BoxGeometry(0.018, 0.09, 0.32);
|
|
87
|
+
arm.translate(s * (HW / 2 + 0.03), 0, -0.13);
|
|
88
|
+
parts.push(arm);
|
|
89
|
+
const hub = new THREE.CylinderGeometry(0.035, 0.035, 0.03, 16);
|
|
90
|
+
hub.rotateZ(Math.PI / 2);
|
|
91
|
+
hub.translate(s * (HW / 2 + 0.03), 0, 0);
|
|
92
|
+
parts.push(hub);
|
|
93
|
+
}
|
|
94
|
+
const back = new THREE.BoxGeometry(HW + 0.08, 0.06, 0.018);
|
|
95
|
+
back.translate(0, 0, -0.29);
|
|
96
|
+
parts.push(back);
|
|
97
|
+
const g = mergeGeometries(parts.map((p) => p.toNonIndexed()));
|
|
98
|
+
parts.forEach((p) => p.dispose());
|
|
99
|
+
return g;
|
|
100
|
+
}
|
|
101
|
+
function bankLayout(cols, rows) {
|
|
102
|
+
const out = [];
|
|
103
|
+
const sx = HW + GAP_X + 0.06, sy = HH + GAP_Y;
|
|
104
|
+
for (let r = 0; r < rows; r++)
|
|
105
|
+
for (let c = 0; c < cols; c++)
|
|
106
|
+
out.push(new THREE.Vector3((c - (cols - 1) / 2) * sx, ((rows - 1) / 2 - r) * sy, 0));
|
|
107
|
+
return out;
|
|
108
|
+
}
|
|
109
|
+
// -----------------------------------------------------------------------------
|
|
110
|
+
// Pool mask (SpotLight.map)
|
|
111
|
+
// -----------------------------------------------------------------------------
|
|
112
|
+
/**
|
|
113
|
+
* The spot's projection square spans ±tan(angle); the optic's rectangle spans
|
|
114
|
+
* ±tx, ±ty inside it. angle is set from the rectangle's corner (×1.04), so the
|
|
115
|
+
* rectangle's share of the square depends only on aspect — `spread` can then be
|
|
116
|
+
* animated without redrawing the mask.
|
|
117
|
+
*/
|
|
118
|
+
export const CORNER = 1.04;
|
|
119
|
+
function poolMask(aspect, soft) {
|
|
120
|
+
const N = 128;
|
|
121
|
+
const data = new Uint8Array(N * N * 4);
|
|
122
|
+
const diag = Math.sqrt(1 + aspect * aspect) * CORNER;
|
|
123
|
+
const rx = 1 / diag, ry = aspect / diag;
|
|
124
|
+
const s = 0.05 + soft * 0.6;
|
|
125
|
+
for (let j = 0; j < N; j++)
|
|
126
|
+
for (let i = 0; i < N; i++) {
|
|
127
|
+
const x = Math.abs((i + 0.5) / N * 2 - 1) / rx, y = Math.abs((j + 0.5) / N * 2 - 1) / ry;
|
|
128
|
+
// soft rectangle with a hot centre — a flood optic is not a flat field
|
|
129
|
+
const e = (1 - smooth(1 - s, 1, x)) * (1 - smooth(1 - s, 1, y));
|
|
130
|
+
const hot = 1 - 0.3 * Math.min(x * x * 0.6 + y * y * 0.6, 1);
|
|
131
|
+
const v = Math.round(clamp(e * hot, 0, 1) * 255);
|
|
132
|
+
const k = (j * N + i) * 4;
|
|
133
|
+
data[k] = data[k + 1] = data[k + 2] = v;
|
|
134
|
+
data[k + 3] = 255;
|
|
135
|
+
}
|
|
136
|
+
const tex = new THREE.DataTexture(data, N, N, THREE.RGBAFormat);
|
|
137
|
+
tex.colorSpace = THREE.SRGBColorSpace;
|
|
138
|
+
tex.magFilter = THREE.LinearFilter;
|
|
139
|
+
tex.minFilter = THREE.LinearFilter;
|
|
140
|
+
tex.needsUpdate = true;
|
|
141
|
+
return tex;
|
|
142
|
+
}
|
|
143
|
+
// -----------------------------------------------------------------------------
|
|
144
|
+
// Shaders
|
|
145
|
+
// -----------------------------------------------------------------------------
|
|
146
|
+
const LENS_VERT = /* glsl */ `
|
|
147
|
+
attribute vec3 aCol;
|
|
148
|
+
attribute float aGlare;
|
|
149
|
+
varying vec2 vUv;
|
|
150
|
+
varying vec3 vCol;
|
|
151
|
+
varying float vGlare;
|
|
152
|
+
void main() {
|
|
153
|
+
vUv = uv; vCol = aCol; vGlare = aGlare;
|
|
154
|
+
gl_Position = projectionMatrix * modelViewMatrix * instanceMatrix * vec4(position, 1.0);
|
|
155
|
+
}`;
|
|
156
|
+
// LED: a grid of TIR lenses, the die always visible, the whole lens filling
|
|
157
|
+
// with light as the eye moves into the beam. Metal halide: a faceted reflector
|
|
158
|
+
// around a horizontal arc tube; the facets light up toward the beam axis.
|
|
159
|
+
const LENS_FRAG = /* glsl */ `
|
|
160
|
+
uniform float uLamp;
|
|
161
|
+
uniform vec2 uGrid;
|
|
162
|
+
uniform float uAspect;
|
|
163
|
+
varying vec2 vUv;
|
|
164
|
+
varying vec3 vCol;
|
|
165
|
+
varying float vGlare;
|
|
166
|
+
float lineAA(float d, float w) { float fw = fwidth(d) + 1e-5; return 1.0 - smoothstep(w - fw, w + fw, d); }
|
|
167
|
+
void main() {
|
|
168
|
+
vec3 glass = vec3(0.018, 0.021, 0.026);
|
|
169
|
+
vec3 col;
|
|
170
|
+
if (uLamp < 0.5) {
|
|
171
|
+
vec2 g = vUv * uGrid;
|
|
172
|
+
vec2 c = fract(g) - 0.5;
|
|
173
|
+
float r = length(c) * 2.0;
|
|
174
|
+
float fw = fwidth(r) + 1e-5;
|
|
175
|
+
float lens = 1.0 - smoothstep(0.86 - fw, 0.86 + fw, r);
|
|
176
|
+
float rim = lineAA(abs(r - 0.88), 0.03);
|
|
177
|
+
float die = max(1.0 - r / 0.2, 0.0); die *= die;
|
|
178
|
+
float fill = lens * (1.0 - 0.45 * r * r);
|
|
179
|
+
col = glass * (0.7 + 0.5 * lens) + vec3(0.05) * rim;
|
|
180
|
+
col += vCol * (die * 4.0 + fill * (0.55 + 1.4 * vGlare));
|
|
181
|
+
} else {
|
|
182
|
+
vec2 p = (vUv - 0.5) * vec2(uAspect, 1.0);
|
|
183
|
+
float r = length(p);
|
|
184
|
+
float a = atan(p.y, p.x);
|
|
185
|
+
float facet = 0.5 + 0.5 * cos(a * 28.0) * cos(r * 60.0);
|
|
186
|
+
float bowl = 1.0 - smoothstep(0.4, 0.46, r);
|
|
187
|
+
vec2 q = p; q.x = max(abs(q.x) - 0.09, 0.0);
|
|
188
|
+
float d = length(q);
|
|
189
|
+
float arc = 1.0 / (1.0 + (d * d) / 0.00006);
|
|
190
|
+
float tube = 1.0 - smoothstep(0.012, 0.018, d);
|
|
191
|
+
col = glass * (0.6 + 0.6 * bowl * facet) + vec3(0.04) * tube;
|
|
192
|
+
col += vCol * (arc * 5.0 + bowl * (0.35 + 0.65 * facet) * (0.4 + 1.2 * vGlare) * (1.0 - 0.6 * r));
|
|
193
|
+
}
|
|
194
|
+
gl_FragColor = vec4(col, 1.0);
|
|
195
|
+
#include <colorspace_fragment>
|
|
196
|
+
}`;
|
|
197
|
+
// Glow: one camera-facing quad per head, hugging the lens — the source reads as
|
|
198
|
+
// a hot, overexposed panel. It keeps a floor size in metres near the bank and an
|
|
199
|
+
// angular size from afar (glow is in the eye), grows a little and gains a short
|
|
200
|
+
// cross (diffraction off the rectangular lens grid) as the eye moves into the
|
|
201
|
+
// beam, and is gone from behind. Only the core and the thin cross pass 1.0.
|
|
202
|
+
const GLOW_VERT = /* glsl */ `
|
|
203
|
+
attribute vec3 aCol;
|
|
204
|
+
attribute float aGlare;
|
|
205
|
+
uniform vec3 uRightW;
|
|
206
|
+
varying vec2 vP;
|
|
207
|
+
varying vec2 vDir;
|
|
208
|
+
varying vec3 vCol;
|
|
209
|
+
varying float vGlare;
|
|
210
|
+
void main() {
|
|
211
|
+
vCol = aCol; vGlare = aGlare;
|
|
212
|
+
vec4 c = modelViewMatrix * instanceMatrix * vec4(0.0, 0.0, 0.0, 1.0);
|
|
213
|
+
float scale = length(modelMatrix[0].xyz);
|
|
214
|
+
float size = max(${(0.62 * 1.3).toFixed(3)} * scale, -c.z * 0.025) * (0.7 + 1.1 * aGlare);
|
|
215
|
+
c.xyz += normalize(-c.xyz) * 0.3 * scale; // in front of the housing
|
|
216
|
+
vec2 d = (viewMatrix * vec4(uRightW, 0.0)).xy;
|
|
217
|
+
vDir = length(d) > 1e-4 ? normalize(d) : vec2(1.0, 0.0);
|
|
218
|
+
vP = position.xy;
|
|
219
|
+
c.xy += position.xy * size;
|
|
220
|
+
gl_Position = projectionMatrix * c;
|
|
221
|
+
}`;
|
|
222
|
+
const GLOW_FRAG = /* glsl */ `
|
|
223
|
+
uniform float uStrength;
|
|
224
|
+
varying vec2 vP;
|
|
225
|
+
varying vec2 vDir;
|
|
226
|
+
varying vec3 vCol;
|
|
227
|
+
varying float vGlare;
|
|
228
|
+
void main() {
|
|
229
|
+
float r = length(vP);
|
|
230
|
+
float along = dot(vP, vDir);
|
|
231
|
+
float across = dot(vP, vec2(-vDir.y, vDir.x));
|
|
232
|
+
float core = 1.0 / (1.0 + r * r * 220.0);
|
|
233
|
+
float veil = max(1.0 - r, 0.0); veil *= veil * veil * veil;
|
|
234
|
+
float sx = max(1.0 - abs(along), 0.0); sx = sx * sx / (1.0 + across * across * 9000.0);
|
|
235
|
+
float sy = max(1.0 - abs(across), 0.0); sy = sy * sy / (1.0 + along * along * 9000.0);
|
|
236
|
+
float k = core * (0.55 + 0.8 * vGlare) + veil * (0.3 + 0.4 * vGlare) + (sx + 0.6 * sy) * vGlare * 0.8;
|
|
237
|
+
k *= 1.0 - smoothstep(0.2, 1.0, r); // fades out inside the quad, no square edge
|
|
238
|
+
vec3 col = vCol * k * uStrength;
|
|
239
|
+
if (max(max(col.r, col.g), col.b) < 0.002) discard;
|
|
240
|
+
gl_FragColor = vec4(col, 1.0);
|
|
241
|
+
#include <colorspace_fragment>
|
|
242
|
+
}`;
|
|
243
|
+
// -----------------------------------------------------------------------------
|
|
244
|
+
// Build
|
|
245
|
+
// -----------------------------------------------------------------------------
|
|
246
|
+
const KEY_OF = (c) => [c.lamp, c.columns, c.rows, c.aspect, c.edgeSoftness].join(':');
|
|
247
|
+
export function createProjector(cfg0) {
|
|
248
|
+
const root = new THREE.Group();
|
|
249
|
+
root.name = 'projector';
|
|
250
|
+
const light = new THREE.SpotLight(0xffffff, num(cfg0.intensity, DEFAULTS.intensity), num(cfg0.distance, 0), 0.5, 0, num(cfg0.decay, 1));
|
|
251
|
+
const target = new THREE.Object3D();
|
|
252
|
+
root.add(light, target);
|
|
253
|
+
light.target = target;
|
|
254
|
+
light.shadow.camera.near = 0.5;
|
|
255
|
+
const housingMat = new THREE.MeshStandardMaterial({ color: cfg0.housingColor ?? DEFAULTS.housingColor, metalness: 0.55, roughness: 0.5 });
|
|
256
|
+
const frameMat = new THREE.MeshStandardMaterial({ color: '#3a3f45', metalness: 0.6, roughness: 0.45 });
|
|
257
|
+
const lensMat = new THREE.ShaderMaterial({
|
|
258
|
+
vertexShader: LENS_VERT, fragmentShader: LENS_FRAG,
|
|
259
|
+
uniforms: { uLamp: { value: 0 }, uGrid: { value: new THREE.Vector2(LENS_GRID[0], LENS_GRID[1]) }, uAspect: { value: HW / HH } },
|
|
260
|
+
});
|
|
261
|
+
const glowMat = new THREE.ShaderMaterial({
|
|
262
|
+
vertexShader: GLOW_VERT, fragmentShader: GLOW_FRAG,
|
|
263
|
+
uniforms: { uRightW: { value: new THREE.Vector3(1, 0, 0) }, uStrength: { value: 1 } },
|
|
264
|
+
transparent: true, depthWrite: false, blending: THREE.AdditiveBlending,
|
|
265
|
+
});
|
|
266
|
+
const geo = { head: headGeometry(), yoke: yokeGeometry(), lens: new THREE.PlaneGeometry(HW - 0.05, HH - 0.05), glow: new THREE.PlaneGeometry(2, 2) };
|
|
267
|
+
let fixture = null; // rebuilt on structural change
|
|
268
|
+
let mask = null;
|
|
269
|
+
let key = '';
|
|
270
|
+
const heads = [];
|
|
271
|
+
const state = { on: !!(cfg0.on ?? true), written: NaN, base: num(cfg0.intensity, DEFAULTS.intensity), showPhase: 0, time: 0, seed: 17.3 };
|
|
272
|
+
function disposeFixture() {
|
|
273
|
+
if (!fixture)
|
|
274
|
+
return;
|
|
275
|
+
root.remove(fixture.group);
|
|
276
|
+
fixture.housing.dispose();
|
|
277
|
+
fixture.yokes.dispose();
|
|
278
|
+
fixture.lens.dispose();
|
|
279
|
+
fixture.glow.dispose();
|
|
280
|
+
fixture.lens.geometry.dispose();
|
|
281
|
+
fixture.glow.geometry.dispose();
|
|
282
|
+
fixture.crossbars.geometry.dispose();
|
|
283
|
+
fixture = null;
|
|
284
|
+
}
|
|
285
|
+
function rebuild(cfg) {
|
|
286
|
+
disposeFixture();
|
|
287
|
+
const cols = clamp(Math.round(num(cfg.columns, 3)), 1, 6), rows = clamp(Math.round(num(cfg.rows, 2)), 1, 4);
|
|
288
|
+
const layout = bankLayout(cols, rows);
|
|
289
|
+
const n = layout.length;
|
|
290
|
+
const group = new THREE.Group();
|
|
291
|
+
const mk = (g, m) => { const im = new THREE.InstancedMesh(g, m, n); im.castShadow = false; im.receiveShadow = false; im.frustumCulled = false; group.add(im); return im; };
|
|
292
|
+
const housing = mk(geo.head, housingMat);
|
|
293
|
+
const yokes = mk(geo.yoke, frameMat);
|
|
294
|
+
const lensGeo = geo.lens.clone();
|
|
295
|
+
lensGeo.setAttribute('aCol', new THREE.InstancedBufferAttribute(new Float32Array(n * 3), 3));
|
|
296
|
+
lensGeo.setAttribute('aGlare', new THREE.InstancedBufferAttribute(new Float32Array(n), 1));
|
|
297
|
+
const lens = mk(lensGeo, lensMat);
|
|
298
|
+
const glowGeo = geo.glow.clone();
|
|
299
|
+
glowGeo.setAttribute('aCol', new THREE.InstancedBufferAttribute(new Float32Array(n * 3), 3));
|
|
300
|
+
glowGeo.setAttribute('aGlare', new THREE.InstancedBufferAttribute(new Float32Array(n), 1));
|
|
301
|
+
const glow = mk(glowGeo, glowMat);
|
|
302
|
+
glow.renderOrder = 4;
|
|
303
|
+
glow.raycast = () => { };
|
|
304
|
+
// Crossbars: one tube per row behind the yokes, plus two end posts.
|
|
305
|
+
const parts = [];
|
|
306
|
+
const sx = HW + GAP_X + 0.06, sy = HH + GAP_Y;
|
|
307
|
+
const width = (cols - 1) * sx + HW + 0.3;
|
|
308
|
+
for (let r = 0; r < rows; r++) {
|
|
309
|
+
const t = new THREE.BoxGeometry(width, 0.07, 0.07);
|
|
310
|
+
t.translate(0, ((rows - 1) / 2 - r) * sy, -0.33);
|
|
311
|
+
parts.push(t.toNonIndexed());
|
|
312
|
+
t.dispose();
|
|
313
|
+
}
|
|
314
|
+
for (const s of [-1, 1]) {
|
|
315
|
+
const p = new THREE.BoxGeometry(0.07, (rows - 1) * sy + 0.3, 0.07);
|
|
316
|
+
p.translate(s * width / 2, 0, -0.33);
|
|
317
|
+
parts.push(p.toNonIndexed());
|
|
318
|
+
p.dispose();
|
|
319
|
+
}
|
|
320
|
+
const crossbars = new THREE.Mesh(mergeGeometries(parts), frameMat);
|
|
321
|
+
parts.forEach((p) => p.dispose());
|
|
322
|
+
group.add(crossbars);
|
|
323
|
+
root.add(group);
|
|
324
|
+
// Fixed strike order: a shuffled ranking, the same every time.
|
|
325
|
+
const order = layout.map((_, i) => i).sort((a, b) => hash(a * 3.1 + 0.7) - hash(b * 3.1 + 0.7));
|
|
326
|
+
heads.length = 0;
|
|
327
|
+
layout.forEach((pos, i) => heads.push({
|
|
328
|
+
pos, rank: order.indexOf(i), level: state.on ? 1 : 0, warm: state.on ? 1 : 0,
|
|
329
|
+
phase: state.on ? 'on' : 'off', timer: 0, lock: 0, ember: 0, strike: 0,
|
|
330
|
+
col: new THREE.Color(), out: 0,
|
|
331
|
+
}));
|
|
332
|
+
fixture = { group, housing, yokes, lens, glow, crossbars };
|
|
333
|
+
lensMat.uniforms.uLamp.value = cfg.lamp === 'metalHalide' ? 1 : 0;
|
|
334
|
+
if (mask)
|
|
335
|
+
mask.dispose();
|
|
336
|
+
mask = poolMask(clamp(num(cfg.aspect, 0.5), 0.15, 1.5), clamp(num(cfg.edgeSoftness, 0.35), 0, 1));
|
|
337
|
+
light.map = mask;
|
|
338
|
+
}
|
|
339
|
+
function setOn(on, cfg) {
|
|
340
|
+
if (on === state.on)
|
|
341
|
+
return;
|
|
342
|
+
state.on = on;
|
|
343
|
+
const stagger = Math.max(num(cfg.stagger, 0.25), 0);
|
|
344
|
+
for (const h of heads) {
|
|
345
|
+
if (on) {
|
|
346
|
+
h.phase = 'wait';
|
|
347
|
+
h.timer = h.rank * stagger;
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
if (cfg.lamp === 'metalHalide' && h.level > 0.05) {
|
|
351
|
+
h.lock = Math.max(num(cfg.restrike, 4), 0);
|
|
352
|
+
h.ember = 1;
|
|
353
|
+
}
|
|
354
|
+
h.phase = 'off';
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
const tmp = { q: new THREE.Quaternion(), wq: new THREE.Quaternion(), m: new THREE.Matrix4(), lm: new THREE.Matrix4(), gm: new THREE.Matrix4(), m2: new THREE.Matrix4(), ym: new THREE.Matrix4(),
|
|
359
|
+
v: new THREE.Vector3(), o: new THREE.Vector3(), cam: new THREE.Vector3(), ws: new THREE.Vector3(), one: new THREE.Vector3(1, 1, 1),
|
|
360
|
+
axis: new THREE.Vector3(), right: new THREE.Vector3(), up: new THREE.Vector3(),
|
|
361
|
+
e: new THREE.Euler(), base: new THREE.Color(), sum: new THREE.Color() };
|
|
362
|
+
/** cfg is the merged config for this frame (committed + live + keyframes + pointer). */
|
|
363
|
+
function update(dt, camera, cfg) {
|
|
364
|
+
dt = Math.min(Math.max(dt, 0), 0.1);
|
|
365
|
+
state.time += dt;
|
|
366
|
+
const k = KEY_OF(cfg);
|
|
367
|
+
if (k !== key) {
|
|
368
|
+
key = k;
|
|
369
|
+
rebuild(cfg);
|
|
370
|
+
}
|
|
371
|
+
setOn(cfg.on ?? true, cfg);
|
|
372
|
+
const mh = cfg.lamp === 'metalHalide';
|
|
373
|
+
const warmup = Math.max(num(cfg.warmup, mh ? 6 : 0.15), 0);
|
|
374
|
+
const flicker = clamp(num(cfg.flicker, 0), 0, 1);
|
|
375
|
+
const tilt = clamp(num(cfg.tilt, 0.42), -1.2, 1.4);
|
|
376
|
+
const spread = clamp(num(cfg.spread, 0.42), 0.05, 1.2);
|
|
377
|
+
const aspect = clamp(num(cfg.aspect, 0.5), 0.15, 1.5);
|
|
378
|
+
const tx = Math.tan(spread), ty = tx * aspect;
|
|
379
|
+
// light colour from the config (the repo's applyLightConfig reads it the same way)
|
|
380
|
+
if ((cfg.colorMode ?? 'temperature') === 'temperature')
|
|
381
|
+
kelvinToColor(num(cfg.temperature, 5700), tmp.base);
|
|
382
|
+
else
|
|
383
|
+
tmp.base.set(cfg.color ?? '#ffffff');
|
|
384
|
+
// show modes run on an integrated phase, so animating the rate never jumps
|
|
385
|
+
const show = mh ? 'none' : (cfg.show ?? 'none');
|
|
386
|
+
state.showPhase += dt * clamp(num(cfg.showRate, 1), 0, 8);
|
|
387
|
+
// --- per-head lamp state ---
|
|
388
|
+
let sumOut = 0;
|
|
389
|
+
const sum = tmp.sum.setRGB(0, 0, 0);
|
|
390
|
+
const n = heads.length;
|
|
391
|
+
heads.forEach((h, i) => {
|
|
392
|
+
if (h.lock > 0)
|
|
393
|
+
h.lock = Math.max(h.lock - dt, 0);
|
|
394
|
+
h.ember = Math.max(h.ember - dt / 1.6, 0);
|
|
395
|
+
if (h.phase === 'wait') {
|
|
396
|
+
h.timer -= dt;
|
|
397
|
+
if (h.timer <= 0 && h.lock <= 0) {
|
|
398
|
+
h.phase = mh ? 'strike' : 'on';
|
|
399
|
+
h.strike = 0;
|
|
400
|
+
h.warm = mh ? 0 : 1;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
let tint = 0; // 0 = lamp colour, 1 = mercury / arc
|
|
404
|
+
if (h.phase === 'strike') {
|
|
405
|
+
// arc strike: a few hard blue-white flashes over a third of a second
|
|
406
|
+
h.strike += dt;
|
|
407
|
+
h.level = noise1(state.time * 38 + i * 5.3) > 0.55 ? 1.25 : 0.04;
|
|
408
|
+
tint = 1;
|
|
409
|
+
if (h.strike > 0.38) {
|
|
410
|
+
h.phase = 'warm';
|
|
411
|
+
h.level = 0.08;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
else if (h.phase === 'warm') {
|
|
415
|
+
h.warm += warmup > 0 ? dt / warmup : 1;
|
|
416
|
+
const w = clamp(h.warm, 0, 1);
|
|
417
|
+
const target = 0.1 + 0.9 * Math.pow(smooth(0, 1, w), 1.3);
|
|
418
|
+
tint = 1 - smooth(0.15, 1, w);
|
|
419
|
+
h.level += (target - h.level) * (1 - Math.exp(-dt * 6));
|
|
420
|
+
if (h.warm >= 1)
|
|
421
|
+
h.phase = 'on';
|
|
422
|
+
}
|
|
423
|
+
else if (h.phase === 'on') {
|
|
424
|
+
const tau = mh ? 0.2 : Math.max(warmup, 0.001);
|
|
425
|
+
h.level += (1 - h.level) * (1 - Math.exp(-dt * 3 / tau));
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
// off or waiting: an arc dies at once, an LED fades with its driver
|
|
429
|
+
const tau = mh ? 0.04 : Math.max(warmup * 0.6, 0.001);
|
|
430
|
+
h.level -= h.level * (1 - Math.exp(-dt * 3 / tau));
|
|
431
|
+
}
|
|
432
|
+
if (h.level < 1e-4)
|
|
433
|
+
h.level = 0;
|
|
434
|
+
let mod = 1;
|
|
435
|
+
if (flicker > 0) {
|
|
436
|
+
const t = state.time + i * 13.7 + state.seed;
|
|
437
|
+
mod *= 1 - flicker * (0.1 * noise1(t * 9) + 0.6 * Math.pow(noise1(t * 1.9), 5));
|
|
438
|
+
}
|
|
439
|
+
if (show === 'chase') {
|
|
440
|
+
const c = 0.5 + 0.5 * Math.cos(2 * Math.PI * (state.showPhase - h.rank / Math.max(n, 1)));
|
|
441
|
+
mod *= 0.06 + 0.94 * c * c * c;
|
|
442
|
+
}
|
|
443
|
+
else if (show === 'strobe') {
|
|
444
|
+
const ph = state.showPhase - Math.floor(state.showPhase);
|
|
445
|
+
mod *= ph < 0.08 ? 1 : 0.02 + 0.98 * Math.exp(-(ph - 0.08) * 40);
|
|
446
|
+
}
|
|
447
|
+
else if (show === 'breathe') {
|
|
448
|
+
mod *= 0.2 + 0.8 * Math.pow(0.5 + 0.5 * Math.sin(2 * Math.PI * state.showPhase), 2);
|
|
449
|
+
}
|
|
450
|
+
h.out = h.level * mod;
|
|
451
|
+
h.col.copy(tmp.base);
|
|
452
|
+
if (tint > 0)
|
|
453
|
+
h.col.lerp(h.phase === 'strike' ? ARC : MERCURY, tint);
|
|
454
|
+
sumOut += h.out;
|
|
455
|
+
sum.r += h.col.r * h.out;
|
|
456
|
+
sum.g += h.col.g * h.out;
|
|
457
|
+
sum.b += h.col.b * h.out;
|
|
458
|
+
});
|
|
459
|
+
const mean = n ? sumOut / n : 0;
|
|
460
|
+
// --- the light: one spot for the bank, carrying the heads' mean output ---
|
|
461
|
+
// (adopt any intensity we didn't write as the new base)
|
|
462
|
+
if (light.intensity !== state.written)
|
|
463
|
+
state.base = light.intensity;
|
|
464
|
+
if (typeof cfg.intensity === 'number')
|
|
465
|
+
state.base = cfg.intensity;
|
|
466
|
+
light.intensity = state.base * mean;
|
|
467
|
+
state.written = light.intensity;
|
|
468
|
+
if (sumOut > 1e-4)
|
|
469
|
+
light.color.setRGB(sum.r / sumOut, sum.g / sumOut, sum.b / sumOut);
|
|
470
|
+
else
|
|
471
|
+
light.color.copy(tmp.base);
|
|
472
|
+
light.distance = num(cfg.distance, 0);
|
|
473
|
+
light.decay = num(cfg.decay, 1);
|
|
474
|
+
light.angle = Math.min(Math.atan(Math.sqrt(tx * tx + ty * ty) * CORNER), Math.PI / 2 - 0.01);
|
|
475
|
+
light.penumbra = 0;
|
|
476
|
+
// Aim: the heads' shared axis, +Z tilted down by `tilt`. The source sits half
|
|
477
|
+
// a metre in front of the lenses — at the bank centre it would light its own
|
|
478
|
+
// visors from centimetres away.
|
|
479
|
+
tmp.axis.set(0, -Math.sin(tilt), Math.cos(tilt));
|
|
480
|
+
light.position.copy(tmp.axis).multiplyScalar(0.5);
|
|
481
|
+
target.position.copy(tmp.axis).multiplyScalar(10);
|
|
482
|
+
if (cfg.housingColor)
|
|
483
|
+
housingMat.color.set(cfg.housingColor);
|
|
484
|
+
// --- fixture instances + lens fill ---
|
|
485
|
+
const f = fixture;
|
|
486
|
+
tmp.q.setFromEuler(tmp.e.set(tilt, 0, 0));
|
|
487
|
+
root.updateMatrixWorld();
|
|
488
|
+
root.getWorldQuaternion(tmp.wq);
|
|
489
|
+
const ws = root.getWorldScale(tmp.ws).x || 1;
|
|
490
|
+
tmp.wq.multiply(tmp.q);
|
|
491
|
+
const axisW = tmp.axis.set(0, 0, 1).applyQuaternion(tmp.wq);
|
|
492
|
+
const rightW = tmp.right.set(1, 0, 0).applyQuaternion(tmp.wq);
|
|
493
|
+
const upW = tmp.up.set(0, 1, 0).applyQuaternion(tmp.wq);
|
|
494
|
+
const camPos = camera.getWorldPosition(tmp.cam);
|
|
495
|
+
const soft = 0.05 + clamp(num(cfg.edgeSoftness, 0.35), 0, 1) * 0.6;
|
|
496
|
+
const apX = HW * 0.5 * ws, apY = HH * 0.5 * ws;
|
|
497
|
+
const lensCol = f.lens.geometry.getAttribute('aCol'), lensGl = f.lens.geometry.getAttribute('aGlare');
|
|
498
|
+
const glowCol = f.glow.geometry.getAttribute('aCol'), glowGl = f.glow.geometry.getAttribute('aGlare');
|
|
499
|
+
const halo = clamp(num(cfg.halo, 1), 0, 2);
|
|
500
|
+
tmp.gm.makeTranslation(0, 0, HD / 2 + 0.01);
|
|
501
|
+
tmp.lm.makeTranslation(0, 0, HD / 2 + 0.002);
|
|
502
|
+
heads.forEach((h, i) => {
|
|
503
|
+
tmp.m.compose(h.pos, tmp.q, tmp.one);
|
|
504
|
+
f.housing.setMatrixAt(i, tmp.m);
|
|
505
|
+
f.glow.setMatrixAt(i, tmp.m2.copy(tmp.m).multiply(tmp.gm));
|
|
506
|
+
f.lens.setMatrixAt(i, tmp.m.multiply(tmp.lm));
|
|
507
|
+
f.yokes.setMatrixAt(i, tmp.ym.makeTranslation(h.pos.x, h.pos.y, h.pos.z));
|
|
508
|
+
// the eye in this head's beam frame: how deep into the rectangle it stands
|
|
509
|
+
const o = root.localToWorld(tmp.o.copy(h.pos).add(tmp.v.set(0, 0, HD / 2).applyQuaternion(tmp.q)));
|
|
510
|
+
const q = tmp.v.copy(camPos).sub(o);
|
|
511
|
+
const z = q.dot(axisW);
|
|
512
|
+
let g = 0;
|
|
513
|
+
if (z > 0) {
|
|
514
|
+
const u = Math.abs(q.dot(rightW)) / (z * tx + apX), v = Math.abs(q.dot(upW)) / (z * ty + apY);
|
|
515
|
+
g = (1 - smooth(1 - soft, 1.15, u)) * (1 - smooth(1 - soft, 1.15, v)) * smooth(0, 2, z);
|
|
516
|
+
}
|
|
517
|
+
// what the lens shows, plus the cooling arc tube's ember
|
|
518
|
+
lensCol.setXYZ(i, h.col.r * h.out + EMBER.r * h.ember * 0.5, h.col.g * h.out + EMBER.g * h.ember * 0.5, h.col.b * h.out + EMBER.b * h.ember * 0.5);
|
|
519
|
+
lensGl.setX(i, g);
|
|
520
|
+
// the glow shows only from in front of the lens plane
|
|
521
|
+
const facing = smooth(0.0, 0.25, z / Math.max(q.length(), 1e-4));
|
|
522
|
+
const gk = h.out * halo * facing;
|
|
523
|
+
glowCol.setXYZ(i, h.col.r * gk, h.col.g * gk, h.col.b * gk);
|
|
524
|
+
glowGl.setX(i, g);
|
|
525
|
+
});
|
|
526
|
+
f.housing.instanceMatrix.needsUpdate = f.lens.instanceMatrix.needsUpdate = f.yokes.instanceMatrix.needsUpdate = f.glow.instanceMatrix.needsUpdate = true;
|
|
527
|
+
lensCol.needsUpdate = lensGl.needsUpdate = glowCol.needsUpdate = glowGl.needsUpdate = true;
|
|
528
|
+
glowMat.uniforms.uRightW.value.copy(rightW);
|
|
529
|
+
f.glow.visible = halo > 0;
|
|
530
|
+
}
|
|
531
|
+
function dispose() {
|
|
532
|
+
disposeFixture();
|
|
533
|
+
for (const g of Object.values(geo))
|
|
534
|
+
g.dispose();
|
|
535
|
+
housingMat.dispose();
|
|
536
|
+
frameMat.dispose();
|
|
537
|
+
lensMat.dispose();
|
|
538
|
+
glowMat.dispose();
|
|
539
|
+
mask?.dispose();
|
|
540
|
+
}
|
|
541
|
+
const first = { ...DEFAULTS, ...cfg0 };
|
|
542
|
+
rebuild(first);
|
|
543
|
+
key = KEY_OF(first);
|
|
544
|
+
return { root, light, update, dispose, heads };
|
|
545
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BallSportsConfig } from '@3driseai/3drise-core';
|
|
3
|
+
import type { SportsVariantProps } from './useSportsInstance';
|
|
4
|
+
export interface SportsBallProps extends SportsVariantProps {
|
|
5
|
+
config: BallSportsConfig;
|
|
6
|
+
}
|
|
7
|
+
declare const SportsBall: React.FC<SportsBallProps>;
|
|
8
|
+
export default SportsBall;
|
|
9
|
+
//# sourceMappingURL=SportsBall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SportsBall.d.ts","sourceRoot":"","sources":["../../../src/components/sports/SportsBall.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAc,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAmB1E,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACvD,MAAM,EAAE,gBAAgB,CAAC;CAC5B;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAOzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_SPORTS_OBJECTS, SPORTS_OBJECTS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
3
|
+
import { useSportsInstance } from './useSportsInstance.js';
|
|
4
|
+
import { createUniforms, build, STRUCTURAL } from './core/ball.js';
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// SportsBall — Ball (type 'sports', config.type 'ball')
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// A ball at its real size with its true panel geometry and seams: football, basketball, tennis, baseball, volleyball, rugby, American football, golf, cricket, bowling or beach ball, with leather, felt, rubber or resin surfaces, grooved seams, stitches, dimples and wear. Use for sports scenes, product shots, playgrounds and still lifes.
|
|
9
|
+
// The construction lives in core/ball.ts (emitted from the lab); this component wires it into
|
|
10
|
+
// the config pattern through useSportsInstance.
|
|
11
|
+
const CORE = {
|
|
12
|
+
DEFAULTS: DEFAULT_SPORTS_OBJECTS.ball,
|
|
13
|
+
STRUCTURAL,
|
|
14
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push applies. */
|
|
15
|
+
ANIMATABLE: new Set(SPORTS_OBJECTS_ANIMATABLE.ball.map((p) => p.value)),
|
|
16
|
+
createUniforms,
|
|
17
|
+
build,
|
|
18
|
+
};
|
|
19
|
+
const SportsBall = (props) => {
|
|
20
|
+
const { rootRef, instance } = useSportsInstance(CORE, props);
|
|
21
|
+
return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
|
|
22
|
+
};
|
|
23
|
+
export default SportsBall;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CourtSportsConfig } from '@3driseai/3drise-core';
|
|
3
|
+
import type { SportsVariantProps } from './useSportsInstance';
|
|
4
|
+
export interface SportsCourtProps extends SportsVariantProps {
|
|
5
|
+
config: CourtSportsConfig;
|
|
6
|
+
}
|
|
7
|
+
declare const SportsCourt: React.FC<SportsCourtProps>;
|
|
8
|
+
export default SportsCourt;
|
|
9
|
+
//# sourceMappingURL=SportsCourt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SportsCourt.d.ts","sourceRoot":"","sources":["../../../src/components/sports/SportsCourt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,KAAK,EAAc,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAmB1E,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IACxD,MAAM,EAAE,iBAAiB,CAAC;CAC7B;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAO3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_SPORTS_OBJECTS, SPORTS_OBJECTS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
3
|
+
import { useSportsInstance } from './useSportsInstance.js';
|
|
4
|
+
import { createUniforms, build, STRUCTURAL } from './core/court.js';
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// SportsCourt — Court (type 'sports', config.type 'court')
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// A regulation playing surface with every rulebook line drawn sharp at any distance: tennis, basketball, soccer, American football, futsal, handball, volleyball, badminton, padel, pickleball, ice hockey rink, athletics track or table-tennis table, on acrylic, clay, grass, parquet, ice, tartan, turf or sand, with its nets, goals or hoops. Use for sports venues, parks, schools, product scenes and arenas.
|
|
9
|
+
// The construction lives in core/court.ts (emitted from the lab); this component wires it into
|
|
10
|
+
// the config pattern through useSportsInstance.
|
|
11
|
+
const CORE = {
|
|
12
|
+
DEFAULTS: DEFAULT_SPORTS_OBJECTS.court,
|
|
13
|
+
STRUCTURAL,
|
|
14
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push applies. */
|
|
15
|
+
ANIMATABLE: new Set(SPORTS_OBJECTS_ANIMATABLE.court.map((p) => p.value)),
|
|
16
|
+
createUniforms,
|
|
17
|
+
build,
|
|
18
|
+
};
|
|
19
|
+
const SportsCourt = (props) => {
|
|
20
|
+
const { rootRef, instance } = useSportsInstance(CORE, props);
|
|
21
|
+
return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
|
|
22
|
+
};
|
|
23
|
+
export default SportsCourt;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EquipmentSportsConfig } from '@3driseai/3drise-core';
|
|
3
|
+
import type { SportsVariantProps } from './useSportsInstance';
|
|
4
|
+
export interface SportsEquipmentProps extends SportsVariantProps {
|
|
5
|
+
config: EquipmentSportsConfig;
|
|
6
|
+
}
|
|
7
|
+
declare const SportsEquipment: React.FC<SportsEquipmentProps>;
|
|
8
|
+
export default SportsEquipment;
|
|
9
|
+
//# sourceMappingURL=SportsEquipment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SportsEquipment.d.ts","sourceRoot":"","sources":["../../../src/components/sports/SportsEquipment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAc,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAmB1E,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC5D,MAAM,EAAE,qBAAqB,CAAC;CACjC;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAOnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_SPORTS_OBJECTS, SPORTS_OBJECTS_ANIMATABLE } from '@3driseai/3drise-core';
|
|
3
|
+
import { useSportsInstance } from './useSportsInstance.js';
|
|
4
|
+
import { createUniforms, build, STRUCTURAL } from './core/equipment.js';
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// SportsEquipment — Equipment (type 'sports', config.type 'equipment')
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// A piece of sports equipment at real size, built from its parts: tennis or badminton racquet with a strung bed, table-tennis paddle, baseball or cricket bat, golf driver, iron or putter, hockey stick, skateboard, dumbbell, kettlebell, barbell with plates, or frisbee, in wood, steel, carbon, rubber and leather with wear. Use for gyms, sports shops, locker rooms, product shots and lifestyle scenes.
|
|
9
|
+
// The construction lives in core/equipment.ts (emitted from the lab); this component wires it into
|
|
10
|
+
// the config pattern through useSportsInstance.
|
|
11
|
+
const CORE = {
|
|
12
|
+
DEFAULTS: DEFAULT_SPORTS_OBJECTS.equipment,
|
|
13
|
+
STRUCTURAL,
|
|
14
|
+
/** Knobs a keyframe or pointer binding may drive per frame — exactly what the push applies. */
|
|
15
|
+
ANIMATABLE: new Set(SPORTS_OBJECTS_ANIMATABLE.equipment.map((p) => p.value)),
|
|
16
|
+
createUniforms,
|
|
17
|
+
build,
|
|
18
|
+
};
|
|
19
|
+
const SportsEquipment = (props) => {
|
|
20
|
+
const { rootRef, instance } = useSportsInstance(CORE, props);
|
|
21
|
+
return (_jsx("group", { ref: rootRef, children: _jsx("primitive", { object: instance.object }) }));
|
|
22
|
+
};
|
|
23
|
+
export default SportsEquipment;
|