fix: 优化Gizmo

This commit is contained in:
tongtong committed 2026-09-18 03:06:34 +08:00
1 parent 8645ea3007
commit 9b72f10b43
23 files changed
+787 -254

No files matched your search

+3 -2
View File
@@ -5,7 +5,7 @@ import { clearViewportCaptureHandler, setViewportCaptureHandler } from "../io/ca
import { BODY_TYPE_OPTIONS } from "../runtime/mannequin/bodyTypes";
import { createInitialDirectorState, useDirectorStore } from "../store/directorStore";
import { usePlaybackStore } from "../runtime/playbackStore";
import { getCameraRigPositionFromViewSnapshot, getCameraViewSnapshotFromShot } from "../schema/cameraGeometry";
import { getCameraLookRotationFromTarget, getCameraRigPositionFromViewSnapshot, getCameraViewSnapshotFromShot } from "../schema/cameraGeometry";
import { ViewportToolbar } from "./ViewportToolbar";
import { getModelLibraryItems } from "../modelLibrary/modelLibraryCatalog";
@@ -349,7 +349,8 @@ it("keeps add role and add camera actions available from the viewport capsule",
expect(state.project.cameras[1].fov).toBe(64);
expect(state.project.cameras[1].transform.position).toEqual(getCameraRigPositionFromViewSnapshot(snapshot));
expect(getCameraViewSnapshotFromShot(state.project.cameras[1]).position).toEqual(snapshot.position);
expect(state.project.cameras[1].target).toEqual([0, 1, -2]);
// 从视口新建的机位:把「视口位置 → 视口注视点」换算成注视朝向角
expect(state.project.cameras[1].lookRotation).toEqual(getCameraLookRotationFromTarget(snapshot.position, snapshot.target));
});
it("does not show operation feedback text on the right side of the viewport capsule", async () => {