@pascal-app/viewer 1.0.3 → 1.0.4
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/components/renderers/node-renderer.d.ts.map +1 -1
- package/dist/components/renderers/node-renderer.js +8 -3
- package/dist/components/viewer/frame-limiter.d.ts +1 -0
- package/dist/components/viewer/frame-limiter.d.ts.map +1 -1
- package/dist/components/viewer/frame-limiter.js +22 -3
- package/dist/components/viewer/glb-interactive.d.ts +25 -1
- package/dist/components/viewer/glb-interactive.d.ts.map +1 -1
- package/dist/components/viewer/glb-interactive.js +252 -85
- package/dist/components/viewer/glb-mechanisms.d.ts +10 -0
- package/dist/components/viewer/glb-mechanisms.d.ts.map +1 -0
- package/dist/components/viewer/glb-mechanisms.js +19 -0
- package/dist/components/viewer/glb-scene.d.ts +45 -27
- package/dist/components/viewer/glb-scene.d.ts.map +1 -1
- package/dist/components/viewer/glb-scene.js +420 -506
- package/dist/components/viewer/glb-walkthrough-controller.d.ts +1 -1
- package/dist/components/viewer/glb-walkthrough-controller.d.ts.map +1 -1
- package/dist/components/viewer/glb-walkthrough-controller.js +12 -1
- package/dist/components/viewer/index.d.ts +14 -0
- package/dist/components/viewer/index.d.ts.map +1 -1
- package/dist/components/viewer/index.js +84 -26
- package/dist/components/viewer/lights.d.ts.map +1 -1
- package/dist/components/viewer/lights.js +6 -1
- package/dist/components/viewer/perf-monitor.d.ts.map +1 -1
- package/dist/components/viewer/perf-monitor.js +6 -0
- package/dist/components/viewer/post-processing.d.ts.map +1 -1
- package/dist/components/viewer/post-processing.js +8 -3
- package/dist/components/viewer/registered-systems.d.ts.map +1 -1
- package/dist/components/viewer/registered-systems.js +16 -2
- package/dist/components/viewer/render-error.d.ts +18 -0
- package/dist/components/viewer/render-error.d.ts.map +1 -0
- package/dist/components/viewer/render-error.js +29 -0
- package/dist/components/viewer/scene-ground-replacement.d.ts +6 -0
- package/dist/components/viewer/scene-ground-replacement.d.ts.map +1 -1
- package/dist/components/viewer/scene-ground-replacement.js +15 -0
- package/dist/components/viewer/selection-manager.d.ts.map +1 -1
- package/dist/components/viewer/selection-manager.js +10 -0
- package/dist/components/viewer/viewer-camera.d.ts +4 -0
- package/dist/components/viewer/viewer-camera.d.ts.map +1 -1
- package/dist/components/viewer/viewer-camera.js +11 -1
- package/dist/index.d.ts +22 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -14
- package/dist/lib/asset-url.d.ts.map +1 -1
- package/dist/lib/asset-url.js +7 -1
- package/dist/lib/display-state.d.ts +25 -0
- package/dist/lib/display-state.d.ts.map +1 -0
- package/dist/lib/display-state.js +1 -0
- package/dist/lib/hero-pose.d.ts +12 -2
- package/dist/lib/hero-pose.d.ts.map +1 -1
- package/dist/lib/hero-pose.js +72 -5
- package/dist/lib/ink-edges.d.ts +4 -2
- package/dist/lib/ink-edges.d.ts.map +1 -1
- package/dist/lib/ink-edges.js +17 -7
- package/dist/lib/key-light-override.d.ts +11 -0
- package/dist/lib/key-light-override.d.ts.map +1 -0
- package/dist/lib/key-light-override.js +14 -0
- package/dist/lib/live-frame-hold.d.ts +14 -0
- package/dist/lib/live-frame-hold.d.ts.map +1 -0
- package/dist/lib/live-frame-hold.js +28 -0
- package/dist/lib/materials.d.ts +14 -7
- package/dist/lib/materials.d.ts.map +1 -1
- package/dist/lib/materials.js +31 -5
- package/dist/lib/node-top-surface-height.d.ts +6 -0
- package/dist/lib/node-top-surface-height.d.ts.map +1 -0
- package/dist/lib/node-top-surface-height.js +74 -0
- package/dist/lib/perf-probe-state.d.ts +39 -0
- package/dist/lib/perf-probe-state.d.ts.map +1 -0
- package/dist/lib/perf-probe-state.js +17 -0
- package/dist/lib/pointer-events.d.ts +8 -0
- package/dist/lib/pointer-events.d.ts.map +1 -1
- package/dist/lib/pointer-events.js +27 -4
- package/dist/lib/procedural-emission.d.ts +7 -0
- package/dist/lib/procedural-emission.d.ts.map +1 -0
- package/dist/lib/procedural-emission.js +54 -0
- package/dist/lib/scene-support-height.d.ts +4 -0
- package/dist/lib/scene-support-height.d.ts.map +1 -0
- package/dist/lib/scene-support-height.js +34 -0
- package/dist/lib/scene-visibility.d.ts +6 -0
- package/dist/lib/scene-visibility.d.ts.map +1 -1
- package/dist/lib/scene-visibility.js +15 -3
- package/dist/lib/scripted-opening.d.ts +11 -0
- package/dist/lib/scripted-opening.d.ts.map +1 -0
- package/dist/lib/scripted-opening.js +20 -0
- package/dist/lib/snapshot-pipeline.d.ts +32 -2
- package/dist/lib/snapshot-pipeline.d.ts.map +1 -1
- package/dist/lib/snapshot-pipeline.js +215 -105
- package/dist/lib/terrain-perimeter-fill.d.ts.map +1 -1
- package/dist/lib/terrain-perimeter-fill.js +22 -14
- package/dist/lib/zone-geometry.d.ts +11 -0
- package/dist/lib/zone-geometry.d.ts.map +1 -0
- package/dist/lib/zone-geometry.js +46 -0
- package/dist/store/use-item-light-pool.d.ts +14 -10
- package/dist/store/use-item-light-pool.d.ts.map +1 -1
- package/dist/store/use-item-light-pool.js +52 -26
- package/dist/store/use-viewer.d.ts +11 -0
- package/dist/store/use-viewer.d.ts.map +1 -1
- package/dist/store/use-viewer.js +13 -6
- package/dist/systems/ceiling/ceiling-system.d.ts +15 -1
- package/dist/systems/ceiling/ceiling-system.d.ts.map +1 -1
- package/dist/systems/ceiling/ceiling-system.js +86 -6
- package/dist/systems/door/door-system.d.ts.map +1 -1
- package/dist/systems/door/door-system.js +55 -17
- package/dist/systems/floor-elevation/floor-elevation-system.d.ts +3 -1
- package/dist/systems/floor-elevation/floor-elevation-system.d.ts.map +1 -1
- package/dist/systems/floor-elevation/floor-elevation-system.js +33 -5
- package/dist/systems/geometry/geometry-system.d.ts.map +1 -1
- package/dist/systems/geometry/geometry-system.js +71 -11
- package/dist/systems/interactive/interactive-system.d.ts.map +1 -1
- package/dist/systems/interactive/interactive-system.js +40 -15
- package/dist/systems/interactive/procedural-controls.d.ts +13 -0
- package/dist/systems/interactive/procedural-controls.d.ts.map +1 -0
- package/dist/systems/interactive/procedural-controls.js +17 -0
- package/dist/systems/interactive/scripted-clips.d.ts +19 -0
- package/dist/systems/interactive/scripted-clips.d.ts.map +1 -0
- package/dist/systems/interactive/scripted-clips.js +134 -0
- package/dist/systems/item/item-system.d.ts.map +1 -1
- package/dist/systems/item/item-system.js +9 -3
- package/dist/systems/item/object-cut-invalidation.d.ts +3 -0
- package/dist/systems/item/object-cut-invalidation.d.ts.map +1 -0
- package/dist/systems/item/object-cut-invalidation.js +68 -0
- package/dist/systems/item-light/item-light-system.d.ts +1 -1
- package/dist/systems/item-light/item-light-system.d.ts.map +1 -1
- package/dist/systems/item-light/item-light-system.js +47 -52
- package/dist/systems/level/level-system.d.ts.map +1 -1
- package/dist/systems/level/level-system.js +3 -5
- package/dist/systems/level/level-utils.d.ts +7 -4
- package/dist/systems/level/level-utils.d.ts.map +1 -1
- package/dist/systems/level/level-utils.js +17 -6
- package/dist/systems/level/shadow-only-levels.d.ts +9 -0
- package/dist/systems/level/shadow-only-levels.d.ts.map +1 -0
- package/dist/systems/level/shadow-only-levels.js +7 -0
- package/dist/systems/roof/roof-materials.d.ts +14 -2
- package/dist/systems/roof/roof-materials.d.ts.map +1 -1
- package/dist/systems/roof/roof-materials.js +54 -15
- package/dist/systems/roof/roof-system.d.ts +13 -3
- package/dist/systems/roof/roof-system.d.ts.map +1 -1
- package/dist/systems/roof/roof-system.js +188 -13
- package/dist/systems/slab/slab-system.d.ts +1 -1
- package/dist/systems/slab/slab-system.d.ts.map +1 -1
- package/dist/systems/slab/slab-system.js +49 -19
- package/dist/systems/stair/stair-system.d.ts.map +1 -1
- package/dist/systems/stair/stair-system.js +133 -354
- package/dist/systems/wall/wall-cutout-cache.d.ts +7 -0
- package/dist/systems/wall/wall-cutout-cache.d.ts.map +1 -1
- package/dist/systems/wall/wall-cutout-cache.js +46 -17
- package/dist/systems/wall/wall-cutout.d.ts +6 -0
- package/dist/systems/wall/wall-cutout.d.ts.map +1 -1
- package/dist/systems/wall/wall-cutout.js +42 -28
- package/dist/systems/wall/wall-finish-data.d.ts +22 -0
- package/dist/systems/wall/wall-finish-data.d.ts.map +1 -0
- package/dist/systems/wall/wall-finish-data.js +17 -0
- package/dist/systems/wall/wall-materials.d.ts +9 -4
- package/dist/systems/wall/wall-materials.d.ts.map +1 -1
- package/dist/systems/wall/wall-materials.js +99 -152
- package/dist/systems/wall/wall-system.d.ts +28 -2
- package/dist/systems/wall/wall-system.d.ts.map +1 -1
- package/dist/systems/wall/wall-system.js +582 -143
- package/dist/systems/window/window-system.d.ts +1 -1
- package/dist/systems/window/window-system.d.ts.map +1 -1
- package/dist/systems/window/window-system.js +41 -22
- package/package.json +5 -5
- package/dist/systems/fence/fence-system.d.ts +0 -22
- package/dist/systems/fence/fence-system.d.ts.map +0 -1
- package/dist/systems/fence/fence-system.js +0 -357
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export type { SurfaceRole } from '@pascal-app/core';
|
|
2
2
|
export { ErrorBoundary } from './components/error-boundary';
|
|
3
3
|
export { NodeRenderer } from './components/renderers/node-renderer';
|
|
4
|
-
export { default as Viewer, type ViewerHandle, type ViewerImmersiveSession, } from './components/viewer';
|
|
4
|
+
export { default as Viewer, pendingSceneBuildCount, type ViewerHandle, type ViewerImmersiveSession, } from './components/viewer';
|
|
5
5
|
export { type BVHEcctrlApi, default as BVHEcctrl, type MovementInput, } from './components/viewer/bvh-ecctrl';
|
|
6
6
|
export { buildGlbInteractiveItems, GlbInteractive, type GlbInteractiveItem, } from './components/viewer/glb-interactive';
|
|
7
7
|
export { buildGlbReferenceNodes, buildGlbReplaceNodes, } from './components/viewer/glb-reference-nodes';
|
|
8
|
-
export { type
|
|
8
|
+
export { type GlbPickEvent, GlbScene, type GlbWalkthrough, resolveGlbPick, } from './components/viewer/glb-scene';
|
|
9
9
|
export { CROUCH_CAPSULE, CROUCH_EYE_OFFSET, CROUCH_FLOAT_HEIGHT, CROUCH_RUN_SPEED, CROUCH_WALK_SPEED, EYE_LERP_SPEED, GlbWalkthroughController, STAND_CAPSULE, STAND_CLEARANCE, STAND_FLOAT_HEIGHT, WALKTHROUGH_FOV, } from './components/viewer/glb-walkthrough-controller';
|
|
10
10
|
export type { HoverStyle, HoverStyles } from './components/viewer/post-processing';
|
|
11
11
|
export { DEFAULT_HOVER_STYLES, SSGI_PARAMS, } from './components/viewer/post-processing';
|
|
12
12
|
export { SceneAtmosphere, type SceneAtmosphereSource, useSceneAtmosphere, } from './components/viewer/scene-atmosphere';
|
|
13
13
|
export { SceneEnvironment } from './components/viewer/scene-environment';
|
|
14
|
-
export { SceneGroundReplacement, useSceneGroundReplacement, } from './components/viewer/scene-ground-replacement';
|
|
14
|
+
export { claimSceneGround, SceneGroundReplacement, useSceneGroundReplacement, } from './components/viewer/scene-ground-replacement';
|
|
15
|
+
export { applyWalkthroughCameraClipping } from './components/viewer/viewer-camera';
|
|
15
16
|
export { isViewerPresentationTextureBorrowed, markViewerPresentationTextureBorrowed, registerViewerPresentation, type ViewerPresentationConfiguration, type ViewerPresentationContribution, type ViewerPresentationExportContext, type ViewerPresentationStaticExport, ViewerPresentations, viewerPresentationRegistry, } from './components/viewer/viewer-presentations';
|
|
16
17
|
export { useAssetUrl } from './hooks/use-asset-url';
|
|
17
18
|
export { useGLTFKTX2 } from './hooks/use-gltf-ktx2';
|
|
@@ -21,43 +22,52 @@ export { ASSETS_CDN_URL, resolveAssetUrl, resolveCdnUrl } from './lib/asset-url'
|
|
|
21
22
|
export { backdropGradient, deepSkyColor, horizonHazeColor } from './lib/backdrop';
|
|
22
23
|
export { applyWorldScaleBoxUVs } from './lib/box-uv';
|
|
23
24
|
export { ADDITION, Brush, computeGeometryBoundsTree, csgEvaluator, csgGeometry, csgMaterials, Evaluator, ensureRenderableGeometryAttributes, INTERSECTION, prepareBrushForCSG, SUBTRACTION, } from './lib/csg-utils';
|
|
25
|
+
export type { DisplayState } from './lib/display-state';
|
|
24
26
|
export { disposeObject3DResources } from './lib/dispose-object3d';
|
|
25
27
|
export type { EdgeMode } from './lib/edge-style';
|
|
26
28
|
export { PERF_OVERLAY_ENABLED } from './lib/gpu-perf';
|
|
27
29
|
export { computeHeroFraming, DEFAULT_FRAMING_EXCLUDED_TYPES, type HeroFraming, heroCameraPose, temporarilyHideNodeTypes, unionRegisteredNodeBounds, } from './lib/hero-pose';
|
|
28
30
|
export { applyIsolation, clearIsolation, collectIsolationSubtree, isIsolationActive, refreshIsolation, } from './lib/isolation';
|
|
31
|
+
export { setKeyLightDirectionOverride } from './lib/key-light-override';
|
|
29
32
|
export { configureKtx2Support, ensureKtx2Support } from './lib/ktx2-loader';
|
|
30
33
|
export { LayerPassIndex } from './lib/layer-pass';
|
|
31
34
|
export { BATCHED_LAYER, GRID_LAYER, OVERLAY_LAYER, SCENE_LAYER, SHADOW_ONLY_LAYER, setSurfaceRaycastLayers, ZONE_LAYER, } from './lib/layers';
|
|
32
|
-
export {
|
|
35
|
+
export { holdLiveFrame } from './lib/live-frame-hold';
|
|
36
|
+
export { applyMaterialPresetToMaterials, BLUEPRINT_PALETTE, baseMaterial, CLAY_PALETTE, type ColorPreset, clearMaterialCache, createDefaultMaterial, createMaterial, createMaterialFromPresetRef, createSurfaceRoleMaterial, DEFAULT_CEILING_MATERIAL, DEFAULT_DOOR_MATERIAL, DEFAULT_ROOF_MATERIAL, DEFAULT_SHELF_MATERIAL, DEFAULT_SLAB_MATERIAL, DEFAULT_STAIR_MATERIAL, DEFAULT_WALL_MATERIAL, DEFAULT_WINDOW_MATERIAL, disposeMaterial, glassMaterial, MONO_PALETTE, materialCastsShadow, PRESET_PALETTES, type RenderShading, registerMaterialCacheCleanup, resolveMaterialRef, resolveSlotDefaultMaterial, resolveSurfaceColor, setSlotDefaultOverrides, WHITE_PALETTE, } from './lib/materials';
|
|
33
37
|
export { mergedOutline } from './lib/merged-outline-node';
|
|
38
|
+
export { createNodeTopSurfaceHeightSampler } from './lib/node-top-surface-height';
|
|
34
39
|
export * from './lib/perf-actions';
|
|
35
40
|
export { type PerfBatchStats, publishPerfBatchStats } from './lib/perf-panel-store';
|
|
36
41
|
export * from './lib/perf-tracks';
|
|
37
|
-
export { markPureRaycast } from './lib/pointer-events';
|
|
42
|
+
export { hasMaterialsForGroups, markPureRaycast } from './lib/pointer-events';
|
|
43
|
+
export { cloneWithProceduralEmission, decorateProceduralEmission, proceduralSlotMeshes, setProceduralEmission, } from './lib/procedural-emission';
|
|
38
44
|
export { detectRendererCapability, initializeGpuRenderer, type RendererBackendParameters, type RendererCapability, type RendererCapabilityCanvas, type RendererInitializationResult, type RendererPowerPreference, } from './lib/renderer-capability';
|
|
45
|
+
export { createSceneSupportHeightSampler } from './lib/scene-support-height';
|
|
39
46
|
export { getSceneTheme, SCENE_THEME_IDS, SCENE_THEMES, type SceneTheme, } from './lib/scene-themes';
|
|
40
|
-
export { type HiddenReason, hideFromScene, showInScene, temporarilyShowShadowOnly, } from './lib/scene-visibility';
|
|
41
|
-
export {
|
|
47
|
+
export { type HiddenReason, hideFromScene, showInScene, temporarilyShowPresentation, temporarilyShowShadowOnly, } from './lib/scene-visibility';
|
|
48
|
+
export { SCRIPTED_MODEL_FLAG } from './lib/scripted-opening';
|
|
49
|
+
export { createPlainSnapshotPipeline, createSnapshotPipeline, SNAPSHOT_MAX_EDGE, SNAPSHOT_MIME, SNAPSHOT_QUALITY, type SnapshotCaptureMode, type SnapshotCaptureResult, type SnapshotCropRegion, type SnapshotPipeline, type SnapshotSize, type StudioBackdrop, THUMBNAIL_HEIGHT, THUMBNAIL_WIDTH, } from './lib/snapshot-pipeline';
|
|
42
50
|
export { buildTerrainPerimeterFillGeometry, type TerrainPerimeterPoint, } from './lib/terrain-perimeter-fill';
|
|
43
51
|
export { getPascalTextureRef, type PascalTextureColorSpace, type PascalTextureMap, type PascalTextureRef, stampPascalTextureRef, textureMapForSlot, } from './lib/texture-reference';
|
|
44
52
|
export { packNormalToRGB, unpackRGBToNormal } from './lib/tsl-compat';
|
|
45
|
-
export {
|
|
53
|
+
export { createZoneShape, createZoneWallGeometry } from './lib/zone-geometry';
|
|
54
|
+
export type { LightSource } from './store/use-item-light-pool';
|
|
55
|
+
export { catalogLightSource, useItemLightPool } from './store/use-item-light-pool';
|
|
46
56
|
export { applyCountryUnitDefault, default as useViewer, type MetricNotation, type WallMode, } from './store/use-viewer';
|
|
47
|
-
export { CeilingSystem } from './systems/ceiling/ceiling-system';
|
|
57
|
+
export { CEILING_REGION_MESH, type CeilingRegionMaterial, CeilingSystem, } from './systems/ceiling/ceiling-system';
|
|
48
58
|
export { createColumnBoxGeometry, createColumnCylinderGeometry, createColumnSphereGeometry, createColumnTorusGeometry, } from './systems/column/column-geometry';
|
|
49
59
|
export { DoorAnimationSystem } from './systems/door/door-animation-system';
|
|
50
60
|
export { buildDoorPreviewMesh, DoorSystem, poseDoorMovingParts } from './systems/door/door-system';
|
|
51
61
|
export { ElevatorInteractionSystem } from './systems/elevator/elevator-interaction-system';
|
|
52
|
-
export { FenceSystem, generateFenceGeometry, generateFenceSlotGeometries, } from './systems/fence/fence-system';
|
|
53
62
|
export { FloorElevationSystem } from './systems/floor-elevation/floor-elevation-system';
|
|
54
63
|
export { GuideSystem } from './systems/guide/guide-system';
|
|
55
64
|
export { InteractiveSystem } from './systems/interactive/interactive-system';
|
|
65
|
+
export { type ScriptedClipActions, ScriptedClips, useClipActions, } from './systems/interactive/scripted-clips';
|
|
56
66
|
export { ItemSystem } from './systems/item/item-system';
|
|
57
67
|
export { ItemLightSystem } from './systems/item-light/item-light-system';
|
|
58
68
|
export { LevelSystem } from './systems/level/level-system';
|
|
59
69
|
export { EXPLODED_GAP, getLevelPresentationY, snapLevelsToTruePositions, } from './systems/level/level-utils';
|
|
60
|
-
export { getRoofMaterialArray } from './systems/roof/roof-materials';
|
|
70
|
+
export { getRoofMaterialArray, levelWallCladdingRef } from './systems/roof/roof-materials';
|
|
61
71
|
export { clipGeometryBySegmentTrim, generateRoofSegmentGeometry, getRoofOuterSurfaceFrameAtPoint, getRoofSegmentBrushes, mapRoofGroupMaterialIndex, ROOF_MATERIAL_SLOT_COUNT, RoofSystem, remapRoofShellFaces, roofCsgDummyMats, type SurfaceFrame, } from './systems/roof/roof-system';
|
|
62
72
|
export { ScanSystem } from './systems/scan/scan-system';
|
|
63
73
|
export { generateSlabGeometry } from './systems/slab/slab-system';
|
|
@@ -66,6 +76,7 @@ export { StairSystem } from './systems/stair/stair-system';
|
|
|
66
76
|
export { buildOpeningCutoutGeometry, buildOpeningCutoutShape, getOpeningCutoutBottomPadding, hasFlatOpeningCutoutBottom, } from './systems/wall/opening-cutout-geometry';
|
|
67
77
|
export { getWallHideState, WallCutout } from './systems/wall/wall-cutout';
|
|
68
78
|
export { WallCutoutCache, type WallCutoutViewerState, type WallCutoutViewerStore, } from './systems/wall/wall-cutout-cache';
|
|
79
|
+
export { getWallFaceBaseAt, getWallFinishData, getWallFinishRefs, type WallFinishGeometryData, } from './systems/wall/wall-finish-data';
|
|
69
80
|
export { getMaterialsForWall, getVisibleWallMaterials, type WallMaterialOverride, type WallMaterials, type WallMaterialsResolver, } from './systems/wall/wall-materials';
|
|
70
81
|
export { drainRebuiltWalls, generateExtrudedWall, getPendingWallRebuildCount, isWallInitialBuildActive, runWallBuildFrame, type WallGeometryAdapter, type WallGeometryAdapterContext, WallSystem, } from './systems/wall/wall-system';
|
|
71
82
|
export { poseWindowMovingParts, WindowAnimationSystem, } from './systems/window/window-animation-system';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAO3D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACnE,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,KAAK,YAAY,EACjB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,KAAK,YAAY,EACjB,OAAO,IAAI,SAAS,EACpB,KAAK,aAAa,GACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,KAAK,kBAAkB,GACxB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAO3D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACnE,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,sBAAsB,EACtB,KAAK,YAAY,EACjB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,KAAK,YAAY,EACjB,OAAO,IAAI,SAAS,EACpB,KAAK,aAAa,GACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,KAAK,kBAAkB,GACxB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EACL,KAAK,YAAY,EACjB,QAAQ,EACR,KAAK,cAAc,EACnB,cAAc,GACf,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,gDAAgD,CAAA;AACvD,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAClF,OAA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M,gCAAgC,CAAA;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -10,16 +10,17 @@ export { ErrorBoundary } from './components/error-boundary';
|
|
|
10
10
|
// `@pascal-app/nodes/<kind>/renderer.tsx` and are loaded by the registry
|
|
11
11
|
// — no per-kind re-exports needed.
|
|
12
12
|
export { NodeRenderer } from './components/renderers/node-renderer';
|
|
13
|
-
export { default as Viewer, } from './components/viewer';
|
|
13
|
+
export { default as Viewer, pendingSceneBuildCount, } from './components/viewer';
|
|
14
14
|
export { default as BVHEcctrl, } from './components/viewer/bvh-ecctrl';
|
|
15
15
|
export { buildGlbInteractiveItems, GlbInteractive, } from './components/viewer/glb-interactive';
|
|
16
16
|
export { buildGlbReferenceNodes, buildGlbReplaceNodes, } from './components/viewer/glb-reference-nodes';
|
|
17
|
-
export { GlbScene, } from './components/viewer/glb-scene';
|
|
17
|
+
export { GlbScene, resolveGlbPick, } from './components/viewer/glb-scene';
|
|
18
18
|
export { CROUCH_CAPSULE, CROUCH_EYE_OFFSET, CROUCH_FLOAT_HEIGHT, CROUCH_RUN_SPEED, CROUCH_WALK_SPEED, EYE_LERP_SPEED, GlbWalkthroughController, STAND_CAPSULE, STAND_CLEARANCE, STAND_FLOAT_HEIGHT, WALKTHROUGH_FOV, } from './components/viewer/glb-walkthrough-controller';
|
|
19
19
|
export { DEFAULT_HOVER_STYLES, SSGI_PARAMS, } from './components/viewer/post-processing';
|
|
20
20
|
export { SceneAtmosphere, useSceneAtmosphere, } from './components/viewer/scene-atmosphere';
|
|
21
21
|
export { SceneEnvironment } from './components/viewer/scene-environment';
|
|
22
|
-
export { SceneGroundReplacement, useSceneGroundReplacement, } from './components/viewer/scene-ground-replacement';
|
|
22
|
+
export { claimSceneGround, SceneGroundReplacement, useSceneGroundReplacement, } from './components/viewer/scene-ground-replacement';
|
|
23
|
+
export { applyWalkthroughCameraClipping } from './components/viewer/viewer-camera';
|
|
23
24
|
export { isViewerPresentationTextureBorrowed, markViewerPresentationTextureBorrowed, registerViewerPresentation, ViewerPresentations, viewerPresentationRegistry, } from './components/viewer/viewer-presentations';
|
|
24
25
|
export { useAssetUrl } from './hooks/use-asset-url';
|
|
25
26
|
export { useGLTFKTX2 } from './hooks/use-gltf-ktx2';
|
|
@@ -36,33 +37,36 @@ export { disposeObject3DResources } from './lib/dispose-object3d';
|
|
|
36
37
|
export { PERF_OVERLAY_ENABLED } from './lib/gpu-perf';
|
|
37
38
|
export { computeHeroFraming, DEFAULT_FRAMING_EXCLUDED_TYPES, heroCameraPose, temporarilyHideNodeTypes, unionRegisteredNodeBounds, } from './lib/hero-pose';
|
|
38
39
|
export { applyIsolation, clearIsolation, collectIsolationSubtree, isIsolationActive, refreshIsolation, } from './lib/isolation';
|
|
40
|
+
export { setKeyLightDirectionOverride } from './lib/key-light-override';
|
|
39
41
|
export { configureKtx2Support, ensureKtx2Support } from './lib/ktx2-loader';
|
|
40
42
|
export { LayerPassIndex } from './lib/layer-pass';
|
|
41
43
|
export { BATCHED_LAYER, GRID_LAYER, OVERLAY_LAYER, SCENE_LAYER, SHADOW_ONLY_LAYER, setSurfaceRaycastLayers, ZONE_LAYER, } from './lib/layers';
|
|
42
|
-
export {
|
|
44
|
+
export { holdLiveFrame } from './lib/live-frame-hold';
|
|
45
|
+
export { applyMaterialPresetToMaterials, BLUEPRINT_PALETTE, baseMaterial, CLAY_PALETTE, clearMaterialCache, createDefaultMaterial, createMaterial, createMaterialFromPresetRef, createSurfaceRoleMaterial, DEFAULT_CEILING_MATERIAL, DEFAULT_DOOR_MATERIAL, DEFAULT_ROOF_MATERIAL, DEFAULT_SHELF_MATERIAL, DEFAULT_SLAB_MATERIAL, DEFAULT_STAIR_MATERIAL, DEFAULT_WALL_MATERIAL, DEFAULT_WINDOW_MATERIAL, disposeMaterial, glassMaterial, MONO_PALETTE, materialCastsShadow, PRESET_PALETTES, registerMaterialCacheCleanup, resolveMaterialRef, resolveSlotDefaultMaterial, resolveSurfaceColor, setSlotDefaultOverrides, WHITE_PALETTE, } from './lib/materials';
|
|
43
46
|
export { mergedOutline } from './lib/merged-outline-node';
|
|
47
|
+
export { createNodeTopSurfaceHeightSampler } from './lib/node-top-surface-height';
|
|
44
48
|
export * from './lib/perf-actions';
|
|
45
49
|
export { publishPerfBatchStats } from './lib/perf-panel-store';
|
|
46
50
|
export * from './lib/perf-tracks';
|
|
47
|
-
export { markPureRaycast } from './lib/pointer-events';
|
|
51
|
+
export { hasMaterialsForGroups, markPureRaycast } from './lib/pointer-events';
|
|
52
|
+
export { cloneWithProceduralEmission, decorateProceduralEmission, proceduralSlotMeshes, setProceduralEmission, } from './lib/procedural-emission';
|
|
48
53
|
export { detectRendererCapability, initializeGpuRenderer, } from './lib/renderer-capability';
|
|
54
|
+
export { createSceneSupportHeightSampler } from './lib/scene-support-height';
|
|
49
55
|
export { getSceneTheme, SCENE_THEME_IDS, SCENE_THEMES, } from './lib/scene-themes';
|
|
50
|
-
export { hideFromScene, showInScene, temporarilyShowShadowOnly, } from './lib/scene-visibility';
|
|
51
|
-
export {
|
|
56
|
+
export { hideFromScene, showInScene, temporarilyShowPresentation, temporarilyShowShadowOnly, } from './lib/scene-visibility';
|
|
57
|
+
export { SCRIPTED_MODEL_FLAG } from './lib/scripted-opening';
|
|
58
|
+
export { createPlainSnapshotPipeline, createSnapshotPipeline, SNAPSHOT_MAX_EDGE, SNAPSHOT_MIME, SNAPSHOT_QUALITY, THUMBNAIL_HEIGHT, THUMBNAIL_WIDTH, } from './lib/snapshot-pipeline';
|
|
52
59
|
export { buildTerrainPerimeterFillGeometry, } from './lib/terrain-perimeter-fill';
|
|
53
60
|
export { getPascalTextureRef, stampPascalTextureRef, textureMapForSlot, } from './lib/texture-reference';
|
|
54
61
|
export { packNormalToRGB, unpackRGBToNormal } from './lib/tsl-compat';
|
|
55
|
-
export {
|
|
62
|
+
export { createZoneShape, createZoneWallGeometry } from './lib/zone-geometry';
|
|
63
|
+
export { catalogLightSource, useItemLightPool } from './store/use-item-light-pool';
|
|
56
64
|
export { applyCountryUnitDefault, default as useViewer, } from './store/use-viewer';
|
|
57
|
-
export { CeilingSystem } from './systems/ceiling/ceiling-system';
|
|
65
|
+
export { CEILING_REGION_MESH, CeilingSystem, } from './systems/ceiling/ceiling-system';
|
|
58
66
|
export { createColumnBoxGeometry, createColumnCylinderGeometry, createColumnSphereGeometry, createColumnTorusGeometry, } from './systems/column/column-geometry';
|
|
59
67
|
export { DoorAnimationSystem } from './systems/door/door-animation-system';
|
|
60
68
|
export { buildDoorPreviewMesh, DoorSystem, poseDoorMovingParts } from './systems/door/door-system';
|
|
61
69
|
export { ElevatorInteractionSystem } from './systems/elevator/elevator-interaction-system';
|
|
62
|
-
// Fence system follows the wall re-export pattern — composed into the
|
|
63
|
-
// registry-driven fence definition's `def.system`. Removed in Phase 6
|
|
64
|
-
// alongside the legacy fence mount point.
|
|
65
|
-
export { FenceSystem, generateFenceGeometry, generateFenceSlotGeometries, } from './systems/fence/fence-system';
|
|
66
70
|
// Generic floor-elevation system. Lifts the rendered mesh of any kind
|
|
67
71
|
// whose definition declares `capabilities.floorPlaced` by the slab
|
|
68
72
|
// elevation under its footprint. Replaces the per-kind elevation block
|
|
@@ -70,6 +74,7 @@ export { FenceSystem, generateFenceGeometry, generateFenceSlotGeometries, } from
|
|
|
70
74
|
export { FloorElevationSystem } from './systems/floor-elevation/floor-elevation-system';
|
|
71
75
|
export { GuideSystem } from './systems/guide/guide-system';
|
|
72
76
|
export { InteractiveSystem } from './systems/interactive/interactive-system';
|
|
77
|
+
export { ScriptedClips, useClipActions, } from './systems/interactive/scripted-clips';
|
|
73
78
|
// Item systems for the registry-driven item definition. ItemSystem
|
|
74
79
|
// applies attachTo-driven transforms each frame; ItemLightSystem
|
|
75
80
|
// manages item-mounted light sources.
|
|
@@ -77,7 +82,7 @@ export { ItemSystem } from './systems/item/item-system';
|
|
|
77
82
|
export { ItemLightSystem } from './systems/item-light/item-light-system';
|
|
78
83
|
export { LevelSystem } from './systems/level/level-system';
|
|
79
84
|
export { EXPLODED_GAP, getLevelPresentationY, snapLevelsToTruePositions, } from './systems/level/level-utils';
|
|
80
|
-
export { getRoofMaterialArray } from './systems/roof/roof-materials';
|
|
85
|
+
export { getRoofMaterialArray, levelWallCladdingRef } from './systems/roof/roof-materials';
|
|
81
86
|
// Generic roof-segment primitives. Kinds that compose CSG against
|
|
82
87
|
// the roof shell (chimney's self-trim, dormer's virtual-segment cut)
|
|
83
88
|
// read these through the public surface. No kind-specific helpers
|
|
@@ -95,6 +100,7 @@ export { StairSystem } from './systems/stair/stair-system';
|
|
|
95
100
|
export { buildOpeningCutoutGeometry, buildOpeningCutoutShape, getOpeningCutoutBottomPadding, hasFlatOpeningCutoutBottom, } from './systems/wall/opening-cutout-geometry';
|
|
96
101
|
export { getWallHideState, WallCutout } from './systems/wall/wall-cutout';
|
|
97
102
|
export { WallCutoutCache, } from './systems/wall/wall-cutout-cache';
|
|
103
|
+
export { getWallFaceBaseAt, getWallFinishData, getWallFinishRefs, } from './systems/wall/wall-finish-data';
|
|
98
104
|
export { getMaterialsForWall, getVisibleWallMaterials, } from './systems/wall/wall-materials';
|
|
99
105
|
// Wall internals re-exported so `@pascal-app/nodes`' registry-driven wall
|
|
100
106
|
// definition can compose them into `def.system` without duplicating the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-url.d.ts","sourceRoot":"","sources":["../../src/lib/asset-url.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,QAAwE,CAAA;AAEnG;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"asset-url.d.ts","sourceRoot":"","sources":["../../src/lib/asset-url.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,QAAwE,CAAA;AAEnG;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkB5F;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAoB3E"}
|
package/dist/lib/asset-url.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadAssetUrl } from '@pascal-app/core';
|
|
1
|
+
import { loadAssetUrl, resolveArtifactUrl } from '@pascal-app/core';
|
|
2
2
|
export const ASSETS_CDN_URL = process.env.NEXT_PUBLIC_ASSETS_CDN_URL || 'https://editor.pascal.app';
|
|
3
3
|
/**
|
|
4
4
|
* Resolves an asset URL to the appropriate format:
|
|
@@ -10,6 +10,8 @@ export const ASSETS_CDN_URL = process.env.NEXT_PUBLIC_ASSETS_CDN_URL || 'https:/
|
|
|
10
10
|
export async function resolveAssetUrl(url) {
|
|
11
11
|
if (!url)
|
|
12
12
|
return null;
|
|
13
|
+
if (url.startsWith('artifact://'))
|
|
14
|
+
return resolveArtifactUrl(url);
|
|
13
15
|
// External URL - use as-is
|
|
14
16
|
if (url.startsWith('http://') || url.startsWith('https://')) {
|
|
15
17
|
return url;
|
|
@@ -29,6 +31,10 @@ export async function resolveAssetUrl(url) {
|
|
|
29
31
|
export function resolveCdnUrl(url) {
|
|
30
32
|
if (!url)
|
|
31
33
|
return null;
|
|
34
|
+
if (url.startsWith('artifact://'))
|
|
35
|
+
return resolveArtifactUrl(url);
|
|
36
|
+
if (url.startsWith('blob:'))
|
|
37
|
+
return url;
|
|
32
38
|
// External URL - use as-is
|
|
33
39
|
if (url.startsWith('http://') || url.startsWith('https://')) {
|
|
34
40
|
return url;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Discipline, DisplayFamily, DisplayMode } from '@pascal-app/core';
|
|
2
|
+
/**
|
|
3
|
+
* Personal display state (F4, owner decision O3, frozen): kept per project in
|
|
4
|
+
* this browser like `showScans`, never shared with collaborators and never a
|
|
5
|
+
* geometry edit. Additive to `levelMode` / `wallMode`, which keep their
|
|
6
|
+
* meaning. It composes through a `display` layer-hold reason and never
|
|
7
|
+
* touches `object.visible`. Inside it `isolate` wins over `families`, which
|
|
8
|
+
* win over the mode default. "Save look" writes the project default to
|
|
9
|
+
* `site.presentation` (core `SitePresentation`); the canonical bake is
|
|
10
|
+
* independent of both. Not wired into the viewer store yet.
|
|
11
|
+
*/
|
|
12
|
+
export type DisplayState = {
|
|
13
|
+
mode: DisplayMode;
|
|
14
|
+
families?: Partial<Record<DisplayFamily, boolean>>;
|
|
15
|
+
disciplines: Record<Discipline, boolean>;
|
|
16
|
+
xray: boolean;
|
|
17
|
+
/** 0..1 presentation offset. */
|
|
18
|
+
separation: number;
|
|
19
|
+
colorBy: 'material' | 'service';
|
|
20
|
+
isolate?: {
|
|
21
|
+
kind: 'system' | 'owner';
|
|
22
|
+
id: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=display-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-state.d.ts","sourceRoot":"","sources":["../../src/lib/display-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9E;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAA;IAClD,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACxC,IAAI,EAAE,OAAO,CAAA;IACb,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,UAAU,GAAG,SAAS,CAAA;IAC/B,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CACnD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/lib/hero-pose.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box3 } from 'three';
|
|
2
2
|
export declare const DEFAULT_FRAMING_EXCLUDED_TYPES: readonly ["site", "scan", "guide", "spawn"];
|
|
3
|
-
export declare function heroCameraPose({ boxes, aspect, aim, fovDeg, azimuthRad, elevationRad, padding, minDistance, frameShift, }: {
|
|
3
|
+
export declare function heroCameraPose({ boxes, aspect, aim, fovDeg, azimuthRad, elevationRad, padding, minDistance, frameShift, tightFit, }: {
|
|
4
4
|
boxes: Box3 | readonly Box3[];
|
|
5
5
|
aspect: number;
|
|
6
6
|
/** Where the camera looks (frame center). Defaults to the union-box center;
|
|
@@ -16,6 +16,11 @@ export declare function heroCameraPose({ boxes, aspect, aim, fovDeg, azimuthRad,
|
|
|
16
16
|
/** Fraction of the frustum half-height to drop the aim by. 0 keeps the aim
|
|
17
17
|
* (the building center) exactly at frame center. */
|
|
18
18
|
frameShift?: number;
|
|
19
|
+
/** Fit the PROJECTED extents instead of a symmetric fit around `aim`: the
|
|
20
|
+
* aim may drift off-center so the subject fills the frame. A symmetric fit
|
|
21
|
+
* pins the nearest corner to one edge and leaves the far side empty, since
|
|
22
|
+
* far corners project smaller. */
|
|
23
|
+
tightFit?: boolean;
|
|
19
24
|
}): {
|
|
20
25
|
position: [number, number, number];
|
|
21
26
|
target: [number, number, number];
|
|
@@ -30,6 +35,8 @@ export type HeroFraming = {
|
|
|
30
35
|
aim: [number, number, number];
|
|
31
36
|
/** 45° to the dominant facade (falls back to world 45°). */
|
|
32
37
|
azimuthRad: number;
|
|
38
|
+
/** Items left out of `boxes` because they sit away from the structure. */
|
|
39
|
+
detachedItemIds: string[];
|
|
33
40
|
};
|
|
34
41
|
/**
|
|
35
42
|
* Framing for a scene hero shot. The base set is the built structure (walls,
|
|
@@ -42,6 +49,9 @@ export type HeroFraming = {
|
|
|
42
49
|
* structure (pure furniture arrangements) fall back to framing every
|
|
43
50
|
* non-helper node.
|
|
44
51
|
*/
|
|
45
|
-
export declare function computeHeroFraming(
|
|
52
|
+
export declare function computeHeroFraming({ sitePlates, }?: {
|
|
53
|
+
/** false frames the built structure only, ignoring shaped site plates. */
|
|
54
|
+
sitePlates?: boolean;
|
|
55
|
+
}): HeroFraming | null;
|
|
46
56
|
export declare function temporarilyHideNodeTypes(types: readonly string[]): () => void;
|
|
47
57
|
//# sourceMappingURL=hero-pose.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero-pose.d.ts","sourceRoot":"","sources":["../../src/lib/hero-pose.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAA0B,MAAM,OAAO,CAAA;AAEpD,eAAO,MAAM,8BAA8B,6CAA8C,CAAA;AAEzF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,MAAM,EACN,GAAG,EACH,MAAW,EACX,UAAwB,EACxB,YAAmC,EACnC,OAAc,EACd,WAAe,EACf,UAAc,
|
|
1
|
+
{"version":3,"file":"hero-pose.d.ts","sourceRoot":"","sources":["../../src/lib/hero-pose.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAA0B,MAAM,OAAO,CAAA;AAEpD,eAAO,MAAM,8BAA8B,6CAA8C,CAAA;AAEzF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,MAAM,EACN,GAAG,EACH,MAAW,EACX,UAAwB,EACxB,YAAmC,EACnC,OAAc,EACd,WAAe,EACf,UAAc,EACd,QAAgB,GACjB,EAAE;IACD,KAAK,EAAE,IAAI,GAAG,SAAS,IAAI,EAAE,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd;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
|
1
1
|
import { sceneRegistry, useScene } from '@pascal-app/core';
|
|
2
2
|
import { Box3, Vector3 } from 'three';
|
|
3
3
|
export const DEFAULT_FRAMING_EXCLUDED_TYPES = ['site', 'scan', 'guide', 'spawn'];
|
|
4
|
-
export function heroCameraPose({ boxes, aspect, aim, fovDeg = 60, azimuthRad = Math.PI / 4, elevationRad = (13 * Math.PI) / 180, padding = 1.03, minDistance = 4, frameShift = 0, }) {
|
|
4
|
+
export function heroCameraPose({ boxes, aspect, aim, fovDeg = 60, azimuthRad = Math.PI / 4, elevationRad = (13 * Math.PI) / 180, padding = 1.03, minDistance = 4, frameShift = 0, tightFit = false, }) {
|
|
5
5
|
const list = Array.isArray(boxes) ? boxes : [boxes];
|
|
6
6
|
const union = new Box3();
|
|
7
7
|
for (const box of list)
|
|
@@ -37,6 +37,62 @@ export function heroCameraPose({ boxes, aspect, aim, fovDeg = 60, azimuthRad = M
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
if (tightFit) {
|
|
41
|
+
// Every corner as (lateral, vertical, depth) around `center`. For a camera
|
|
42
|
+
// distance d, a shift (sx, sy) of aim+camera along right/up keeps a corner
|
|
43
|
+
// in frame iff |lateral − sx| ≤ tanH·(d + depth) (same vertically), so each
|
|
44
|
+
// corner bounds the feasible shift window; the tightest d whose windows
|
|
45
|
+
// still intersect is the fit, bisected from the symmetric distance.
|
|
46
|
+
const samples = [];
|
|
47
|
+
for (const box of list) {
|
|
48
|
+
for (const x of [box.min.x, box.max.x]) {
|
|
49
|
+
for (const y of [box.min.y, box.max.y]) {
|
|
50
|
+
for (const z of [box.min.z, box.max.z]) {
|
|
51
|
+
offset.subVectors(corner.set(x, y, z), center);
|
|
52
|
+
samples.push([offset.dot(right), offset.dot(up), offset.dot(forward)]);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const tanH = tanHorizontal / padding;
|
|
58
|
+
const tanV = tanVertical / padding;
|
|
59
|
+
const shiftWindow = (d) => {
|
|
60
|
+
let loX = Number.NEGATIVE_INFINITY;
|
|
61
|
+
let hiX = Number.POSITIVE_INFINITY;
|
|
62
|
+
let loY = Number.NEGATIVE_INFINITY;
|
|
63
|
+
let hiY = Number.POSITIVE_INFINITY;
|
|
64
|
+
for (const [lateral, vertical, depth] of samples) {
|
|
65
|
+
const z = d + depth;
|
|
66
|
+
if (z <= 0.1)
|
|
67
|
+
return null;
|
|
68
|
+
loX = Math.max(loX, lateral - tanH * z);
|
|
69
|
+
hiX = Math.min(hiX, lateral + tanH * z);
|
|
70
|
+
loY = Math.max(loY, vertical - tanV * z);
|
|
71
|
+
hiY = Math.min(hiY, vertical + tanV * z);
|
|
72
|
+
}
|
|
73
|
+
return loX <= hiX && loY <= hiY ? { sx: (loX + hiX) / 2, sy: (loY + hiY) / 2 } : null;
|
|
74
|
+
};
|
|
75
|
+
let lo = minDistance;
|
|
76
|
+
let hi = distance;
|
|
77
|
+
while (!shiftWindow(hi))
|
|
78
|
+
hi *= 1.5;
|
|
79
|
+
for (let i = 0; i < 40; i++) {
|
|
80
|
+
const mid = (lo + hi) / 2;
|
|
81
|
+
if (shiftWindow(mid))
|
|
82
|
+
hi = mid;
|
|
83
|
+
else
|
|
84
|
+
lo = mid;
|
|
85
|
+
}
|
|
86
|
+
const shift = shiftWindow(hi);
|
|
87
|
+
const target = center
|
|
88
|
+
.clone()
|
|
89
|
+
.addScaledVector(right, shift.sx)
|
|
90
|
+
.addScaledVector(up, shift.sy - frameShift * hi * tanVertical);
|
|
91
|
+
return {
|
|
92
|
+
position: [target.x + dir.x * hi, target.y + dir.y * hi, target.z + dir.z * hi],
|
|
93
|
+
target: [target.x, target.y, target.z],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
40
96
|
// Reframe: slide aim and camera together along the view-up axis — pure
|
|
41
97
|
// composition shift, no perspective change.
|
|
42
98
|
const drop = up.clone().multiplyScalar(-frameShift * distance * tanVertical);
|
|
@@ -166,7 +222,7 @@ function dominantWallYaw() {
|
|
|
166
222
|
* structure (pure furniture arrangements) fall back to framing every
|
|
167
223
|
* non-helper node.
|
|
168
224
|
*/
|
|
169
|
-
export function computeHeroFraming() {
|
|
225
|
+
export function computeHeroFraming({ sitePlates = true, } = {}) {
|
|
170
226
|
const structural = perNodeBoxes([...DEFAULT_FRAMING_EXCLUDED_TYPES, 'item', 'building', 'level']);
|
|
171
227
|
if (structural.length === 0) {
|
|
172
228
|
const all = perNodeBoxes([...DEFAULT_FRAMING_EXCLUDED_TYPES, 'building', 'level']);
|
|
@@ -176,12 +232,17 @@ export function computeHeroFraming() {
|
|
|
176
232
|
for (const box of all)
|
|
177
233
|
union.union(box);
|
|
178
234
|
const center = union.getCenter(new Vector3());
|
|
179
|
-
return {
|
|
235
|
+
return {
|
|
236
|
+
boxes: all,
|
|
237
|
+
aim: [center.x, center.y, center.z],
|
|
238
|
+
azimuthRad: Math.PI / 4,
|
|
239
|
+
detachedItemIds: [],
|
|
240
|
+
};
|
|
180
241
|
}
|
|
181
242
|
const structuralUnion = new Box3();
|
|
182
243
|
for (const box of structural)
|
|
183
244
|
structuralUnion.union(box);
|
|
184
|
-
const plates = sitePlateBoxes();
|
|
245
|
+
const plates = sitePlates ? sitePlateBoxes() : [];
|
|
185
246
|
const groundUnion = structuralUnion.clone();
|
|
186
247
|
for (const box of plates)
|
|
187
248
|
groundUnion.union(box);
|
|
@@ -189,14 +250,19 @@ export function computeHeroFraming() {
|
|
|
189
250
|
.clone()
|
|
190
251
|
.expandByVector(groundUnion.getSize(new Vector3()).multiplyScalar(0.15));
|
|
191
252
|
const boxes = [...structural, ...plates];
|
|
253
|
+
const detachedItemIds = [];
|
|
192
254
|
const itemIds = sceneRegistry.byType.item;
|
|
193
255
|
for (const id of itemIds) {
|
|
194
256
|
const object = sceneRegistry.nodes.get(id);
|
|
195
257
|
if (!object)
|
|
196
258
|
continue;
|
|
197
259
|
const bounds = new Box3().setFromObject(object);
|
|
198
|
-
if (
|
|
260
|
+
if (bounds.isEmpty())
|
|
261
|
+
continue;
|
|
262
|
+
if (nearby.intersectsBox(bounds))
|
|
199
263
|
boxes.push(bounds);
|
|
264
|
+
else
|
|
265
|
+
detachedItemIds.push(id);
|
|
200
266
|
}
|
|
201
267
|
const groundCenter = groundUnion.getCenter(new Vector3());
|
|
202
268
|
const structuralCenter = structuralUnion.getCenter(new Vector3());
|
|
@@ -205,6 +271,7 @@ export function computeHeroFraming() {
|
|
|
205
271
|
boxes,
|
|
206
272
|
aim: [groundCenter.x, structuralCenter.y, groundCenter.z],
|
|
207
273
|
azimuthRad: Math.PI / 4 - (yaw ?? 0),
|
|
274
|
+
detachedItemIds,
|
|
208
275
|
};
|
|
209
276
|
}
|
|
210
277
|
export function temporarilyHideNodeTypes(types) {
|
package/dist/lib/ink-edges.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { Camera } from 'three';
|
|
2
|
+
export declare function createEdgeDepthSampler(depthTex: any, camera: Camera): (uv: any) => any;
|
|
3
|
+
export declare function inkedEdges({ sampleDepth, normalTex, inkColor, radius, opacity, sceneRgb, }: {
|
|
4
|
+
sampleDepth: (uv: any) => any;
|
|
3
5
|
normalTex: any;
|
|
4
6
|
inkColor: any;
|
|
5
7
|
radius: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ink-edges.d.ts","sourceRoot":"","sources":["../../src/lib/ink-edges.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ink-edges.d.ts","sourceRoot":"","sources":["../../src/lib/ink-edges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAqB,MAAM,OAAO,CAAA;AAkBtD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,QACd,GAAG,SAYxD;AAkBD,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE;IACD,WAAW,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,GAAG,CAAA;IAC7B,SAAS,EAAE,GAAG,CAAA;IACd,QAAQ,EAAE,GAAG,CAAA;IAKb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,GAAG,CAAA;IACZ,QAAQ,EAAE,GAAG,CAAA;CACd,OAsCA"}
|
package/dist/lib/ink-edges.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import { abs, float, max, min, mix, screenSize, screenUV, smoothstep, vec2 } from 'three/tsl';
|
|
1
|
+
import { abs, float, max, min, mix, perspectiveDepthToViewZ, screenSize, screenUV, smoothstep, uniform, vec2, viewZToPerspectiveDepth, } from 'three/tsl';
|
|
2
2
|
import { unpackRGBToNormal } from './tsl-compat';
|
|
3
|
+
export function createEdgeDepthSampler(depthTex, camera) {
|
|
4
|
+
if (!('isPerspectiveCamera' in camera))
|
|
5
|
+
return (uv) => depthTex.sample(uv).r;
|
|
6
|
+
const perspective = camera;
|
|
7
|
+
const near = uniform(perspective.near).onRenderUpdate(() => perspective.near);
|
|
8
|
+
const far = uniform(perspective.far).onRenderUpdate(() => perspective.far);
|
|
9
|
+
// Ink and AO thresholds were calibrated at near 0.1 / far 1000. Keep
|
|
10
|
+
// their world distances when orbit, walkthrough or capture clipping changes.
|
|
11
|
+
return (uv) => viewZToPerspectiveDepth(perspectiveDepthToViewZ(depthTex.sample(uv).r, near, far), float(0.1), float(1000));
|
|
12
|
+
}
|
|
3
13
|
// Screen-space ink outline (SketchUp / Moebius look). Reads the scene-pass
|
|
4
14
|
// depth + normal MRT and inks two signals:
|
|
5
15
|
//
|
|
@@ -16,14 +26,14 @@ import { unpackRGBToNormal } from './tsl-compat';
|
|
|
16
26
|
// Topology-agnostic: works on CSG triangle soup, organic GLBs, anything — it
|
|
17
27
|
// only sees the rendered buffers. `intensity` scales the final mask; `inkColor`
|
|
18
28
|
// should track the background luminance (dark lines on light scenes).
|
|
19
|
-
export function inkedEdges({
|
|
29
|
+
export function inkedEdges({ sampleDepth, normalTex, inkColor, radius, opacity, sceneRgb, }) {
|
|
20
30
|
const px = vec2(1, 1).div(screenSize).mul(radius);
|
|
21
31
|
const uvN = screenUV;
|
|
22
|
-
const dC =
|
|
23
|
-
const dR =
|
|
24
|
-
const dL =
|
|
25
|
-
const dU =
|
|
26
|
-
const dD =
|
|
32
|
+
const dC = sampleDepth(uvN);
|
|
33
|
+
const dR = sampleDepth(uvN.add(vec2(px.x, 0)));
|
|
34
|
+
const dL = sampleDepth(uvN.sub(vec2(px.x, 0)));
|
|
35
|
+
const dU = sampleDepth(uvN.add(vec2(0, px.y)));
|
|
36
|
+
const dD = sampleDepth(uvN.sub(vec2(0, px.y)));
|
|
27
37
|
const depthLap = abs(dR.add(dL).add(dU).add(dD).sub(dC.mul(4)));
|
|
28
38
|
const invDepth = float(1).sub(dC);
|
|
29
39
|
const depthMetric = depthLap.div(invDepth.mul(invDepth).add(float(0.00002)));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Vector3Tuple } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Aims the key (shadow-casting) light along a world direction, ahead of the
|
|
4
|
+
* theme or atmosphere source. For captures that compose their own camera —
|
|
5
|
+
* the worker thumbnail sets the sun relative to its hero angle so shadows
|
|
6
|
+
* read instead of falling straight behind the building. `null` restores the
|
|
7
|
+
* theme/atmosphere direction.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setKeyLightDirectionOverride(direction: Vector3Tuple | null): void;
|
|
10
|
+
export declare function getKeyLightDirectionOverride(): Vector3Tuple | null;
|
|
11
|
+
//# sourceMappingURL=key-light-override.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-light-override.d.ts","sourceRoot":"","sources":["../../src/lib/key-light-override.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAIzC;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI,QAE1E;AAED,wBAAgB,4BAA4B,IAAI,YAAY,GAAG,IAAI,CAElE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let keyLightDirection = null;
|
|
2
|
+
/**
|
|
3
|
+
* Aims the key (shadow-casting) light along a world direction, ahead of the
|
|
4
|
+
* theme or atmosphere source. For captures that compose their own camera —
|
|
5
|
+
* the worker thumbnail sets the sun relative to its hero angle so shadows
|
|
6
|
+
* read instead of falling straight behind the building. `null` restores the
|
|
7
|
+
* theme/atmosphere direction.
|
|
8
|
+
*/
|
|
9
|
+
export function setKeyLightDirectionOverride(direction) {
|
|
10
|
+
keyLightDirection = direction;
|
|
11
|
+
}
|
|
12
|
+
export function getKeyLightDirectionOverride() {
|
|
13
|
+
return keyLightDirection;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds the viewport's LAST presented frame on screen while a capture works
|
|
3
|
+
* on the shared scene: the frame loop keeps ticking (useFrame systems still
|
|
4
|
+
* run, a capture can pump frames by hand) but the live draw is skipped, so
|
|
5
|
+
* whatever a capture swaps in for its own renders — a presentation flip, a
|
|
6
|
+
* hidden ground, an override material held across a GPU readback — never
|
|
7
|
+
* reaches the canvas.
|
|
8
|
+
*
|
|
9
|
+
* Holds nest; each one expires on its own after `maxMs` so a capture that
|
|
10
|
+
* never settles cannot freeze the viewport for the session.
|
|
11
|
+
*/
|
|
12
|
+
export declare function holdLiveFrame(maxMs?: number): () => void;
|
|
13
|
+
export declare function isLiveFrameHeld(): boolean;
|
|
14
|
+
//# sourceMappingURL=live-frame-hold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-frame-hold.d.ts","sourceRoot":"","sources":["../../src/lib/live-frame-hold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,wBAAgB,aAAa,CAAC,KAAK,SAAS,GAAG,MAAM,IAAI,CAWxD;AAED,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds the viewport's LAST presented frame on screen while a capture works
|
|
3
|
+
* on the shared scene: the frame loop keeps ticking (useFrame systems still
|
|
4
|
+
* run, a capture can pump frames by hand) but the live draw is skipped, so
|
|
5
|
+
* whatever a capture swaps in for its own renders — a presentation flip, a
|
|
6
|
+
* hidden ground, an override material held across a GPU readback — never
|
|
7
|
+
* reaches the canvas.
|
|
8
|
+
*
|
|
9
|
+
* Holds nest; each one expires on its own after `maxMs` so a capture that
|
|
10
|
+
* never settles cannot freeze the viewport for the session.
|
|
11
|
+
*/
|
|
12
|
+
let holds = 0;
|
|
13
|
+
export function holdLiveFrame(maxMs = 60_000) {
|
|
14
|
+
holds += 1;
|
|
15
|
+
let released = false;
|
|
16
|
+
const release = () => {
|
|
17
|
+
if (released)
|
|
18
|
+
return;
|
|
19
|
+
released = true;
|
|
20
|
+
clearTimeout(expiry);
|
|
21
|
+
holds -= 1;
|
|
22
|
+
};
|
|
23
|
+
const expiry = setTimeout(release, maxMs);
|
|
24
|
+
return release;
|
|
25
|
+
}
|
|
26
|
+
export function isLiveFrameHeld() {
|
|
27
|
+
return holds > 0;
|
|
28
|
+
}
|