chore: biome auto-format pass (resolve persistent dirty-tree noise)
These files had been showing as modified in every dev session — biome's canonical formatting (line-length collapses, import sort, type-modifier placement) didn't match the committed state. No semantic changes. Committing now so the working tree stays clean across sessions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
5e67ffd4e8
commit
36c48b7fc9
@@ -73,17 +73,11 @@ export function getElevatorShaftWallThickness(node: ElevatorNode) {
|
|||||||
return Math.max(node.shaftWallThickness ?? DEFAULT_ELEVATOR_SHAFT_WALL_THICKNESS, 0.04)
|
return Math.max(node.shaftWallThickness ?? DEFAULT_ELEVATOR_SHAFT_WALL_THICKNESS, 0.04)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getElevatorShaftWidth(
|
export function getElevatorShaftWidth(node: ElevatorNode, cabWidth = getElevatorCabWidth(node)) {
|
||||||
node: ElevatorNode,
|
|
||||||
cabWidth = getElevatorCabWidth(node),
|
|
||||||
) {
|
|
||||||
return Math.max(node.shaftWidth ?? cabWidth, cabWidth, 0.8)
|
return Math.max(node.shaftWidth ?? cabWidth, cabWidth, 0.8)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getElevatorShaftDepth(
|
export function getElevatorShaftDepth(node: ElevatorNode, cabDepth = getElevatorCabDepth(node)) {
|
||||||
node: ElevatorNode,
|
|
||||||
cabDepth = getElevatorCabDepth(node),
|
|
||||||
) {
|
|
||||||
return Math.max(node.shaftDepth ?? cabDepth, cabDepth, 0.8)
|
return Math.max(node.shaftDepth ?? cabDepth, cabDepth, 0.8)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,10 @@ describe('elevator runtime helpers', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('moves to a queued level and clears the served request on arrival', () => {
|
test('moves to a queued level and clears the served request on arrival', () => {
|
||||||
const queued = queueElevatorRequest(createElevatorInteractiveState(groundLevelId, 0), upperLevelId)
|
const queued = queueElevatorRequest(
|
||||||
|
createElevatorInteractiveState(groundLevelId, 0),
|
||||||
|
upperLevelId,
|
||||||
|
)
|
||||||
const moving = stepElevatorRuntimeState({
|
const moving = stepElevatorRuntimeState({
|
||||||
defaultEntry: entries[0]!,
|
defaultEntry: entries[0]!,
|
||||||
delta: 0.016,
|
delta: 0.016,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { AnyNode, AnyNodeId, ElevatorNode } from '../../schema'
|
import type { AnyNode, AnyNodeId, ElevatorNode } from '../../schema'
|
||||||
import { type ElevatorInteractiveState, useInteractive } from '../../store/use-interactive'
|
import { type ElevatorInteractiveState, useInteractive } from '../../store/use-interactive'
|
||||||
import useScene from '../../store/use-scene'
|
import useScene from '../../store/use-scene'
|
||||||
import { resolveElevatorLevels, type ElevatorLevelEntry } from './elevator-service'
|
import { type ElevatorLevelEntry, resolveElevatorLevels } from './elevator-service'
|
||||||
|
|
||||||
const EPSILON = 0.001
|
const EPSILON = 0.001
|
||||||
|
|
||||||
@@ -67,9 +67,7 @@ export function queueElevatorRequest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function openElevatorDoorState(
|
export function openElevatorDoorState(state: ElevatorInteractiveState): ElevatorInteractiveState {
|
||||||
state: ElevatorInteractiveState,
|
|
||||||
): ElevatorInteractiveState {
|
|
||||||
if (!state.currentLevelId || state.phase === 'moving') return state
|
if (!state.currentLevelId || state.phase === 'moving') return state
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -246,7 +244,9 @@ export function stepElevatorRuntimes(now: number, delta: number) {
|
|||||||
|
|
||||||
const state = useInteractive.getState().elevators[elevatorId]
|
const state = useInteractive.getState().elevators[elevatorId]
|
||||||
if (!state) {
|
if (!state) {
|
||||||
useInteractive.getState().initElevator(elevatorId, defaultEntry.id as AnyNodeId, defaultEntry.baseY)
|
useInteractive
|
||||||
|
.getState()
|
||||||
|
.initElevator(elevatorId, defaultEntry.id as AnyNodeId, defaultEntry.baseY)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
import type { AnyNode, AnyNodeId, CeilingNode, ElevatorNode, LevelNode, WallNode } from '../../schema'
|
import type {
|
||||||
|
AnyNode,
|
||||||
|
AnyNodeId,
|
||||||
|
CeilingNode,
|
||||||
|
ElevatorNode,
|
||||||
|
LevelNode,
|
||||||
|
WallNode,
|
||||||
|
} from '../../schema'
|
||||||
|
|
||||||
export const DEFAULT_ELEVATOR_LEVEL_HEIGHT = 2.5
|
export const DEFAULT_ELEVATOR_LEVEL_HEIGHT = 2.5
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ export type WallMoveBridgePlan<TWall extends Pick<WallNode, 'id' | 'start' | 'en
|
|||||||
movedEndpoint: WallMoveEndpoint
|
movedEndpoint: WallMoveEndpoint
|
||||||
}
|
}
|
||||||
|
|
||||||
export type WallMoveLinkedWallTargetPlan<
|
export type WallMoveLinkedWallTargetPlan<TWall extends Pick<WallNode, 'id' | 'start' | 'end'>> = {
|
||||||
TWall extends Pick<WallNode, 'id' | 'start' | 'end'>,
|
|
||||||
> = {
|
|
||||||
wall: TWall
|
wall: TWall
|
||||||
originalPoint: WallPlanPoint
|
originalPoint: WallPlanPoint
|
||||||
targetPoint: WallPlanPoint
|
targetPoint: WallPlanPoint
|
||||||
@@ -174,7 +172,9 @@ export function planWallMoveJunctions<TWall extends Pick<WallNode, 'id' | 'start
|
|||||||
.sort((a, b) => a.distance - b.distance)[0]
|
.sort((a, b) => a.distance - b.distance)[0]
|
||||||
|
|
||||||
if (consumedSameDirectionWall) {
|
if (consumedSameDirectionWall) {
|
||||||
const pivotPoint = [...otherWallEndpoint(consumedSameDirectionWall.wall, point)] as WallPlanPoint
|
const pivotPoint = [
|
||||||
|
...otherWallEndpoint(consumedSameDirectionWall.wall, point),
|
||||||
|
] as WallPlanPoint
|
||||||
const bridgeSource = linkedAtEndpoint.find((entry) => entry.relation === 'opposite-direction')
|
const bridgeSource = linkedAtEndpoint.find((entry) => entry.relation === 'opposite-direction')
|
||||||
|
|
||||||
wallsToDelete.set(consumedSameDirectionWall.wall.id, consumedSameDirectionWall.wall)
|
wallsToDelete.set(consumedSameDirectionWall.wall.id, consumedSameDirectionWall.wall)
|
||||||
@@ -201,14 +201,22 @@ export function planWallMoveJunctions<TWall extends Pick<WallNode, 'id' | 'start
|
|||||||
|
|
||||||
const linkedAtPivot = linkedWalls
|
const linkedAtPivot = linkedWalls
|
||||||
.filter(
|
.filter(
|
||||||
(wall) => wall.id !== consumedSameDirectionWall.wall.id && wallTouchesPoint(wall, pivotPoint),
|
(wall) =>
|
||||||
|
wall.id !== consumedSameDirectionWall.wall.id && wallTouchesPoint(wall, pivotPoint),
|
||||||
)
|
)
|
||||||
.map((wall) => ({
|
.map((wall) => ({
|
||||||
wall,
|
wall,
|
||||||
relation: getMoveWallRelation(wall, pivotPoint, nextPoint),
|
relation: getMoveWallRelation(wall, pivotPoint, nextPoint),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
addStandardEndpointPlan(endpoint, pivotPoint, nextPoint, linkedAtPivot, ':through-pivot', true)
|
addStandardEndpointPlan(
|
||||||
|
endpoint,
|
||||||
|
pivotPoint,
|
||||||
|
nextPoint,
|
||||||
|
linkedAtPivot,
|
||||||
|
':through-pivot',
|
||||||
|
true,
|
||||||
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
sceneRegistry,
|
sceneRegistry,
|
||||||
useScene,
|
useScene,
|
||||||
} from '@pascal-app/core'
|
} from '@pascal-app/core'
|
||||||
import { useViewer, WalkthroughControls, ZONE_LAYER } from '@pascal-app/viewer'
|
import { useViewer, ZONE_LAYER } from '@pascal-app/viewer'
|
||||||
import { CameraControls, CameraControlsImpl } from '@react-three/drei'
|
import { CameraControls, CameraControlsImpl } from '@react-three/drei'
|
||||||
import { useThree } from '@react-three/fiber'
|
import { useThree } from '@react-three/fiber'
|
||||||
import { useCallback, useEffect, useMemo, useRef } from 'react'
|
import { useCallback, useEffect, useMemo, useRef } from 'react'
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import '../../three-types'
|
|||||||
import {
|
import {
|
||||||
type AnyNode,
|
type AnyNode,
|
||||||
type AnyNodeId,
|
type AnyNodeId,
|
||||||
type ElevatorNode,
|
|
||||||
type ElevatorDoorSide,
|
type ElevatorDoorSide,
|
||||||
|
type ElevatorNode,
|
||||||
emitter,
|
emitter,
|
||||||
getElevatorCabCenterZ,
|
getElevatorCabCenterZ,
|
||||||
getElevatorCabDepth,
|
getElevatorCabDepth,
|
||||||
@@ -18,10 +18,10 @@ import {
|
|||||||
getElevatorShaftWidth,
|
getElevatorShaftWidth,
|
||||||
getResolvedElevatorDoorStyle,
|
getResolvedElevatorDoorStyle,
|
||||||
openElevatorDoor,
|
openElevatorDoor,
|
||||||
|
requestElevatorLevel,
|
||||||
resolveElevatorBuildingLevels,
|
resolveElevatorBuildingLevels,
|
||||||
resolveElevatorDispatchTarget,
|
resolveElevatorDispatchTarget,
|
||||||
resolveElevatorServiceLevels,
|
resolveElevatorServiceLevels,
|
||||||
requestElevatorLevel,
|
|
||||||
sceneRegistry,
|
sceneRegistry,
|
||||||
useInteractive,
|
useInteractive,
|
||||||
useScene,
|
useScene,
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import {
|
|||||||
import { ViewerOverlay } from '../../components/viewer-overlay'
|
import { ViewerOverlay } from '../../components/viewer-overlay'
|
||||||
import { ViewerZoneSystem } from '../../components/viewer-zone-system'
|
import { ViewerZoneSystem } from '../../components/viewer-zone-system'
|
||||||
import { type PresetsAdapter, PresetsProvider } from '../../contexts/presets-context'
|
import { type PresetsAdapter, PresetsProvider } from '../../contexts/presets-context'
|
||||||
import { useAutoFrame } from '../../hooks/use-auto-frame'
|
|
||||||
import { type SaveStatus, useAutoSave } from '../../hooks/use-auto-save'
|
import { type SaveStatus, useAutoSave } from '../../hooks/use-auto-save'
|
||||||
import { useKeyboard } from '../../hooks/use-keyboard'
|
import { useKeyboard } from '../../hooks/use-keyboard'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
useScene,
|
useScene,
|
||||||
} from '@pascal-app/core'
|
} from '@pascal-app/core'
|
||||||
import { useViewer } from '@pascal-app/viewer'
|
import { useViewer } from '@pascal-app/viewer'
|
||||||
import { useFrame } from '@react-three/fiber'
|
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import * as THREE from 'three'
|
import * as THREE from 'three'
|
||||||
import { markToolCancelConsumed } from '../../../hooks/use-keyboard'
|
import { markToolCancelConsumed } from '../../../hooks/use-keyboard'
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {
|
import {
|
||||||
type AnyNode,
|
|
||||||
emitter,
|
emitter,
|
||||||
type GridEvent,
|
type GridEvent,
|
||||||
type LevelNode,
|
type LevelNode,
|
||||||
|
|||||||
@@ -242,10 +242,7 @@ function getLevelSlabs(levelId: string, nodes: ReturnType<typeof useScene.getSta
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLevelAutoSlabs(
|
function getLevelAutoSlabs(levelId: string, nodes: ReturnType<typeof useScene.getState>['nodes']) {
|
||||||
levelId: string,
|
|
||||||
nodes: ReturnType<typeof useScene.getState>['nodes'],
|
|
||||||
) {
|
|
||||||
return getLevelSlabs(levelId, nodes).filter((slab) => slab.autoFromWalls)
|
return getLevelSlabs(levelId, nodes).filter((slab) => slab.autoFromWalls)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
useInteractive,
|
|
||||||
useRegistry,
|
|
||||||
useScene,
|
|
||||||
type AnimationEffect,
|
type AnimationEffect,
|
||||||
type AnyNodeId,
|
type AnyNodeId,
|
||||||
type Interactive,
|
type Interactive,
|
||||||
type ItemNode,
|
type ItemNode,
|
||||||
type LightEffect,
|
type LightEffect,
|
||||||
|
useInteractive,
|
||||||
|
useRegistry,
|
||||||
|
useScene,
|
||||||
} from '@pascal-app/core'
|
} from '@pascal-app/core'
|
||||||
import { useAnimations } from '@react-three/drei'
|
import { useAnimations } from '@react-three/drei'
|
||||||
import { Clone } from '@react-three/drei/core/Clone'
|
import { Clone } from '@react-three/drei/core/Clone'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useRegistry, useScene, type SiteNode, type SlabNode } from '@pascal-app/core'
|
import { type SiteNode, type SlabNode, useRegistry, useScene } from '@pascal-app/core'
|
||||||
import { useMemo, useRef } from 'react'
|
import { useMemo, useRef } from 'react'
|
||||||
import { BufferGeometry, Float32BufferAttribute, Path, Shape, type Group } from 'three'
|
import { BufferGeometry, Float32BufferAttribute, type Group, Path, Shape } from 'three'
|
||||||
import { useNodeEvents } from '../../../hooks/use-node-events'
|
import { useNodeEvents } from '../../../hooks/use-node-events'
|
||||||
import { unionPolygons } from '../../../lib/polygon-union'
|
import { unionPolygons } from '../../../lib/polygon-union'
|
||||||
import useViewer from '../../../store/use-viewer'
|
import useViewer from '../../../store/use-viewer'
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
import { useThree } from '@react-three/fiber'
|
import { useThree } from '@react-three/fiber'
|
||||||
|
import { forwardRef, type ReactNode, useEffect, useImperativeHandle, useRef } from 'react'
|
||||||
|
import { type BufferGeometry, type Group, Mesh } from 'three'
|
||||||
import {
|
import {
|
||||||
type ReactNode,
|
|
||||||
forwardRef,
|
|
||||||
useEffect,
|
|
||||||
useImperativeHandle,
|
|
||||||
useRef,
|
|
||||||
} from 'react'
|
|
||||||
import { Group, Mesh, type BufferGeometry } from 'three'
|
|
||||||
import {
|
|
||||||
SAH,
|
|
||||||
acceleratedRaycast,
|
acceleratedRaycast,
|
||||||
computeBoundsTree,
|
computeBoundsTree,
|
||||||
disposeBoundsTree,
|
disposeBoundsTree,
|
||||||
|
SAH,
|
||||||
type SplitStrategy,
|
type SplitStrategy,
|
||||||
} from 'three-mesh-bvh'
|
} from 'three-mesh-bvh'
|
||||||
|
|
||||||
|
|||||||
@@ -36,4 +36,5 @@ const useGLTFKTX2 = (path: string): ReturnType<typeof useGLTF> => {
|
|||||||
loader.setMeshoptDecoder(MeshoptDecoder)
|
loader.setMeshoptDecoder(MeshoptDecoder)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export { useGLTFKTX2 }
|
export { useGLTFKTX2 }
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {
|
import {
|
||||||
getMaterialPresetByRef,
|
getMaterialPresetByRef,
|
||||||
resolveMaterial,
|
|
||||||
type MaterialMapProperties,
|
type MaterialMapProperties,
|
||||||
type MaterialPresetPayload,
|
type MaterialPresetPayload,
|
||||||
type MaterialProperties,
|
type MaterialProperties,
|
||||||
type MaterialSchema,
|
type MaterialSchema,
|
||||||
|
resolveMaterial,
|
||||||
} from '@pascal-app/core'
|
} from '@pascal-app/core'
|
||||||
import * as THREE from 'three'
|
import * as THREE from 'three'
|
||||||
import { MeshLambertNodeMaterial, MeshStandardNodeMaterial } from 'three/webgpu'
|
import { MeshLambertNodeMaterial, MeshStandardNodeMaterial } from 'three/webgpu'
|
||||||
|
|||||||
+1
@@ -1,5 +1,6 @@
|
|||||||
import type { AnyNode, BaseNode, BuildingNode, LevelNode, ZoneNode } from '@pascal-app/core'
|
import type { AnyNode, BaseNode, BuildingNode, LevelNode, ZoneNode } from '@pascal-app/core'
|
||||||
import type { Object3D } from 'three'
|
import type { Object3D } from 'three'
|
||||||
|
|
||||||
type SelectionPath = {
|
type SelectionPath = {
|
||||||
buildingId: BuildingNode['id'] | null
|
buildingId: BuildingNode['id'] | null
|
||||||
levelId: LevelNode['id'] | null
|
levelId: LevelNode['id'] | null
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
type AnyNodeId,
|
type AnyNodeId,
|
||||||
openElevatorDoor,
|
openElevatorDoor,
|
||||||
resolveElevatorDispatchTarget,
|
|
||||||
requestElevatorLevel,
|
requestElevatorLevel,
|
||||||
|
resolveElevatorDispatchTarget,
|
||||||
useInteractive,
|
useInteractive,
|
||||||
useScene,
|
useScene,
|
||||||
} from '@pascal-app/core'
|
} from '@pascal-app/core'
|
||||||
|
|||||||
Reference in New Issue
Block a user