feat(timeline): 支持拖拽调整时长与运镜/轨迹关键帧时间
This commit is contained in:
1 parent
bab92c05b8
commit
8d67f17a84
21 files changed
+2556
-194
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
applyExternalViewSnapshot,
|
||||
applySnapshotToControls,
|
||||
DEFAULT_DIRECTOR_VIEW_SNAPSHOT,
|
||||
getViewportGizmoHitButtonStyle,
|
||||
@@ -43,6 +44,27 @@ it("flushes leftover orbit inertia before writing the reset view back", () => {
|
||||
expect(camera.position.toArray()).toEqual(DEFAULT_DIRECTOR_VIEW_SNAPSHOT.position);
|
||||
});
|
||||
|
||||
it("writes an external view change on the spot instead of deferring it to the next render", () => {
|
||||
// 机位视角下没有 OrbitControls:写不进去,交给切回导演视角时的副作用补写
|
||||
expect(applyExternalViewSnapshot(null, DEFAULT_DIRECTOR_VIEW_SNAPSHOT)).toBe(false);
|
||||
|
||||
const dampingStateDuringUpdate: boolean[] = [];
|
||||
const controls = {
|
||||
enableDamping: true,
|
||||
target: new Vector3(9, 9, 9),
|
||||
object: new PerspectiveCamera(),
|
||||
update: () => dampingStateDuringUpdate.push(controls.enableDamping),
|
||||
};
|
||||
|
||||
expect(applyExternalViewSnapshot(controls, DEFAULT_DIRECTOR_VIEW_SNAPSHOT)).toBe(true);
|
||||
|
||||
// 当场就把残余惯性结算掉并落到目标视角(惯性滑行中点重置视角不会再被推走)
|
||||
expect(dampingStateDuringUpdate).toEqual([false, false]);
|
||||
expect(controls.target.toArray()).toEqual(DEFAULT_DIRECTOR_VIEW_SNAPSHOT.target);
|
||||
expect(controls.object.position.toArray()).toEqual(DEFAULT_DIRECTOR_VIEW_SNAPSHOT.position);
|
||||
expect(controls.enableDamping).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps the viewport grid visible when a panorama background is active", () => {
|
||||
expect(shouldRenderViewportGrid(true, false)).toBe(true);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user