qt-human 2.2.0-alpha.5 → 2.2.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/earth_bg.png +0 -0
- package/dist/assets/empty.wav +0 -0
- package/dist/assets/images/earth_bg.png +0 -0
- package/dist/assets/images/sky.png +0 -0
- package/dist/assets/images/starflake1.png +0 -0
- package/dist/assets/images/starflake2.png +0 -0
- package/dist/assets/sky.png +0 -0
- package/dist/assets/starflake1.png +0 -0
- package/dist/assets/starflake2.png +0 -0
- package/dist/assets/wav/empty.wav +0 -0
- package/dist/bundle.esm.js +4 -0
- package/dist/bundle.iife.js +4 -0
- package/dist/bundle.umd.js +4 -0
- package/dist/index.d.ts +1031 -0
- package/dist/types/api/helper/index.d.ts +2 -0
- package/dist/types/api/human.d.ts +20 -0
- package/dist/types/api/interface/index.d.ts +35 -0
- package/dist/types/const.d.ts +12 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/modules/components/loading.d.ts +37 -0
- package/dist/types/modules/core/audio.d.ts +27 -0
- package/dist/types/modules/core/loader.d.ts +8 -0
- package/dist/types/modules/core/recorder.d.ts +26 -0
- package/dist/types/modules/core/recorder2.d.ts +38 -0
- package/dist/types/modules/core/render.d.ts +117 -0
- package/dist/types/modules/core/voice-interaction.d.ts +46 -0
- package/dist/types/modules/core/websocket.d.ts +19 -0
- package/dist/types/modules/human.d.ts +78 -0
- package/dist/types/types/api.d.ts +0 -0
- package/dist/types/types/common.d.ts +0 -0
- package/dist/types/types/declarations.d.ts +4 -0
- package/dist/types/types/enum.d.ts +20 -0
- package/dist/types/types/enum.ts +38 -0
- package/dist/types/types/index.d.ts +659 -0
- package/dist/types/types/model.d.ts +521 -0
- package/dist/types/types/recorder.d.ts +3 -0
- package/dist/types/utils/AudioManager.d.ts +45 -0
- package/dist/types/utils/actionNotifier.d.ts +11 -0
- package/dist/types/utils/aes.d.ts +3 -0
- package/dist/types/utils/blendShapes.d.ts +12 -0
- package/dist/types/utils/blendShapes2.d.ts +13 -0
- package/dist/types/utils/blendShapesAzure.d.ts +13 -0
- package/dist/types/utils/blendShapesOvr.d.ts +11 -0
- package/dist/types/utils/chatMessageHandler.d.ts +21 -0
- package/dist/types/utils/detector.d.ts +2 -0
- package/dist/types/utils/eventBus.d.ts +8 -0
- package/dist/types/utils/fileCache.d.ts +11 -0
- package/dist/types/utils/framePlayer.d.ts +28 -0
- package/dist/types/utils/frameProbeTime.d.ts +16 -0
- package/dist/types/utils/fuse.d.ts +8 -0
- package/dist/types/utils/http.d.ts +18 -0
- package/dist/types/utils/index.d.ts +8 -0
- package/dist/types/utils/repeat.d.ts +18 -0
- package/dist/types/utils/sentences.d.ts +5 -0
- package/dist/types/utils/sequence.d.ts +15 -0
- package/dist/types/utils/storage.d.ts +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
/* three-json.d.ts — Three.js .to() 常见结构覆盖(r15x–r16x)
|
|
2
|
+
说明:
|
|
3
|
+
1) 数值枚举(Wrap/Filter/Encoding/Format/Mapping 等)在 中通常是 number(三的常量值),此处统一用 number。
|
|
4
|
+
2) 某些字段因版本差异或材质/纹理的多样性而不稳定,使用可选属性 + 索引签名兜底。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { OrbitControls } from "three-stdlib";
|
|
8
|
+
|
|
9
|
+
export type UUID = string;
|
|
10
|
+
export type ColorHex = number;
|
|
11
|
+
|
|
12
|
+
export type Vec2 = [number, number];
|
|
13
|
+
export type Vec3 = [number, number, number];
|
|
14
|
+
export type Vec4 = [number, number, number, number];
|
|
15
|
+
export type Mat4 = number[]; // length 16
|
|
16
|
+
|
|
17
|
+
/* ===== Root ===== */
|
|
18
|
+
|
|
19
|
+
export interface ThreeJSON<T> {
|
|
20
|
+
metadata: {
|
|
21
|
+
version: number;
|
|
22
|
+
type:
|
|
23
|
+
| "Object"
|
|
24
|
+
| "Scene"
|
|
25
|
+
| "Geometry"
|
|
26
|
+
| "Material"
|
|
27
|
+
| "BufferGeometry"
|
|
28
|
+
| "Animation";
|
|
29
|
+
generator: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
object?: T; // 主对象树(通常是 Scene / Object3D)
|
|
33
|
+
geometries?: Geometry[]; // 资源池
|
|
34
|
+
materials?: Material[];
|
|
35
|
+
textures?: Texture[];
|
|
36
|
+
images?: Image[];
|
|
37
|
+
animations?: AnimationClip[];
|
|
38
|
+
|
|
39
|
+
// 某些版本还会出现 fonts/shapes/nodes 等自定义扩展:
|
|
40
|
+
[ext: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ===== Object3D 基类 ===== */
|
|
44
|
+
|
|
45
|
+
export interface Object3DBase {
|
|
46
|
+
uuid: UUID;
|
|
47
|
+
type: string; // e.g. "Scene" | "Mesh" | "PerspectiveCamera" | "PointLight" | ...
|
|
48
|
+
name?: string;
|
|
49
|
+
|
|
50
|
+
// 变换
|
|
51
|
+
matrix?: Mat4; // 若存在,position/rotation/quaternion/scale 可能不会同时写出
|
|
52
|
+
position?: Vec3;
|
|
53
|
+
rotation?: Vec3; // Euler (XYZ, radians)
|
|
54
|
+
quaternion?: Vec4;
|
|
55
|
+
scale?: Vec3;
|
|
56
|
+
up?: Vec3;
|
|
57
|
+
|
|
58
|
+
// 状态
|
|
59
|
+
visible?: boolean;
|
|
60
|
+
castShadow?: boolean;
|
|
61
|
+
receiveShadow?: boolean;
|
|
62
|
+
frustumCulled?: boolean;
|
|
63
|
+
renderOrder?: number;
|
|
64
|
+
layers?: number;
|
|
65
|
+
|
|
66
|
+
userData?: Record<string, unknown>;
|
|
67
|
+
|
|
68
|
+
children?: Object3D[]; // 层级
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* ===== 具体 Object 类型 ===== */
|
|
72
|
+
|
|
73
|
+
// ---------- Scene ----------
|
|
74
|
+
export interface Scene extends Object3DBase {
|
|
75
|
+
type: "Scene";
|
|
76
|
+
background?: ColorHex | UUID | null; // 颜色或纹理/立方体纹理 uuid
|
|
77
|
+
environment?: UUID | null; // 环境贴图 uuid
|
|
78
|
+
fog?: Fog | null; // Fog / FogExp2
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ---------- Cameras ----------
|
|
82
|
+
export interface Camera extends Object3DBase {
|
|
83
|
+
type:
|
|
84
|
+
| "PerspectiveCamera"
|
|
85
|
+
| "OrthographicCamera"
|
|
86
|
+
| "ArrayCamera"
|
|
87
|
+
| "StereoCamera"; // 少见;通常只会导出前两者
|
|
88
|
+
zoom?: number;
|
|
89
|
+
near?: number;
|
|
90
|
+
far?: number;
|
|
91
|
+
focus?: number;
|
|
92
|
+
filmGauge?: number; // 透视相机可用
|
|
93
|
+
filmOffset?: number; // 透视相机可用
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface PerspectiveCamera extends Camera {
|
|
97
|
+
type: "PerspectiveCamera";
|
|
98
|
+
fov: number;
|
|
99
|
+
// aspect 通常可选(可由渲染器设置),导出里不一定包含
|
|
100
|
+
aspect?: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface OrthographicCamera extends Camera {
|
|
104
|
+
type: "OrthographicCamera";
|
|
105
|
+
left: number;
|
|
106
|
+
right: number;
|
|
107
|
+
top: number;
|
|
108
|
+
bottom: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ---------- Lights ----------
|
|
112
|
+
export interface Light extends Object3DBase {
|
|
113
|
+
type:
|
|
114
|
+
| "AmbientLight"
|
|
115
|
+
| "HemisphereLight"
|
|
116
|
+
| "DirectionalLight"
|
|
117
|
+
| "PointLight"
|
|
118
|
+
| "SpotLight"
|
|
119
|
+
| "RectAreaLight";
|
|
120
|
+
color?: ColorHex;
|
|
121
|
+
intensity?: number;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface AmbientLight extends Light {
|
|
125
|
+
type: "AmbientLight";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface HemisphereLight extends Light {
|
|
129
|
+
type: "HemisphereLight";
|
|
130
|
+
groundColor?: ColorHex;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface DirectionalLight extends Light {
|
|
134
|
+
type: "DirectionalLight";
|
|
135
|
+
shadow?: LightShadow;
|
|
136
|
+
// 目标通常以 Object3D 形式作为 child 一并导出,也可能出现 target uuid:
|
|
137
|
+
target?: UUID;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface PointLight extends Light {
|
|
141
|
+
type: "PointLight";
|
|
142
|
+
distance?: number;
|
|
143
|
+
decay?: number;
|
|
144
|
+
shadow?: LightShadow;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface SpotLight extends Light {
|
|
148
|
+
type: "SpotLight";
|
|
149
|
+
distance?: number;
|
|
150
|
+
angle?: number;
|
|
151
|
+
penumbra?: number;
|
|
152
|
+
decay?: number;
|
|
153
|
+
shadow?: LightShadow;
|
|
154
|
+
target?: UUID;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface RectAreaLight extends Light {
|
|
158
|
+
type: "RectAreaLight";
|
|
159
|
+
width: number;
|
|
160
|
+
height: number;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// 阴影
|
|
164
|
+
export interface LightShadow {
|
|
165
|
+
camera?: {
|
|
166
|
+
type?: string; // "PerspectiveCamera" | "OrthographicCamera"
|
|
167
|
+
near?: number;
|
|
168
|
+
far?: number;
|
|
169
|
+
fov?: number; // 透视
|
|
170
|
+
left?: number; // 正交
|
|
171
|
+
right?: number;
|
|
172
|
+
top?: number;
|
|
173
|
+
bottom?: number;
|
|
174
|
+
};
|
|
175
|
+
bias?: number;
|
|
176
|
+
normalBias?: number;
|
|
177
|
+
radius?: number;
|
|
178
|
+
mapSize?: [number, number];
|
|
179
|
+
autoUpdate?: boolean;
|
|
180
|
+
needsUpdate?: boolean;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// ---------- Mesh / Line / Points / Sprite / Group / Bone ----------
|
|
184
|
+
export interface Mesh extends Object3DBase {
|
|
185
|
+
type: "Mesh" | "InstancedMesh" | "SkinnedMesh";
|
|
186
|
+
geometry?: UUID; // 引用几何体
|
|
187
|
+
material?: UUID | UUID[]; // 引用材质
|
|
188
|
+
drawMode?: number; // e.g. TrianglesDrawMode / TriangleStripDrawMode
|
|
189
|
+
morphTargetInfluences?: number[];
|
|
190
|
+
morphTargetDictionary?: Record<string, number>;
|
|
191
|
+
// SkinnedMesh 专属
|
|
192
|
+
bindMode?: "attached" | "detached" | string;
|
|
193
|
+
bindMatrix?: Mat4;
|
|
194
|
+
bindMatrixInverse?: Mat4;
|
|
195
|
+
skeleton?: {
|
|
196
|
+
bones: UUID[]; // Bone 对象的 uuid 列表
|
|
197
|
+
boneInverses?: Mat4[]; // 可选
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface Line extends Object3DBase {
|
|
202
|
+
type: "Line" | "LineSegments" | "LineLoop";
|
|
203
|
+
geometry?: UUID;
|
|
204
|
+
material?: UUID;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface Points extends Object3DBase {
|
|
208
|
+
type: "Points";
|
|
209
|
+
geometry?: UUID;
|
|
210
|
+
material?: UUID;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface Sprite extends Object3DBase {
|
|
214
|
+
type: "Sprite";
|
|
215
|
+
material?: UUID;
|
|
216
|
+
center?: Vec2;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface Group extends Object3DBase {
|
|
220
|
+
type: "Group";
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface Bone extends Object3DBase {
|
|
224
|
+
type: "Bone";
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export type Object3D =
|
|
228
|
+
| Scene
|
|
229
|
+
| PerspectiveCamera
|
|
230
|
+
| OrthographicCamera
|
|
231
|
+
| Camera
|
|
232
|
+
| AmbientLight
|
|
233
|
+
| HemisphereLight
|
|
234
|
+
| DirectionalLight
|
|
235
|
+
| PointLight
|
|
236
|
+
| SpotLight
|
|
237
|
+
| RectAreaLight
|
|
238
|
+
| Mesh
|
|
239
|
+
| Line
|
|
240
|
+
| Points
|
|
241
|
+
| Sprite
|
|
242
|
+
| Group
|
|
243
|
+
| Bone
|
|
244
|
+
| (Object3DBase & { [k: string]: unknown }); // 兜底扩展
|
|
245
|
+
|
|
246
|
+
/* ===== Fog ===== */
|
|
247
|
+
|
|
248
|
+
export type Fog =
|
|
249
|
+
| { type: "Fog"; color: ColorHex; near: number; far: number }
|
|
250
|
+
| { type: "FogExp2"; color: ColorHex; density: number };
|
|
251
|
+
|
|
252
|
+
/* ===== Geometry(以 BufferGeometry 为主) ===== */
|
|
253
|
+
|
|
254
|
+
export interface Geometry {
|
|
255
|
+
uuid: UUID;
|
|
256
|
+
type: string; // "BufferGeometry" | 具体几何类型(BoxGeometry/CylinderGeometry 等)视版本而定
|
|
257
|
+
name?: string;
|
|
258
|
+
data?: BufferGeometryData; // BufferGeometry 底层数据
|
|
259
|
+
// 某些旧版本/手写导出会把参数(parameters)直接放在此处:
|
|
260
|
+
parameters?: Record<string, unknown>;
|
|
261
|
+
[extra: string]: unknown;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface BufferGeometryData {
|
|
265
|
+
attributes: Record<
|
|
266
|
+
string,
|
|
267
|
+
BufferAttribute | InterleavedBufferAttribute
|
|
268
|
+
>;
|
|
269
|
+
index?: BufferAttribute | InterleavedBufferAttribute;
|
|
270
|
+
morphAttributes?: Record<string, BufferAttribute[]>;
|
|
271
|
+
morphTargetsRelative?: boolean;
|
|
272
|
+
|
|
273
|
+
groups?: { start: number; count: number; materialIndex?: number }[];
|
|
274
|
+
|
|
275
|
+
boundingBox?: { min: Vec3; max: Vec3 };
|
|
276
|
+
boundingSphere?: { center: Vec3; radius: number };
|
|
277
|
+
|
|
278
|
+
drawRange?: { start: number; count: number };
|
|
279
|
+
[extra: string]: unknown;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface BufferAttribute {
|
|
283
|
+
itemSize: number;
|
|
284
|
+
type: string; // e.g. "Float32Array" | "Uint16Array" ...
|
|
285
|
+
array: number[]; // 导出为普通 number 数组
|
|
286
|
+
normalized?: boolean;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export interface InterleavedBufferAttribute {
|
|
290
|
+
itemSize: number;
|
|
291
|
+
type: string;
|
|
292
|
+
data: {
|
|
293
|
+
buffer: number[]; // 展平数据
|
|
294
|
+
stride: number;
|
|
295
|
+
type: string;
|
|
296
|
+
};
|
|
297
|
+
offset: number;
|
|
298
|
+
normalized?: boolean;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* ===== Materials ===== */
|
|
302
|
+
|
|
303
|
+
export interface MaterialBase {
|
|
304
|
+
uuid: UUID;
|
|
305
|
+
type: string; // "MeshStandardMaterial" | "MeshPhysicalMaterial" | "PointsMaterial" | "LineBasicMaterial" | ...
|
|
306
|
+
name?: string;
|
|
307
|
+
|
|
308
|
+
color?: ColorHex;
|
|
309
|
+
opacity?: number;
|
|
310
|
+
transparent?: boolean;
|
|
311
|
+
alphaTest?: number;
|
|
312
|
+
depthTest?: boolean;
|
|
313
|
+
depthWrite?: boolean;
|
|
314
|
+
colorWrite?: boolean;
|
|
315
|
+
side?: number; // FrontSide/BackSide/DoubleSide
|
|
316
|
+
blending?: number;
|
|
317
|
+
blendSrc?: number;
|
|
318
|
+
blendDst?: number;
|
|
319
|
+
blendEquation?: number;
|
|
320
|
+
blendSrcAlpha?: number;
|
|
321
|
+
blendDstAlpha?: number;
|
|
322
|
+
blendEquationAlpha?: number;
|
|
323
|
+
polygonOffset?: boolean;
|
|
324
|
+
polygonOffsetFactor?: number;
|
|
325
|
+
polygonOffsetUnits?: number;
|
|
326
|
+
dithering?: boolean;
|
|
327
|
+
toneMapped?: boolean;
|
|
328
|
+
visible?: boolean;
|
|
329
|
+
vertexColors?: boolean | number; // 新旧差异
|
|
330
|
+
|
|
331
|
+
// map/纹理引用(均为纹理 uuid)
|
|
332
|
+
map?: UUID | null;
|
|
333
|
+
alphaMap?: UUID | null;
|
|
334
|
+
aoMap?: UUID | null;
|
|
335
|
+
aoMapIntensity?: number;
|
|
336
|
+
bumpMap?: UUID | null;
|
|
337
|
+
bumpScale?: number;
|
|
338
|
+
normalMap?: UUID | null;
|
|
339
|
+
normalScale?: Vec2;
|
|
340
|
+
displacementMap?: UUID | null;
|
|
341
|
+
displacementScale?: number;
|
|
342
|
+
displacementBias?: number;
|
|
343
|
+
emissive?: ColorHex;
|
|
344
|
+
emissiveIntensity?: number;
|
|
345
|
+
emissiveMap?: UUID | null;
|
|
346
|
+
envMap?: UUID | null;
|
|
347
|
+
envMapIntensity?: number;
|
|
348
|
+
lightMap?: UUID | null;
|
|
349
|
+
lightMapIntensity?: number;
|
|
350
|
+
metalness?: number;
|
|
351
|
+
metalnessMap?: UUID | null;
|
|
352
|
+
roughness?: number;
|
|
353
|
+
roughnessMap?: UUID | null;
|
|
354
|
+
|
|
355
|
+
// Physical/Transmission/Sheen/Iridescence/Anisotropy 等(按需出现)
|
|
356
|
+
clearcoat?: number;
|
|
357
|
+
clearcoatRoughness?: number;
|
|
358
|
+
clearcoatNormalMap?: UUID | null;
|
|
359
|
+
clearcoatNormalScale?: Vec2;
|
|
360
|
+
|
|
361
|
+
sheen?: number | Vec3;
|
|
362
|
+
sheenColor?: ColorHex;
|
|
363
|
+
sheenRoughness?: number;
|
|
364
|
+
sheenColorMap?: UUID | null;
|
|
365
|
+
sheenRoughnessMap?: UUID | null;
|
|
366
|
+
|
|
367
|
+
transmission?: number;
|
|
368
|
+
transmissionMap?: UUID | null;
|
|
369
|
+
thickness?: number;
|
|
370
|
+
thicknessMap?: UUID | null;
|
|
371
|
+
attenuationColor?: ColorHex;
|
|
372
|
+
attenuationDistance?: number;
|
|
373
|
+
ior?: number;
|
|
374
|
+
|
|
375
|
+
specularIntensity?: number;
|
|
376
|
+
specularIntensityMap?: UUID | null;
|
|
377
|
+
specularColor?: ColorHex;
|
|
378
|
+
specularColorMap?: UUID | null;
|
|
379
|
+
|
|
380
|
+
iridescence?: number;
|
|
381
|
+
iridescenceIOR?: number;
|
|
382
|
+
iridescenceThicknessRange?: Vec2;
|
|
383
|
+
iridescenceThicknessMap?: UUID | null;
|
|
384
|
+
|
|
385
|
+
anisotropy?: number;
|
|
386
|
+
anisotropyMap?: UUID | null;
|
|
387
|
+
anisotropyRotation?: number;
|
|
388
|
+
|
|
389
|
+
// Shader/Node/Raw/Phong/Lambert/Matcap 等材质的补充字段:
|
|
390
|
+
wireframe?: boolean;
|
|
391
|
+
wireframeLinewidth?: number;
|
|
392
|
+
flatShading?: boolean;
|
|
393
|
+
shininess?: number;
|
|
394
|
+
reflectivity?: number;
|
|
395
|
+
refractionRatio?: number;
|
|
396
|
+
gradientMap?: UUID | null;
|
|
397
|
+
matcap?: UUID | null;
|
|
398
|
+
|
|
399
|
+
skinning?: boolean;
|
|
400
|
+
morphTargets?: boolean;
|
|
401
|
+
morphNormals?: boolean;
|
|
402
|
+
|
|
403
|
+
defines?: Record<string, unknown>;
|
|
404
|
+
uniforms?: Record<string, unknown>;
|
|
405
|
+
extensions?: Record<string, boolean>;
|
|
406
|
+
glslVersion?: number;
|
|
407
|
+
|
|
408
|
+
userData?: Record<string, unknown>;
|
|
409
|
+
|
|
410
|
+
[extra: string]: unknown;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export type Material = MaterialBase;
|
|
414
|
+
|
|
415
|
+
/* ===== Textures & Images ===== */
|
|
416
|
+
|
|
417
|
+
export interface Texture {
|
|
418
|
+
uuid: UUID;
|
|
419
|
+
name?: string;
|
|
420
|
+
|
|
421
|
+
image?: UUID | ImageData; // 常见为 image: <image uuid>;DataTexture 会内联 data
|
|
422
|
+
mapping?: number;
|
|
423
|
+
channel?: number;
|
|
424
|
+
|
|
425
|
+
wrap?: [number, number]; // [wrapS, wrapT]
|
|
426
|
+
wrapS?: number;
|
|
427
|
+
wrapT?: number;
|
|
428
|
+
magFilter?: number;
|
|
429
|
+
minFilter?: number;
|
|
430
|
+
anisotropy?: number;
|
|
431
|
+
|
|
432
|
+
format?: number;
|
|
433
|
+
type?: number; // 数据类型
|
|
434
|
+
encoding?: number;
|
|
435
|
+
|
|
436
|
+
flipY?: boolean;
|
|
437
|
+
premultiplyAlpha?: boolean;
|
|
438
|
+
|
|
439
|
+
repeat?: Vec2;
|
|
440
|
+
offset?: Vec2;
|
|
441
|
+
center?: Vec2;
|
|
442
|
+
rotation?: number;
|
|
443
|
+
matrixAutoUpdate?: boolean;
|
|
444
|
+
|
|
445
|
+
// 立方体纹理/3D 纹理/视频纹理等会有额外键:
|
|
446
|
+
isRenderTargetTexture?: boolean;
|
|
447
|
+
uvTransform?: number[]; // 某些版本
|
|
448
|
+
|
|
449
|
+
userData?: Record<string, unknown>;
|
|
450
|
+
[extra: string]: unknown;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export interface ImageFile {
|
|
454
|
+
uuid: UUID;
|
|
455
|
+
url: string; // 外链或相对路径
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export interface ImageData {
|
|
459
|
+
uuid: UUID;
|
|
460
|
+
data: number[] | string; // DataTexture 可能是 base64 / 数组
|
|
461
|
+
width: number;
|
|
462
|
+
height: number;
|
|
463
|
+
// 可选元信息
|
|
464
|
+
type?: number;
|
|
465
|
+
format?: number;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export type Image = ImageFile | ImageData;
|
|
469
|
+
|
|
470
|
+
/* ===== Animations ===== */
|
|
471
|
+
|
|
472
|
+
export interface AnimationClip {
|
|
473
|
+
name: string;
|
|
474
|
+
duration: number; // 秒
|
|
475
|
+
tracks: KeyframeTrack[];
|
|
476
|
+
blendMode?: number;
|
|
477
|
+
uuid?: UUID;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export interface KeyframeTrack {
|
|
481
|
+
name: string; // 目标路径:e.g. "Bone001.position" / ".quaternion" / "mesh.morphTargetInfluences[Smile]"
|
|
482
|
+
type: string; // e.g. "number", "vector", "quaternion", "color"(或具体 Track 类名)
|
|
483
|
+
times: number[]; // 关键帧时间(秒)
|
|
484
|
+
values: number[]; // 扁平数值
|
|
485
|
+
interpolation?: number; // InterpolateLinear 等
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/* ===== 方便类型合集 ===== */
|
|
489
|
+
|
|
490
|
+
export type AnyCamera = PerspectiveCamera | OrthographicCamera | Camera;
|
|
491
|
+
export type AnyLight =
|
|
492
|
+
| AmbientLight
|
|
493
|
+
| HemisphereLight
|
|
494
|
+
| DirectionalLight
|
|
495
|
+
| PointLight
|
|
496
|
+
| SpotLight
|
|
497
|
+
| RectAreaLight;
|
|
498
|
+
|
|
499
|
+
export interface BodyOption {
|
|
500
|
+
//
|
|
501
|
+
key: string;
|
|
502
|
+
name: string;
|
|
503
|
+
// 前缀
|
|
504
|
+
prefix: string;
|
|
505
|
+
// 后缀
|
|
506
|
+
suffix: string;
|
|
507
|
+
}
|
|
508
|
+
export interface Body {
|
|
509
|
+
// 主体模型名称
|
|
510
|
+
name: string;
|
|
511
|
+
// 部位描述
|
|
512
|
+
options: BodyOption[];
|
|
513
|
+
}
|
|
514
|
+
export interface ModelDescription {
|
|
515
|
+
name: string
|
|
516
|
+
model: Object3DBase & { body: Body }
|
|
517
|
+
camera: ThreeJSON<Camera>
|
|
518
|
+
lights: ThreeJSON<Light>[]
|
|
519
|
+
orbitControls: ThreeJSON<OrbitControls>
|
|
520
|
+
dracoPath?: string
|
|
521
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface AudioConfig {
|
|
2
|
+
sampleRate?: number;
|
|
3
|
+
channels?: number;
|
|
4
|
+
bufferSize?: number;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare enum AudioState {
|
|
8
|
+
IDLE = "idle",
|
|
9
|
+
PLAYING = "playing",
|
|
10
|
+
PAUSED = "paused",
|
|
11
|
+
STOPPED = "stopped"
|
|
12
|
+
}
|
|
13
|
+
export declare class AudioManager {
|
|
14
|
+
private audioContext;
|
|
15
|
+
private audioWorkletNode;
|
|
16
|
+
private state;
|
|
17
|
+
private config;
|
|
18
|
+
private isInitialized;
|
|
19
|
+
private onPlaybackStartedHandler?;
|
|
20
|
+
private onPlaybackEndedHandler?;
|
|
21
|
+
private onPlaybackStoppedHandler?;
|
|
22
|
+
private onErrorHandler?;
|
|
23
|
+
constructor(config?: AudioConfig);
|
|
24
|
+
setRate(rate: number): Promise<void>;
|
|
25
|
+
initialize(userGesture?: boolean): Promise<void>;
|
|
26
|
+
private completeInitialization;
|
|
27
|
+
private ensureFullyInitialized;
|
|
28
|
+
playAudio(pcmData: ArrayBuffer): Promise<void>;
|
|
29
|
+
appendAudio(pcmData: ArrayBuffer): Promise<void>;
|
|
30
|
+
stopPlayback(): void;
|
|
31
|
+
clearBuffer(): void;
|
|
32
|
+
getStats(): Promise<any>;
|
|
33
|
+
getState(): AudioState;
|
|
34
|
+
isPlaying(): boolean;
|
|
35
|
+
enableAudio(): Promise<void>;
|
|
36
|
+
isAudioEnabled(): boolean;
|
|
37
|
+
dispose(): Promise<void>;
|
|
38
|
+
onPlaybackStarted(handler: () => void): void;
|
|
39
|
+
onPlaybackEnded(handler: () => void): void;
|
|
40
|
+
onPlaybackStopped(handler: () => void): void;
|
|
41
|
+
onError(handler: (error: Error) => void): void;
|
|
42
|
+
private handleWorkletMessage;
|
|
43
|
+
private createProcessorBlobUrl;
|
|
44
|
+
private getProcessorCode;
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export default class ActionNotifier {
|
|
3
|
+
private action;
|
|
4
|
+
private listener;
|
|
5
|
+
private config;
|
|
6
|
+
constructor(action: THREE.AnimationAction, config?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
});
|
|
9
|
+
on(event: 'finished' | 'beforeFinished', listener: (act: THREE.AnimationAction) => void): void;
|
|
10
|
+
update(delta: number): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type DictionaryType = {
|
|
2
|
+
[key: string]: number;
|
|
3
|
+
};
|
|
4
|
+
declare const shape2BlendShape: (params: {
|
|
5
|
+
dictionary: DictionaryType;
|
|
6
|
+
shapes: number[];
|
|
7
|
+
prefix: string;
|
|
8
|
+
suffix: string;
|
|
9
|
+
morphTargetInfluences: number[];
|
|
10
|
+
index: number;
|
|
11
|
+
}) => number[];
|
|
12
|
+
export default shape2BlendShape;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type DictionaryType = {
|
|
2
|
+
[key: string]: number;
|
|
3
|
+
};
|
|
4
|
+
declare const shape2BlendShape: (params: {
|
|
5
|
+
dictionary: DictionaryType;
|
|
6
|
+
shapes: number[];
|
|
7
|
+
prefix: string;
|
|
8
|
+
suffix: string;
|
|
9
|
+
morphTargetInfluences: number[];
|
|
10
|
+
index: number;
|
|
11
|
+
code: string;
|
|
12
|
+
}) => number[];
|
|
13
|
+
export default shape2BlendShape;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type DictionaryType = {
|
|
2
|
+
[key: string]: number;
|
|
3
|
+
};
|
|
4
|
+
declare const shape2BlendShape: (params: {
|
|
5
|
+
dictionary: DictionaryType;
|
|
6
|
+
shapes: number[];
|
|
7
|
+
prefix: string;
|
|
8
|
+
suffix: string;
|
|
9
|
+
morphTargetInfluences: number[];
|
|
10
|
+
index: number;
|
|
11
|
+
code: string;
|
|
12
|
+
}) => number[];
|
|
13
|
+
export default shape2BlendShape;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type DictionaryType = {
|
|
2
|
+
[key: string]: number;
|
|
3
|
+
};
|
|
4
|
+
declare const shape2BlendShape: (params: {
|
|
5
|
+
dictionary: DictionaryType;
|
|
6
|
+
shapes: number[];
|
|
7
|
+
prefix: string;
|
|
8
|
+
suffix: string;
|
|
9
|
+
index: number;
|
|
10
|
+
}) => number[];
|
|
11
|
+
export default shape2BlendShape;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IResultData } from "@/api/interface";
|
|
2
|
+
import type { QuanTe } from '@/types/index';
|
|
3
|
+
export type ChatMessageCallbackParams = {
|
|
4
|
+
isEnd: boolean;
|
|
5
|
+
type: 'message' | 'action';
|
|
6
|
+
};
|
|
7
|
+
export default class ChatMessageHandler {
|
|
8
|
+
private callback;
|
|
9
|
+
private pushCallback;
|
|
10
|
+
private buffer;
|
|
11
|
+
private readonly triggerCharacters;
|
|
12
|
+
private minLength;
|
|
13
|
+
private messages;
|
|
14
|
+
private startPushed;
|
|
15
|
+
constructor(callback: (msg: string, params: ChatMessageCallbackParams) => void, pushCallback: (msgs: IResultData<QuanTe.API.ChatMessage[]>) => void);
|
|
16
|
+
processMessage(chatMessage: QuanTe.API.ChatMessage): void;
|
|
17
|
+
includeIndex(chat: string): number;
|
|
18
|
+
pushMessage(buffer: string, params: ChatMessageCallbackParams): void;
|
|
19
|
+
checkAndDoAction(): boolean;
|
|
20
|
+
executePushCallback(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare class FileCache {
|
|
2
|
+
private dbName;
|
|
3
|
+
private storeName;
|
|
4
|
+
private db;
|
|
5
|
+
constructor();
|
|
6
|
+
init(): Promise<void>;
|
|
7
|
+
set(key: string, data: ArrayBuffer): Promise<void>;
|
|
8
|
+
get(key: string): Promise<Blob | null>;
|
|
9
|
+
}
|
|
10
|
+
declare const instance: FileCache;
|
|
11
|
+
export default instance;
|