feat(editor): 机位画幅遮幅与监视器全屏对齐
主视口机位视角按传感器画幅加 letterbox 遮幅,使主视口、镜头监视器与视频导出的取景逐像素同源,虚化按传感器画幅归一化。镜头监视器新增全屏查看(Esc 关闭),支持拖拽瞄准与单击对焦并显示景深诊断读数,像素比上限改为 2 以消除机位视角的放大模糊。监视器与主视口统一按自动切机位口径解析当前机位。相机面板新增所选物体距离显示与一键对焦。
This commit is contained in:
1 parent
8fcc25955d
commit
89ac44c418
16 files changed
+1129
-92
No files matched your search
@@ -125,6 +125,24 @@ it("uses the provided right inspector layout for camera properties", () => {
|
||||
expect(fovField).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows the selected subject distance and focuses the camera onto it in one click", async () => {
|
||||
const user = userEvent.setup();
|
||||
// 选中可对焦物体(角色)后,面板直接给出「机位 → 物体」的实测距离
|
||||
useDirectorStore.setState({
|
||||
...useDirectorStore.getState(),
|
||||
selectedObjectId: "char_default_a",
|
||||
});
|
||||
render(<CameraPanel />);
|
||||
|
||||
// 默认机位 [0, 1.55, 5.4] → 角色焦点 [0, 0.99, 0] ≈ 5.4m
|
||||
expect(screen.getByLabelText("所选物体距离")).toHaveTextContent("所选物体 5.4 m");
|
||||
|
||||
await user.click(screen.getByRole("button", { name: "对焦到所选物体" }));
|
||||
|
||||
const camera = useDirectorStore.getState().project.cameras[0];
|
||||
expect(camera.focusDistance).toBeCloseTo(5.43, 1);
|
||||
});
|
||||
|
||||
it("keeps camera panel tab labels in fixed slots while switching tabs", async () => {
|
||||
const user = userEvent.setup();
|
||||
const { container } = render(<CameraPanel />);
|
||||
|
||||
Reference in new issue
Block a user