fix(simulation): isolate semantics and correct clipping and orthographic LOD
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import type {SceneView} from "../../core/simulation/simulationLayout";
|
||||
import {isOrthographic,screenSpan,type EditorProjection} from "../../core/simulation/editorProjection";
|
||||
import { sceneClipBounds } from "../../core/simulation/sceneClip";
|
||||
import { heightSlice } from "../../core/heightSlice";
|
||||
import { sceneClipBounds, sceneClipRange } from "../../core/simulation/sceneClip";
|
||||
import { EditorUrbanMapLayer } from "./EditorUrbanMapLayer";
|
||||
import { urbanExtent, type UrbanMap, type UrbanClassId } from "../../core/simulation/urbanMap";
|
||||
import { EditorCollisionLayer } from "./EditorCollisionLayer";
|
||||
import { waypointHit } from "../../core/simulation/waypointHit";
|
||||
import { PlannerMarkers } from "./PlannerMarkers";
|
||||
import { QUALITY_PROFILES } from "../../core/simulation/gaussianQuality";
|
||||
import { QUALITY_PROFILES, orthographicLodFov } from "../../core/simulation/gaussianQuality";
|
||||
import { DEFAULT_PLANNER_PREFERENCES, type PlannerPreferences } from "../../core/simulation/plannerPreferences";
|
||||
import { Application, Asset, BoundingBox, Color, Entity, FILLMODE_NONE, Mat4, Quat, PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE, RESOLUTION_AUTO, Vec3, WORKBUFFER_UPDATE_ONCE } from "playcanvas";
|
||||
import { toEditor, toMission, type EditorCache } from "../../core/simulation/aiEditor";
|
||||
@@ -37,6 +38,7 @@ export class AiEditorRuntime {
|
||||
private semanticProject: (()=>void)|null = null;
|
||||
private visualBounds:number[][]=[];
|
||||
private urbanVisible=false;
|
||||
private semanticMode=false;
|
||||
private experienceLayer: EditorUrbanMapLayer | null = null;
|
||||
private experiencePoints: number[][] = [];
|
||||
private onExperienceProject: (p: ScreenPoint[])=>void = ()=>undefined;
|
||||
@@ -130,11 +132,14 @@ export class AiEditorRuntime {
|
||||
this.scan.gsplat!.setWorkBufferModifier({ glsl: `
|
||||
uniform float editorClip;
|
||||
uniform float editorFloor;
|
||||
uniform float editorClipEnabled;
|
||||
uniform float editorFloorEnabled;
|
||||
void modifySplatCenter(inout vec3 center) {}
|
||||
void modifySplatRotationScale(vec3 a, vec3 b, inout vec4 rotation, inout vec3 scale) {}
|
||||
void modifySplatColor(vec3 center, inout vec4 color) {
|
||||
// Unified work-buffer modifiers receive the calibrated world center.
|
||||
if (center.y > editorClip || center.y < editorFloor) color.a = 0.0;
|
||||
if ((editorClipEnabled > 0.5 && center.y > editorClip) ||
|
||||
(editorFloorEnabled > 0.5 && center.y < editorFloor)) color.a = 0.0;
|
||||
}` });
|
||||
this.setPreferences(this.preferences);
|
||||
if (terrain.isEmpty()) this.controls.sceneCenter.set(bounds.center.x,bounds.center.y,bounds.center.z);
|
||||
@@ -151,10 +156,10 @@ export class AiEditorRuntime {
|
||||
setUrbanMap(document: UrbanMap) {
|
||||
this.urbanBounds=urbanExtent(document);
|
||||
this.urbanLayer?.dispose();
|
||||
this.urbanLayer=new EditorUrbanMapLayer(this.app,this.camera,document);this.urbanLayer.setClip(this.clip,this.clipFloor);this.urbanLayer.setVisible(this.urbanVisible);this.dirty=true;
|
||||
this.urbanLayer=new EditorUrbanMapLayer(this.app,this.camera,document);this.urbanLayer.setClip(this.clip,this.clipFloor);this.urbanLayer.setVisible(this.semanticMode&&this.urbanVisible);this.dirty=true;
|
||||
}
|
||||
snapshotView():SceneView{return {...this.controls.snapshot(),clip:[Number.isFinite(this.clipFloor)?this.clipFloor:null,Number.isFinite(this.clip)?this.clip:null]};}
|
||||
restoreView(view:SceneView){this.setClip(view.clip[1]??Infinity,view.clip[0]??-Infinity);this.controls.restore(view);this.syncCamera();this.dirty=true;}
|
||||
restoreView(view:SceneView){const [floor,ceiling]=sceneClipRange(view.clip,this.height);this.setClip(ceiling,floor);this.controls.restore(view);this.syncCamera();this.dirty=true;}
|
||||
watchCamera(callback:((q:[number,number,number,number])=>void)|null) {this.cameraProject=callback;this.dirty=true;}
|
||||
setProjection(mode:EditorProjection){this.surfacePicker.invalidate();this.controls.setProjection(mode);this.syncCamera();this.dirty=true;}
|
||||
view(direction:number[]){this.surfacePicker.invalidate();this.controls.view(direction);this.syncCamera();this.dirty=true;}
|
||||
@@ -202,7 +207,8 @@ export class AiEditorRuntime {
|
||||
return q[2]>=this.clipFloor&&q[2]<=this.clip?q:null;
|
||||
}
|
||||
setUrbanClasses(selected:readonly UrbanClassId[]) {this.urbanLayer?.setClasses(selected);this.dirty=true;}
|
||||
showUrbanMap(visible: boolean) { this.urbanVisible=visible;this.urbanLayer?.setVisible(visible);this.dirty=true; }
|
||||
setSemanticMode(active: boolean) { this.semanticMode=active;this.urbanLayer?.setVisible(active&&this.urbanVisible);this.dirty=true; }
|
||||
showUrbanMap(visible: boolean) { this.urbanVisible=visible;this.urbanLayer?.setVisible(this.semanticMode&&visible);this.dirty=true; }
|
||||
setSceneLayers({gaussian,collision}:{gaussian:boolean;collision:boolean}) {
|
||||
this.surfacePicker.invalidate();this.controls.invalidateSurface();this.collisionVisible=collision;
|
||||
if (collision && !this.collisionLayer && !this.terrain.bounds.isEmpty()) {
|
||||
@@ -229,13 +235,17 @@ export class AiEditorRuntime {
|
||||
this.app.resizeCanvas(this.canvas.clientWidth,this.canvas.clientHeight);this.dirty=true;
|
||||
}
|
||||
setClip(height: number, floor = -Infinity) {
|
||||
const slice=heightSlice(sceneClipRange([floor,height],this.height),this.height);
|
||||
height=slice.ceiling??Infinity;floor=slice.floor??-Infinity;
|
||||
this.surfacePicker.invalidate();this.controls.invalidateSurface();
|
||||
this.clip = height; this.clipFloor = floor;
|
||||
this.collisionLayer?.setClip(height,floor);
|
||||
this.urbanLayer?.setClip(height,floor);this.experienceLayer?.setClip(height,floor);
|
||||
if (this.scan.gsplat) {
|
||||
this.scan.gsplat.setParameter("editorClip", Number.isFinite(height) ? height : 1e9);
|
||||
this.scan.gsplat.setParameter("editorFloor", Number.isFinite(floor) ? floor : -1e9);
|
||||
this.scan.gsplat.setParameter("editorClip", Number.isFinite(height) ? height : 0);
|
||||
this.scan.gsplat.setParameter("editorFloor", Number.isFinite(floor) ? floor : 0);
|
||||
this.scan.gsplat.setParameter("editorClipEnabled", Number.isFinite(height) ? 1 : 0);
|
||||
this.scan.gsplat.setParameter("editorFloorEnabled", Number.isFinite(floor) ? 1 : 0);
|
||||
this.scan.gsplat.workBufferUpdate = WORKBUFFER_UPDATE_ONCE;
|
||||
}
|
||||
this.dirty = true;
|
||||
@@ -248,7 +258,10 @@ export class AiEditorRuntime {
|
||||
private syncCamera() {
|
||||
const c=this.controls.camera;
|
||||
this.camera.camera!.projection=isOrthographic(c)?PROJECTION_ORTHOGRAPHIC:PROJECTION_PERSPECTIVE;
|
||||
if(isOrthographic(c))this.camera.camera!.orthoHeight=c.top;
|
||||
if(isOrthographic(c)){
|
||||
this.camera.camera!.orthoHeight=screenSpan(c,1)/2;
|
||||
this.camera.camera!.fov=orthographicLodFov(screenSpan(c,1)/2,this.controls.focusDepth);
|
||||
}else this.camera.camera!.fov=c.fov;
|
||||
const { position:p, quaternion:q } = c;
|
||||
this.camera.setPosition(p.x,p.y,p.z); this.camera.setRotation(q.x,q.y,q.z,q.w);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {getSimulationLayout,readSceneView,writeSceneView,useSimulationLayout} from "./useSimulationLayout";
|
||||
import {PlannerCameraTools} from "./PlannerCameraTools";
|
||||
import { heightSlice } from "../../core/heightSlice";
|
||||
import { sceneClipRange, sceneClipLabel } from "../../core/simulation/sceneClip";
|
||||
import { InfrastructureAnalysis } from "./InfrastructureAnalysis";
|
||||
import { PlannerLegend } from "./PlannerLegend";
|
||||
import { SemanticEditor } from "./SemanticEditor";
|
||||
import { PlannerExperience } from "./PlannerExperience";
|
||||
import { loadUrbanMap, type UrbanClassId, type UrbanMap } from "../../core/simulation/urbanMap";
|
||||
import { loadUrbanMap, type UrbanMap } from "../../core/simulation/urbanMap";
|
||||
import type { PreparedRoute } from "../../core/simulation/routePreparation";
|
||||
import type { ScreenPoint } from "../../core/simulation/aiPolygon";
|
||||
import { editWaypoints, waypointEditing, waypointShortcut } from "../../core/simulation/waypointEditing";
|
||||
@@ -23,11 +23,11 @@ import { useSimulationFullscreen } from "./useSimulationFullscreen";
|
||||
|
||||
export interface LocalDraft { cache: EditorCache; points: AiWaypoint[]; id: string; sequence: number }
|
||||
export type LocationMode = "view" | "semantic" | "planning";
|
||||
export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, headerActions, routeActions, sceneMode, onSceneMode, busy=false, preparedRoute=null }: {
|
||||
export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, headerActions, routeActions, sceneMode, onSceneMode, onBack, busy=false, preparedRoute=null }: {
|
||||
world: AiWorld; initialPoints: AiWaypoint[]; onDraft: (draft: LocalDraft | null) => void;
|
||||
actionsHost: HTMLElement | null; headerActions: React.ReactNode;
|
||||
routeActionsHost: HTMLElement | null; routeActions: React.ReactNode; busy?: boolean; preparedRoute?:PreparedRoute|null;
|
||||
sceneMode:LocationMode; onSceneMode:(mode:LocationMode)=>void;
|
||||
sceneMode:LocationMode; onSceneMode:(mode:LocationMode)=>void; onBack:()=>void;
|
||||
}) {
|
||||
const [semanticHeader,setSemanticHeader]=useState<HTMLSpanElement|null>(null);
|
||||
const markerSvg=useRef<SVGSVGElement>(null);
|
||||
@@ -46,10 +46,7 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
const sceneLayers=layout.sceneLayers,setSceneLayers=(sceneLayers:typeof layout.sceneLayers)=>updateLayout({sceneLayers});
|
||||
const [urbanMap,setUrbanMap]=useState<UrbanMap|null>(null);
|
||||
const semantic=sceneMode==="semantic", planning=sceneMode==="planning";
|
||||
const urbanVisible=layout.infrastructure,setUrbanVisible=(infrastructure:boolean)=>updateLayout({infrastructure});
|
||||
const urbanClasses=layout.urbanLayers,setUrbanClasses=(urbanLayers:UrbanClassId[])=>updateLayout({urbanLayers});
|
||||
const [memoryVisible,setMemoryVisible]=useState(false);
|
||||
const [urbanError,setUrbanError]=useState<string|null>(null);
|
||||
const [markers, setMarkers] = useState<EditorMarker[]>([]);
|
||||
const [mode,setMode] = useState<"view" | "add">("view");
|
||||
const [clip,setClip] = useState<[number,number]|null>(null);
|
||||
@@ -62,7 +59,7 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
const sceneKey=cache.world.sha256!,remember=()=>{if(loaded&&runtime.current)writeSceneView(sceneKey,runtime.current.snapshotView());};
|
||||
const timer=window.setInterval(remember,1500);window.addEventListener("pagehide",remember);
|
||||
const abort=new AbortController();
|
||||
setUrbanMap(null);setUrbanError(null);
|
||||
setUrbanMap(null);
|
||||
setReady(false); setError(null); setClip(null);
|
||||
let view: AiEditorRuntime;
|
||||
try { view = new AiEditorRuntime(canvas.current,cache,setMarkers,setRouteProjection); }
|
||||
@@ -71,12 +68,12 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
view.setPreferences(preferences);view.setPoints(initialPoints); view.home();
|
||||
void view.load().then(() => { if (active) {
|
||||
const remembered=readSceneView(sceneKey),settings=getSimulationLayout();
|
||||
if(remembered){view.restoreView(remembered);setClip([remembered.clip[0]??view.height[0],remembered.clip[1]??view.height[1]]);}
|
||||
if(remembered){view.restoreView(remembered);setClip(sceneClipRange(view.snapshotView().clip,view.height));}
|
||||
view.setProjection(settings.projection);view.setSceneLayers(settings.sceneLayers);
|
||||
loaded=true;setReady(true);
|
||||
void loadUrbanMap(cache.world.world_id,cache.world.sha256!,abort.signal).then(map=>{
|
||||
if(active && map){view.setUrbanMap(map);setUrbanMap(map);}
|
||||
}).catch((e:Error)=>{if(active)setUrbanError(e.message);});
|
||||
}).catch((e:Error)=>{if(active)setError(e.message);});
|
||||
} }).catch((e: Error) => { if (active) setError(e.message); });
|
||||
return () => { remember();clearInterval(timer);window.removeEventListener("pagehide",remember);active=false; abort.abort(); runtime.current=null; view.dispose(); callback.current(null); };
|
||||
}, [cache?.key,cache?.status,retry]);
|
||||
@@ -85,8 +82,8 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
if (cache?.status === "ready" && ready) callback.current({ cache,points,id:draftId.current,sequence });
|
||||
}, [points,cache,ready,sequence,planning]);
|
||||
useEffect(()=>{
|
||||
if(!semantic&&urbanMap){runtime.current?.setUrbanMap(urbanMap);runtime.current?.setUrbanClasses(urbanClasses);runtime.current?.showUrbanMap(urbanVisible);}
|
||||
},[semantic,urbanMap,urbanVisible,urbanClasses]);
|
||||
runtime.current?.setSemanticMode(semantic);
|
||||
},[semantic,ready]);
|
||||
useEffect(()=>{
|
||||
runtime.current?.setRoute(planning?preparedRoute?.preview_xyz??[]:[]);
|
||||
|
||||
@@ -95,8 +92,6 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
setMode("view");press.current=null;runtime.current?.setAddMode(false);
|
||||
if(drag.current){edit({type:"cancel"});drag.current=null;runtime.current?.setNavigation(!busy);}
|
||||
},[sceneMode,ready]);
|
||||
// SemanticEditor owns both the edited map and its layer mask in semantic mode.
|
||||
useEffect(()=>{if(!semantic)runtime.current?.setUrbanClasses(urbanClasses);},[semantic,urbanClasses,urbanMap,ready]);
|
||||
useEffect(()=>{if(ready)try{runtime.current?.setSceneLayers(sceneLayers);}catch(e){setError((e as Error).message);}},[sceneLayers,ready]);
|
||||
useEffect(()=>{runtime.current?.setPreferences(preferences);},[preferences,ready]);
|
||||
useEffect(()=>{runtime.current?.setSelected(selected);},[selected,ready]);
|
||||
@@ -123,12 +118,20 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
: cache?.status === "ready" ? "Открываем локальную сцену" : "Готовим локальную копию сцены";
|
||||
const modeLabels={view:"Просмотр",semantic:"Семантика",planning:"Планирование миссии"};
|
||||
const infrastructure=semantic?<InfrastructureAnalysis worldId={world.world_id} worldSha={world.sha256!} busy={busy} hasMap={!!urbanMap}
|
||||
onMap={map=>{setUrbanMap(map);runtime.current?.setUrbanMap(map);runtime.current?.showUrbanMap(true);setUrbanError(null);}}/>:null;
|
||||
const header=<>{planning?<FieldFrame label="Выбор задания" labelPlacement="below" className="ai-polygon__task-field">{headerActions}</FieldFrame>:null}
|
||||
<FieldFrame label="Режим" labelPlacement="below" className="ai-polygon__mode-field">
|
||||
<Select label="Режим" value={sceneMode} onChange={onSceneMode} disabled={busy}
|
||||
options={([{value:"view",label:modeLabels.view},{value:"semantic",label:modeLabels.semantic},{value:"planning",label:modeLabels.planning}] as const).map(o=>({...o}))}/>
|
||||
</FieldFrame>{infrastructure}{semantic?<span className="ai-polygon__semantic-actions" ref={setSemanticHeader}/>:null}{planning?routeActions:null}</>;
|
||||
onMap={map=>{setUrbanMap(map);runtime.current?.setUrbanMap(map);runtime.current?.showUrbanMap(true);setError(null);}}/>:null;
|
||||
const header=<div className="ai-polygon__scene-actions">
|
||||
<div className="ai-polygon__context-actions">
|
||||
{planning?<FieldFrame label="Выбор задания" labelPlacement="below" className="ai-polygon__task-field">{headerActions}</FieldFrame>:null}
|
||||
{infrastructure}{semantic?<span className="ai-polygon__semantic-actions" ref={setSemanticHeader}/>:null}{planning?routeActions:null}
|
||||
</div>
|
||||
<div className="ai-polygon__mode-actions">
|
||||
<FieldFrame label="Режим" labelPlacement="below" className="ai-polygon__mode-field">
|
||||
<Select label="Режим" value={sceneMode} onChange={onSceneMode} disabled={busy}
|
||||
options={([{value:"view",label:modeLabels.view},{value:"semantic",label:modeLabels.semantic},{value:"planning",label:modeLabels.planning}] as const).map(o=>({...o}))}/>
|
||||
</FieldFrame>
|
||||
<IconButton label="Назад к локациям" disabled={busy} onClick={onBack}><Icon name="chevron-left"/></IconButton>
|
||||
</div>
|
||||
</div>;
|
||||
return <div className="ai-polygon__stage" ref={host}>
|
||||
{expanded ? <>
|
||||
<div className="ai-polygon__actions ai-polygon__planner-actions">{header}</div>
|
||||
@@ -138,7 +141,6 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
<div className="ai-polygon__telemetry-row ai-polygon__telemetry-row--local">
|
||||
<StatusBadge tone={ready ? "success" : "neutral"}>{ready ? modeLabels[sceneMode] : message}</StatusBadge>
|
||||
{planning?<p>{preparedRoute?`${preparedRoute.length_m.toFixed(1)} м · маршрут — ориентир, препятствия оцениваются при движении`:`${points.length} точек · первая — старт, последняя — финиш`}</p>:null}
|
||||
{!semantic && urbanVisible && urbanMap ? <p>Инфраструктура · {urbanMap.coverage.kind === "objects-only" ? `${urbanMap.schema_version === "missioncore.urban-map/v3" ? "по скану" : urbanMap.analysis?.scope === "whole-scene" ? `обследовано ${urbanMap.analysis.tiles_total} участков · данные в ${urbanMap.analysis.tiles_mapped}` : "участок"} · ${urbanMap.features.length} объектов · распознано автоматически` : `${(urbanMap.coverage.accepted_cells * urbanMap.coverage.cell_m ** 2).toFixed(0)} м² · неполное покрытие`}</p> : null}
|
||||
</div>
|
||||
<div className="ai-polygon__viewer">
|
||||
<div ref={viewport} className="ai-polygon__viewport ai-local-editor" onContextMenu={(e)=>e.preventDefault()}
|
||||
@@ -158,13 +160,10 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
}}><Icon name="trash"/></IconButton>:null}
|
||||
</div>
|
||||
<SegmentedGroup label="Слои сцены" className="ai-local-editor__layers">
|
||||
{!semantic&&urbanMap?<SegmentedButton title={urbanError??"Карта дорожной инфраструктуры"}
|
||||
active={urbanVisible} aria-pressed={urbanVisible}
|
||||
onClick={()=>{const visible=!urbanVisible;setUrbanVisible(visible);runtime.current?.showUrbanMap(visible);}}>Инфраструктура</SegmentedButton>:null}
|
||||
{(["gaussian","collision"] as const).map(key=><SegmentedButton key={key} active={sceneLayers[key]} aria-pressed={sceneLayers[key]}
|
||||
onClick={()=>{try {const next={...sceneLayers,[key]:!sceneLayers[key]};runtime.current?.setSceneLayers(next);setSceneLayers(next);setError(null);}
|
||||
catch(e){setError(e instanceof Error?e.message:"Не удалось показать слой коллизий.");}}}>{key==="gaussian"?"Gaussian":"Коллизии"}</SegmentedButton>)}
|
||||
{runtime.current && viewport.current ? <PlannerExperience worldId={world.world_id} worldSha={world.sha256!}
|
||||
{sceneMode!=="view" && runtime.current && viewport.current ? <PlannerExperience worldId={world.world_id} worldSha={world.sha256!}
|
||||
runtime={runtime.current} viewport={viewport.current} onVisibilityChange={setMemoryVisible}/> : null}
|
||||
</SegmentedGroup>
|
||||
{urbanMap&&urbanMap.schema_version!=="missioncore.urban-map/v1"&&runtime.current&&viewport.current?<SemanticEditor key={world.sha256} worldId={world.world_id} worldSha={world.sha256!}
|
||||
@@ -223,13 +222,13 @@ export function AiLocalPlanner({ world, initialPoints, onDraft, actionsHost, hea
|
||||
<text x={m[axis]![0]*1280+16} y={m[axis]![1]*720-12}>{axis.toUpperCase()}</text></g>:null):null}
|
||||
</g>:null)}
|
||||
</svg></div>
|
||||
{!semantic?<PlannerLegend map={urbanVisible?urbanMap:null} memory={memoryVisible}
|
||||
selected={urbanClasses} onChange={setUrbanClasses} disabled={busy}/>:null}
|
||||
{planning?<PlannerLegend map={null} memory={memoryVisible}
|
||||
selected={[]} onChange={()=>undefined} disabled={busy}/>:null}
|
||||
{!ready && !error ? <LoadingRegion className="ai-local-editor__loading" loading label={message} />:null}
|
||||
{ready ? <><div className="ai-route__height"><RangeControl orientation="vertical" limitSide="right" label="Срез"
|
||||
min={runtime.current!.height[0]} max={runtime.current!.height[1]} step="any" value={clip??runtime.current!.height}
|
||||
formatValue={(v)=>`${v.toFixed(1)} м`} formatLimit={(v)=>v.toFixed(1)}
|
||||
onChange={(v)=>{const next=heightSlice(v,runtime.current!.height);setClip(v);runtime.current!.setClip(next.ceiling??Infinity,next.floor??-Infinity);}}/></div>
|
||||
formatValue={(v)=>sceneClipLabel(v,runtime.current!.height)} formatLimit={(v)=>sceneClipLabel(v,runtime.current!.height)}
|
||||
onChange={(v)=>{const view=runtime.current!;view.setClip(v[1],v[0]);setClip(sceneClipRange(view.snapshotView().clip,view.height));}}/></div>
|
||||
{error?<div className="ai-route__tools"><p role="alert">{error}</p></div>:null}</>:null}
|
||||
{error && !ready ? <div className="ai-polygon__preview-error"><p role="alert">{error}</p><Button onClick={()=>setRetry(retry+1)}>Повторить загрузку</Button></div>:null}
|
||||
</div>
|
||||
|
||||
@@ -27,6 +27,7 @@ export class EditorCamera {
|
||||
private right = new Vector3();
|
||||
private delta = new Vector3();
|
||||
sceneCenter = new Vector3();
|
||||
get focusDepth(){return navigationDepth(this.camera,this.lastAnchor??this.sceneCenter);}
|
||||
pick: ((x:number,y:number)=>number[]|null)|null = null;
|
||||
pickSurface: ((x:number,y:number)=>Promise<number[]|null>)|null = null;
|
||||
constructor(private surface: HTMLElement, private canvas: HTMLCanvasElement) {
|
||||
|
||||
Reference in New Issue
Block a user