|
@@ -13,7 +13,7 @@ export interface AnimationAction {
|
|
|
id: string;
|
|
|
title: string;
|
|
|
url: string;
|
|
|
-
|
|
|
+ action: string
|
|
|
}
|
|
|
export type AnimationModelAction = {
|
|
|
amplitude: number;
|
|
@@ -21,6 +21,7 @@ export type AnimationModelAction = {
|
|
|
time: number;
|
|
|
duration: number;
|
|
|
id: string;
|
|
|
+ key: string
|
|
|
name: string
|
|
|
};
|
|
|
export type AnimationModelSubtitle = {
|
|
@@ -39,7 +40,7 @@ export type AnimationModelFrame = {
|
|
|
};
|
|
|
export type AnimationModelPath = {
|
|
|
reverse: boolean;
|
|
|
- pathId: string;
|
|
|
+ pathId?: string;
|
|
|
time: number;
|
|
|
duration: number;
|
|
|
id: string;
|
|
@@ -74,80 +75,18 @@ export const fetchAnimationModels = async () => {
|
|
|
return [
|
|
|
{
|
|
|
id: "1",
|
|
|
- title: "模型1",
|
|
|
- url: "",
|
|
|
- frames: [
|
|
|
- { time: 10, name: "帧1" },
|
|
|
- { time: 20, name: "帧2" },
|
|
|
- { time: 30, name: "帧3" },
|
|
|
- ],
|
|
|
- actions: [
|
|
|
- { time: 10, duration: 3, name: "动作1" },
|
|
|
- { time: 20, duration: 5, name: "动作2" },
|
|
|
- { time: 30, duration: 3, name: "动作3" },
|
|
|
- ],
|
|
|
- subtitles: [
|
|
|
- { time: 0, duration: 15, name: "字幕1" },
|
|
|
- { time: 20, duration: 15, name: "字幕2" },
|
|
|
- { time: 40, duration: 30, name: "字幕3" },
|
|
|
- ],
|
|
|
- paths: [
|
|
|
- { time: 0, duration: 15, name: "路径1" },
|
|
|
- { time: 20, duration: 15, name: "路径2" },
|
|
|
- { time: 40, duration: 30, name: "路径3" },
|
|
|
- ],
|
|
|
+ title: 'dog',
|
|
|
+ url: "/animation/dog.glb",
|
|
|
+ showTitle: true,
|
|
|
+ fontSize: 12,
|
|
|
+ globalVisibility: true,
|
|
|
+ visibilityRange: 100,
|
|
|
+ frames: [],
|
|
|
+ actions: [],
|
|
|
+ subtitles: [],
|
|
|
+ paths: [],
|
|
|
},
|
|
|
- {
|
|
|
- id: "2",
|
|
|
- title: "模型2",
|
|
|
- url: "",
|
|
|
- frames: [
|
|
|
- { time: 10, name: "帧1" },
|
|
|
- { time: 20, name: "帧2" },
|
|
|
- { time: 30, name: "帧3" },
|
|
|
- ],
|
|
|
- actions: [
|
|
|
- { time: 10, duration: 3, name: "动作1" },
|
|
|
- { time: 20, duration: 5, name: "动作2" },
|
|
|
- { time: 30, duration: 3, name: "动作3" },
|
|
|
- ],
|
|
|
- subtitles: [
|
|
|
- { time: 0, duration: 15, name: "字幕1" },
|
|
|
- { time: 20, duration: 15, name: "字幕2" },
|
|
|
- { time: 40, duration: 30, name: "字幕3" },
|
|
|
- ],
|
|
|
- paths: [
|
|
|
- { time: 0, duration: 15, name: "路径1" },
|
|
|
- { time: 20, duration: 15, name: "路径2" },
|
|
|
- { time: 40, duration: 30, name: "路径3" },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- id: "3",
|
|
|
- title: "模型3",
|
|
|
- url: "",
|
|
|
- frames: [
|
|
|
- { time: 10, name: "帧1" },
|
|
|
- { time: 20, name: "帧2" },
|
|
|
- { time: 30, name: "帧3" },
|
|
|
- ],
|
|
|
- actions: [
|
|
|
- { time: 10, duration: 3, name: "动作1" },
|
|
|
- { time: 20, duration: 5, name: "动作2" },
|
|
|
- { time: 30, duration: 3, name: "动作3" },
|
|
|
- ],
|
|
|
- subtitles: [
|
|
|
- { time: 0, duration: 15, name: "字幕1" },
|
|
|
- { time: 20, duration: 15, name: "字幕2" },
|
|
|
- { time: 40, duration: 30, name: "字幕3" },
|
|
|
- ],
|
|
|
- paths: [
|
|
|
- { time: 0, duration: 15, name: "路径1" },
|
|
|
- { time: 20, duration: 15, name: "路径2" },
|
|
|
- { time: 40, duration: 30, name: "路径3" },
|
|
|
- ],
|
|
|
- },
|
|
|
- ] as unknown as AnimationModel[];
|
|
|
+ ] as AnimationModel[];
|
|
|
|
|
|
const ams = await axios.get<ServiceAnimationModel[]>(AM_MODEL_LIST, {
|
|
|
params: { caseId: params.caseId },
|
|
@@ -157,13 +96,16 @@ export const fetchAnimationModels = async () => {
|
|
|
|
|
|
export const fetchAnimationActions = async () => {
|
|
|
return [
|
|
|
- { id: "1", title: "模型1", url: "" },
|
|
|
- { id: "2", title: "模型2", url: "" },
|
|
|
- { id: "3", title: "模型3", url: "" },
|
|
|
- { id: "2", title: "模型2", url: "" },
|
|
|
- { id: "3", title: "模型3", url: "" },
|
|
|
- { id: "2", title: "模型2", url: "" },
|
|
|
- { id: "3", title: "模型3", url: "" },
|
|
|
+ { id: "1", action: 'Walk', title: "走", url: "" },
|
|
|
+ { id: "2", action: 'Run', title: "跑", url: "" },
|
|
|
+ { id: "3", action: 'Climb', title: "爬", url: "" },
|
|
|
+ { id: "2", action: 'JumpUp', title: "向上跳", url: "" },
|
|
|
+ { id: "3", action: 'JumpDown', title: "向下跳", url: "" },
|
|
|
+ { id: "2", action: 'TurnLeft', title: "左转", url: "" },
|
|
|
+ { id: "3", action: 'TurnRight', title: "右转", url: "" },
|
|
|
+ { id: "3", action: 'FallForward', title: "向前倒地", url: "" },
|
|
|
+ { id: "3", action: 'FallBackward', title: "向后倒地", url: "" },
|
|
|
+
|
|
|
];
|
|
|
};
|
|
|
|