index.js
1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// clips/index.js — 汇总各轨道动作 + 轨道元数据(TRACKS / TRACK_BONES / TRACK_DEFAULTS)。
// 仅做数据聚合,无求值/插值逻辑(那些全在 @drama/core)。
import { BASE_CLIPS } from './base.js'
import { LOWER_BODY_CLIPS } from './lower-body.js'
import { ARM_CLIPS } from './arm.js'
import { HEAD_CLIPS } from './head.js'
/** @type {Record<string, import('../types.js').AnimationClip>} */
export const CLIPS = {
...BASE_CLIPS,
...LOWER_BODY_CLIPS,
...ARM_CLIPS,
...HEAD_CLIPS,
}
/** 有序轨道列表。 @type {string[]} */
export const TRACKS = ['base', 'lower_body', 'arm_l', 'arm_r', 'head']
// 每条轨道允许写入的 bone 子集(互不相交;face 走单独的程序化通道,不在此)。
/** @type {Record<string, string[]>} */
export const TRACK_BONES = {
base: ['torso'],
// hip 归 lower_body,使「跪下」等下肢动作能同时降低胯部 + 折叠腿。
lower_body: ['hip', 'thigh_l', 'shin_l', 'thigh_r', 'shin_r'],
arm_l: ['upper_arm_l', 'lower_arm_l'],
arm_r: ['upper_arm_r', 'lower_arm_r'],
head: ['neck', 'head'],
}
// 每条轨道的默认 clip(没指定动作时回落到它)。
/** @type {Record<string, string>} */
export const TRACK_DEFAULTS = {
base: 'base.idle',
lower_body: 'leg.stand_together',
arm_l: 'arm_l.down',
arm_r: 'arm_r.down',
head: 'head.idle',
}