editor: improve floorplan navigation performance (#535)

* Add roof surface placement support for items

Items (e.g. solar panels) can now be placed on sloped roof surfaces.
The placement system computes euler rotation from the roof surface
normal so items sit flush on the slope instead of going inside.

- Add roofStrategy to placement-strategies with enter/move/click/leave
- Wire roof:enter/move/click/leave events in the placement coordinator
- Add calculateRoofRotation in placement-math using surface normals
- Support full 3D cursor rotation for sloped surfaces
- Items on roofs are parented to the level with world-space rotation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fixed conflict

* fix(editor): defer floorplan annotation collision layout

* fix(viewer): suspend outlines during camera movement

* fix(editor): keep floorplan zoom off the render hot path

* fix(editor): keep floorplan pan off render hot path

* fix(editor): keep floorplan rotation off render hot path

* fix(editor): keep rotation backdrop white

* fix(editor): finalize floorplan navigation safely

* fix(editor): keep navigation interaction state current

* fix(editor): stop floorplan animation before pan

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sudhir Yadav
2026-07-23 07:53:01 -04:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 26c9e17fed
commit fcac55ca30
16 changed files with 1042 additions and 258 deletions
@@ -526,6 +526,7 @@ const PostProcessingPasses = ({
let visualAlpha = contentAlpha
if (outlineEnabled) {
const outlineNode = mergedOutline(scene, camera, {
enabled: () => !useViewer.getState().cameraDragging,
primaryObjects: outliner.selectedObjects,
secondaryObjects: outliner.hoveredObjects,
primaryEdgeThickness: uniform(1),
@@ -0,0 +1,22 @@
// @ts-expect-error — bun:test is provided by the Bun runtime; viewer does not
// depend on @types/bun so the import type is unresolved at compile time.
import { describe, expect, test } from 'bun:test'
import { Object3D, PerspectiveCamera, Scene } from 'three'
import { mergedOutline } from './merged-outline-node'
describe('merged outline rendering', () => {
test('skips outline work while the pass is disabled', () => {
const outline = mergedOutline(new Scene(), new PerspectiveCamera(), {
enabled: () => false,
primaryObjects: [new Object3D()],
})
const frame = {
get renderer(): never {
throw new Error('outline renderer should not be touched')
},
}
expect(() => outline.updateBefore(frame)).not.toThrow()
outline.dispose()
})
})
@@ -125,6 +125,7 @@ export class MergedOutlineNode extends TempNode {
primaryEdgeGlowNode: any
secondaryEdgeGlowNode: any
downSampleRatio: number
enabled: () => boolean
updateBeforeType: string
private readonly _depthRT: RenderTarget
@@ -189,6 +190,7 @@ export class MergedOutlineNode extends TempNode {
primaryEdgeGlow?: any
secondaryEdgeGlow?: any
downSampleRatio?: number
enabled?: () => boolean
} = {},
) {
super('vec4')
@@ -201,6 +203,7 @@ export class MergedOutlineNode extends TempNode {
primaryEdgeGlow = float(0),
secondaryEdgeGlow = float(0),
downSampleRatio = 2,
enabled = () => true,
} = params
this.scene = scene
@@ -212,6 +215,7 @@ export class MergedOutlineNode extends TempNode {
this.primaryEdgeGlowNode = nodeObject(primaryEdgeGlow)
this.secondaryEdgeGlowNode = nodeObject(secondaryEdgeGlow)
this.downSampleRatio = downSampleRatio
this.enabled = enabled
this.updateBeforeType = NodeUpdateType.FRAME
this._depthRT = new RenderTarget()
@@ -301,8 +305,9 @@ export class MergedOutlineNode extends TempNode {
}
updateBefore(frame: any) {
const hasPrimary = this.primaryObjects.length > 0
const hasSecondary = this.secondaryObjects.length > 0
const enabled = this.enabled()
const hasPrimary = enabled && this.primaryObjects.length > 0
const hasSecondary = enabled && this.secondaryObjects.length > 0
const hasAny = hasPrimary || hasSecondary
// Fast-path: nothing to render and nothing was rendered last frame either,