feat: 旋转单位改为度并支持轨迹点拖拽

统一数据模型中的旋转为度数并在渲染时转弧度,新增 InspectorAngleField 角度控件,为场景与轨迹点提供滑块和重置按钮;选中轨迹点时角色预览到该点并支持拖拽 gizmo 调整位置;机位点击统一走 selectObject 以正确切换右侧属性卡片。
This commit is contained in:
tongtong committed 2026-09-17 11:18:58 +08:00
1 parent e74cf6d28b
commit 0794486857
21 files changed
+659 -99

No files matched your search

+4 -2
View File
@@ -10,6 +10,7 @@ import {
} from "./DirectorCanvas";
import { GROUND_PLANE_SIZE } from "./sceneGround";
import { getViewportAspectFrameRect } from "./viewportAspectFrame";
import { degreesRotationToRadians } from "../schema/directorProject";
const mockCameraPositionSet = vi.hoisted(() => vi.fn());
const mockCameraLookAt = vi.hoisted(() => vi.fn());
@@ -370,7 +371,7 @@ it("shares the scene transform with the ground plane so the grid never becomes a
...useDirectorStore.getState().project.scene,
scale: 2,
position: [1, 3, -2],
rotation: [0, 0.5, 0],
rotation: [0, 90, 0],
groundHeight: 1.5,
},
},
@@ -384,7 +385,8 @@ it("shares the scene transform with the ground plane so the grid never becomes a
// 网格与地面同在场景组内:共享场景平移/旋转/缩放,不会各自留在不同坐标空间
expect(sceneGroup).not.toBeNull();
expect(sceneGroup).toHaveAttribute("position", "1,3,-2");
expect(sceneGroup).toHaveAttribute("rotation", "0,0.5,0");
// 场景旋转存的是度数,写进 Three.js group 前会转成弧度(90° → π/2)
expect(sceneGroup).toHaveAttribute("rotation", degreesRotationToRadians([0, 90, 0]).join(","));
expect(sceneGroup).toHaveAttribute("scale", "2,2,2");
// 网格自身的 y 相对场景原点,仍是「地面高度 + 微小抬升」
expect(grid).toHaveAttribute("data-position", "[0,1.502,0]");