@spatialwalk/avatarkit 1.0.0-beta.69 → 1.0.0-beta.70
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/CHANGELOG.md +6 -0
- package/dist/{StreamingAudioPlayer-DiIRp5nx.js → StreamingAudioPlayer-Bi2685bX.js} +1 -1
- package/dist/config/app-config.d.ts +3 -3
- package/dist/config/sdk-config-loader.d.ts +4 -13
- package/dist/core/Avatar.d.ts +0 -8
- package/dist/core/AvatarController.d.ts +0 -82
- package/dist/core/AvatarManager.d.ts +0 -8
- package/dist/core/AvatarSDK.d.ts +0 -13
- package/dist/core/AvatarView.d.ts +0 -141
- package/dist/{index-BT9yxWW8.js → index-CvW_c7G-.js} +273 -196
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/renderer/covariance.d.ts +3 -10
- package/dist/renderer/sortSplats.d.ts +3 -9
- package/dist/renderer/webgl/reorderData.d.ts +4 -10
- package/dist/types/character.d.ts +3 -3
- package/dist/types/index.d.ts +0 -8
- package/dist/utils/animation-interpolation.d.ts +4 -34
- package/dist/utils/client-id.d.ts +2 -2
- package/dist/utils/conversationId.d.ts +6 -15
- package/dist/utils/id-manager.d.ts +3 -33
- package/dist/utils/logger.d.ts +0 -6
- package/dist/utils/posthog-tracker.d.ts +6 -31
- package/dist/utils/pwa-cache-manager.d.ts +0 -35
- package/dist/utils/usage-tracker.d.ts +3 -17
- package/dist/wasm/avatarCoreAdapter.d.ts +4 -175
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 3D
|
|
3
|
-
*
|
|
2
|
+
* 3D Covariance Matrix Calculation Utility
|
|
3
|
+
* Used to calculate Gaussian Splat covariance matrix from scale and rotation parameters
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
* 计算 3D 协方差矩阵
|
|
7
|
-
*
|
|
8
|
-
* @param scale - 缩放向量 [sx, sy, sz]
|
|
9
|
-
* @param rotation - 四元数旋转 [qx, qy, qz, qw]
|
|
10
|
-
* @returns 3x3 协方差矩阵
|
|
11
|
-
*/
|
|
12
|
-
export declare function computeCovariance3D(scale: number[], rotation: number[]): number[][];
|
|
5
|
+
export {};
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Splat
|
|
3
|
-
*
|
|
2
|
+
* Splat depth sorting (Radix Sort optimized version)
|
|
3
|
+
* Uses 11-bit radix sort, O(n) time complexity
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
* 对 splats 进行深度排序(Radix Sort)
|
|
7
|
-
* @param packedData Packed 格式数据 [pos3, color4, cov6] x N
|
|
8
|
-
* @param cameraPosition 相机位置
|
|
9
|
-
* @param cameraForward 相机前向向量
|
|
10
|
-
*/
|
|
11
|
-
export declare function sortSplats(packedData: Float32Array, cameraPosition: [number, number, number], cameraForward: [number, number, number]): Uint32Array;
|
|
5
|
+
export {};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Packed Data
|
|
2
|
+
* Packed Data utility functions
|
|
3
3
|
*
|
|
4
|
-
* Packed
|
|
5
|
-
*
|
|
4
|
+
* Packed format: [pos3, color4, cov6] x N points
|
|
5
|
+
* Each point has 13 floats, 52 bytes total
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
* 重新排序 packed 数据(复用缓冲区)
|
|
9
|
-
* @param packedData 原始数据 [pos3, color4, cov6] x N
|
|
10
|
-
* @param sortOrder 排序索引数组
|
|
11
|
-
* @returns 重排序后的数据(复用的缓冲区引用)
|
|
12
|
-
*/
|
|
13
|
-
export declare function reorderPackedData(packedData: Float32Array, sortOrder: Uint32Array): Float32Array;
|
|
7
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CharacterAsset } from '../generated/driveningress/v2/driveningress';
|
|
2
2
|
import { CameraSettings, CharacterSettings } from './character-settings';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Character metadata
|
|
5
5
|
*/
|
|
6
6
|
export type CharacterMeta = CharacterAsset & {
|
|
7
7
|
characterSettings?: CharacterSettings;
|
|
@@ -13,7 +13,7 @@ export type PreloadCameraSettings = PreloadResources<{
|
|
|
13
13
|
camera: CameraSettings;
|
|
14
14
|
}>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Resource type enumeration
|
|
17
17
|
*/
|
|
18
18
|
export declare enum ResourceType {
|
|
19
19
|
CAMERA = "camera",
|
|
@@ -22,6 +22,6 @@ export declare enum ResourceType {
|
|
|
22
22
|
MODEL_GS = "gsStandard"
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Extract all resource URLs
|
|
26
26
|
*/
|
|
27
27
|
export declare function extractResourceUrls(meta: CharacterMeta): Record<ResourceType, string | null>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -80,14 +80,6 @@ export declare class AvatarError extends Error {
|
|
|
80
80
|
code?: (string | ErrorCode) | undefined;
|
|
81
81
|
constructor(message: string, code?: (string | ErrorCode) | undefined);
|
|
82
82
|
}
|
|
83
|
-
export interface FlatSplatData {
|
|
84
|
-
positions: Float32Array;
|
|
85
|
-
scales: Float32Array;
|
|
86
|
-
rotations: Float32Array;
|
|
87
|
-
colors: Float32Array;
|
|
88
|
-
opacities: Float32Array;
|
|
89
|
-
pointCount: number;
|
|
90
|
-
}
|
|
91
83
|
export interface CameraConfig {
|
|
92
84
|
position: [number, number, number];
|
|
93
85
|
target: [number, number, number];
|
|
@@ -1,36 +1,6 @@
|
|
|
1
|
-
import { Flame } from '../generated/driveningress/v1/driveningress';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param progress 进度 (0-1)
|
|
2
|
+
* Animation Interpolation Utilities (SDK)
|
|
3
|
+
* Layered interpolation with different timing for each facial component
|
|
4
|
+
* Aligned with app implementation and iOS behavior
|
|
7
5
|
*/
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* 使用线性插值生成过渡帧(旧实现,保留用于兼容)
|
|
11
|
-
* @param from 起始 Flame
|
|
12
|
-
* @param to 目标 Flame
|
|
13
|
-
* @param durationMs 总过渡时长 (e.g. 400ms)
|
|
14
|
-
* @param fps Frames per second (default 25)
|
|
15
|
-
*/
|
|
16
|
-
export declare function generateTransitionFramesLinear(from: Flame, to: Flame, durationMs: number, fps?: number): Flame[];
|
|
17
|
-
/**
|
|
18
|
-
* Bezier 曲线插值(使用不同部位的不同曲线和时间缩放)
|
|
19
|
-
* @param from 起始 Flame
|
|
20
|
-
* @param to 目标 Flame
|
|
21
|
-
* @param progress 全局进度 (0-1)
|
|
22
|
-
*/
|
|
23
|
-
export declare function bezierLerp(from: Flame, to: Flame, progress: number): Flame;
|
|
24
|
-
/**
|
|
25
|
-
* Generate transition keyframes between two Flame states with layered timing
|
|
26
|
-
* Different facial components transition at different speeds and timings
|
|
27
|
-
* @param from 起始 Flame
|
|
28
|
-
* @param to 目标 Flame
|
|
29
|
-
* @param durationMs 总过渡时长 (e.g. 400ms)
|
|
30
|
-
* @param fps Frames per second (default 25)
|
|
31
|
-
*/
|
|
32
|
-
export declare function generateTransitionFrames(from: Flame, to: Flame, durationMs: number, fps?: number): Flame[];
|
|
33
|
-
/**
|
|
34
|
-
* Create a neutral Flame
|
|
35
|
-
*/
|
|
36
|
-
export declare function createNeutralFlame(): Flame;
|
|
6
|
+
export {};
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Conversation ID
|
|
2
|
+
* Conversation ID generation utility
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Unified format: timestamp (UTC time, second-level, format: YYYYMMDDHHmmss) + underscore + 12-digit NanoID
|
|
5
|
+
* Example: 20251027143034_aB3dEf9hIjKl
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Time part uses UTC time for easier cross-platform log troubleshooting with unified timezone conversion
|
|
8
|
+
* @internal
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
-
* 生成统一的会话 ID
|
|
11
|
-
*
|
|
12
|
-
* 格式:时间戳(UTC时间,秒级,格式:YYYYMMDDHHmmss)+ 下划线 + 12位 NanoID
|
|
13
|
-
* 时间部分使用 UTC 时间,便于跨端日志排查时统一转换时区检索
|
|
14
|
-
*
|
|
15
|
-
* @returns 格式为 YYYYMMDDHHmmss_nanoid 的会话 ID
|
|
16
|
-
* @example
|
|
17
|
-
* generateConversationId() // "20251027143034_aB3dEf9hIjKl"
|
|
18
|
-
*/
|
|
19
|
-
export declare function generateConversationId(): string;
|
|
10
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ID
|
|
3
|
-
*
|
|
2
|
+
* ID Manager
|
|
3
|
+
* Unified management of all types of IDs in SDK
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* ID
|
|
7
|
+
* ID type definitions
|
|
8
8
|
*/
|
|
9
9
|
export interface SdkIds {
|
|
10
10
|
clientId: string;
|
|
@@ -24,41 +24,11 @@ declare class IdManager {
|
|
|
24
24
|
getAppId(): string | null;
|
|
25
25
|
setSessionToken(token: string | null): void;
|
|
26
26
|
getSessionToken(): string | null;
|
|
27
|
-
/**
|
|
28
|
-
* 生成新的 connectionId(用于 WebSocket 连接)
|
|
29
|
-
*/
|
|
30
|
-
generateConnectionId(): string;
|
|
31
|
-
/**
|
|
32
|
-
* 设置 connectionId(用于从服务器接收到的 connectionId)
|
|
33
|
-
*/
|
|
34
|
-
setConnectionId(connectionId: string | null): void;
|
|
35
27
|
getConnectionId(): string | null;
|
|
36
28
|
clearConnectionId(): void;
|
|
37
|
-
/**
|
|
38
|
-
* 生成新的 conversationId(用于每次对话)
|
|
39
|
-
*/
|
|
40
|
-
generateNewConversationId(): string;
|
|
41
29
|
getConversationId(): string | null;
|
|
42
30
|
setConversationId(conversationId: string | null): void;
|
|
43
31
|
clearConversationId(): void;
|
|
44
|
-
/**
|
|
45
|
-
* 获取所有 ID(用于日志上报)
|
|
46
|
-
*/
|
|
47
|
-
getAllIds(): Readonly<SdkIds>;
|
|
48
|
-
/**
|
|
49
|
-
* 获取公共日志参数(包含所有必要的 ID)
|
|
50
|
-
*/
|
|
51
|
-
getLogContext(): {
|
|
52
|
-
client_id: string;
|
|
53
|
-
user_id: string;
|
|
54
|
-
app_id: string;
|
|
55
|
-
connection_id?: string;
|
|
56
|
-
conversation_id?: string;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* 清理所有 ID(用于测试或重置)
|
|
60
|
-
*/
|
|
61
|
-
clear(): void;
|
|
62
32
|
}
|
|
63
33
|
export declare const idManager: IdManager;
|
|
64
34
|
export {};
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { LogLevel as GuiiaiLogLevel } from '@guiiai/logg';
|
|
2
|
-
import { LogLevel } from '../types';
|
|
3
2
|
export declare const logger: import('@guiiai/logg').Logg;
|
|
4
|
-
/**
|
|
5
|
-
* 设置 SDK 日志等级
|
|
6
|
-
* @param level SDK 的 LogLevel 枚举值
|
|
7
|
-
*/
|
|
8
|
-
export declare function setLogLevel(level: LogLevel): void;
|
|
9
3
|
export declare const loggerWithUnknown: {
|
|
10
4
|
error: (message: string, error?: unknown) => void;
|
|
11
5
|
warn: (message: string, error?: unknown) => void;
|
|
@@ -1,33 +1,8 @@
|
|
|
1
|
-
import { Environment } from '../types';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* PostHog Telemetry Tool (Browser Version)
|
|
3
|
+
*
|
|
4
|
+
* Unified PostHog telemetry reporting, supports custom reporting
|
|
5
|
+
* Uses PostHog JS SDK for event tracking, suitable for browser environments
|
|
6
|
+
* @internal
|
|
4
7
|
*/
|
|
5
|
-
export
|
|
6
|
-
/**
|
|
7
|
-
* 上报事件到 PostHog
|
|
8
|
-
* @param event 事件名称
|
|
9
|
-
* @param level 日志级别
|
|
10
|
-
* @param contents 事件内容
|
|
11
|
-
*/
|
|
12
|
-
export declare function trackEvent(event: string, level?: 'debug' | 'info' | 'warning' | 'error', contents?: Record<string, unknown>): void;
|
|
13
|
-
/**
|
|
14
|
-
* 使用 sendBeacon 同步发送关键事件(用于页面关闭时)
|
|
15
|
-
* PostHog 本身支持在页面关闭时自动发送,但我们可以手动触发
|
|
16
|
-
* @param event 事件名称
|
|
17
|
-
* @param level 日志级别
|
|
18
|
-
* @param contents 事件内容
|
|
19
|
-
* @returns 是否发送成功
|
|
20
|
-
*/
|
|
21
|
-
export declare function sendEventViaBeacon(event: string, level?: 'debug' | 'info' | 'warning' | 'error', contents?: Record<string, unknown>): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* 清理 PostHog(刷新剩余事件)
|
|
24
|
-
*/
|
|
25
|
-
export declare function cleanupPostHog(): void;
|
|
26
|
-
/**
|
|
27
|
-
* 统一的 Telemetry 日志接口
|
|
28
|
-
* 用于 SDK 内部上报日志到 PostHog
|
|
29
|
-
* @param event 事件名称
|
|
30
|
-
* @param level 日志级别
|
|
31
|
-
* @param contents 日志内容
|
|
32
|
-
*/
|
|
33
|
-
export declare function logEvent(event: string, level?: 'debug' | 'info' | 'warning' | 'error', contents?: Record<string, unknown>): void;
|
|
8
|
+
export {};
|
|
@@ -14,39 +14,4 @@ export declare class PwaCacheManager {
|
|
|
14
14
|
private static readonly CHARACTER_CACHE_PREFIX;
|
|
15
15
|
private static readonly CHARACTER_CACHE_SUFFIX;
|
|
16
16
|
private static readonly MAX_CHARACTER_CACHE_ENTRIES;
|
|
17
|
-
/**
|
|
18
|
-
* 检查是否支持 Cache API
|
|
19
|
-
*/
|
|
20
|
-
static isSupported(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* 获取角色缓存名称
|
|
23
|
-
*/
|
|
24
|
-
private static getCharacterCacheName;
|
|
25
|
-
/**
|
|
26
|
-
* 从角色缓存获取资源
|
|
27
|
-
*/
|
|
28
|
-
static getCharacterResource(characterId: string, url: string): Promise<ArrayBuffer | null>;
|
|
29
|
-
/**
|
|
30
|
-
* 将角色资源写入缓存
|
|
31
|
-
*/
|
|
32
|
-
static putCharacterResource(characterId: string, url: string, data: ArrayBuffer): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* 从模板缓存获取资源
|
|
35
|
-
*/
|
|
36
|
-
static getTemplateResource(url: string): Promise<ArrayBuffer | null>;
|
|
37
|
-
/**
|
|
38
|
-
* 将模板资源写入缓存
|
|
39
|
-
* 模板资源不设置数量限制,永久保留直到版本更新
|
|
40
|
-
*/
|
|
41
|
-
static putTemplateResource(url: string, data: ArrayBuffer): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* 清理角色缓存
|
|
44
|
-
*/
|
|
45
|
-
static clearCharacterCache(characterId: string): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* 检查模板缓存版本,如果版本变化则清理
|
|
48
|
-
* 使用独立的模板资源版本号(不依赖 SDK 版本),这样不同 SDK 版本可以共享相同模板资源的缓存
|
|
49
|
-
* @returns true 如果版本变化并清理了缓存,false 否则
|
|
50
|
-
*/
|
|
51
|
-
static checkTemplateCacheVersion(): Promise<boolean>;
|
|
52
17
|
}
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Usage tracking utility
|
|
3
|
+
* Used to determine first use, daily active status, etc.
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
* 检查是否为首次使用
|
|
8
|
-
* @returns true 如果是首次使用,false 如果不是
|
|
9
|
-
*/
|
|
10
|
-
export declare function isFirstUse(): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 检查今天是否已经活跃过
|
|
13
|
-
* @returns true 如果今天首次活跃,false 如果今天已经活跃过
|
|
14
|
-
*/
|
|
15
|
-
export declare function isDailyActive(): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* 获取最后活跃日期
|
|
18
|
-
* @returns 最后活跃日期(YYYY-MM-DD),如果不存在则返回 null
|
|
19
|
-
*/
|
|
20
|
-
export declare function getLastActiveDate(): string | null;
|
|
6
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Avatar Core WASM
|
|
2
|
+
* Avatar Core WASM Adapter
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Completely replaces FlameComplete3DGSManager, provides full functionality of avatar_core_wasm
|
|
5
|
+
* Includes advanced features such as teeth subdivision, eye tracking, etc.
|
|
6
|
+
* @internal
|
|
6
7
|
*/
|
|
7
8
|
export interface WasmModuleConfig {
|
|
8
9
|
baseUrl?: string;
|
|
@@ -18,13 +19,6 @@ export interface AvatarCoreOptions {
|
|
|
18
19
|
wasmConfig?: WasmModuleConfig;
|
|
19
20
|
wasmPath?: string;
|
|
20
21
|
}
|
|
21
|
-
interface PerformanceMetrics {
|
|
22
|
-
initTime: number;
|
|
23
|
-
loadTime: number;
|
|
24
|
-
computeFrames: number;
|
|
25
|
-
totalComputeTime: number;
|
|
26
|
-
averageComputeTime: number;
|
|
27
|
-
}
|
|
28
22
|
export interface FlameInfo {
|
|
29
23
|
vertexCount: number;
|
|
30
24
|
faceCount: number;
|
|
@@ -65,60 +59,6 @@ export declare class AvatarCoreAdapter {
|
|
|
65
59
|
private flameInfo?;
|
|
66
60
|
private characterInfo?;
|
|
67
61
|
constructor(options?: AvatarCoreOptions);
|
|
68
|
-
/**
|
|
69
|
-
* 加载 WASM 模块并设置 API
|
|
70
|
-
* 每次都创建全新的 WASM 实例,确保 C++ 内存是干净的
|
|
71
|
-
*
|
|
72
|
-
* 注意:这里使用动态 import() 导入 WASM 模块。
|
|
73
|
-
* Vite 在构建时会自动为 WASM 文件和 JS glue 代码添加 hash(如 avatar_core_wasm-CxWuw7eS.wasm),
|
|
74
|
-
* 确保浏览器缓存与版本一致,不会有缓存问题。
|
|
75
|
-
*
|
|
76
|
-
* Hash 的作用机制:
|
|
77
|
-
* - WASM 文件内容变化 → hash 自动变化 → URL 变化 → 浏览器拉取新版本
|
|
78
|
-
* - WASM 文件内容不变 → hash 保持不变 → URL 不变 → 浏览器使用缓存
|
|
79
|
-
* - Emscripten 生成的 JS 内部会使用 hard-coded 的 hash 路径加载 .wasm 文件
|
|
80
|
-
*/
|
|
81
|
-
loadWASMModule(): Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* 验证 WASM 模块功能
|
|
84
|
-
*/
|
|
85
|
-
private validateWASMModule;
|
|
86
|
-
/**
|
|
87
|
-
* 初始化内存视图
|
|
88
|
-
*/
|
|
89
|
-
private initializeMemoryViews;
|
|
90
|
-
/**
|
|
91
|
-
* 设置 C API 函数包装
|
|
92
|
-
*/
|
|
93
|
-
private setupCAPIFunctions;
|
|
94
|
-
/**
|
|
95
|
-
* 读取当前动画帧的 FlameParams(用于过渡或调试)
|
|
96
|
-
*/
|
|
97
|
-
/**
|
|
98
|
-
* Get current frame parameters
|
|
99
|
-
* @param frameIndex Frame index
|
|
100
|
-
* @param characterId Optional character ID for multi-character support
|
|
101
|
-
*/
|
|
102
|
-
getCurrentFrameParams(frameIndex?: number, characterId?: string): Promise<FlameParams>;
|
|
103
|
-
/**
|
|
104
|
-
* 初始化 Avatar Core 核心
|
|
105
|
-
*/
|
|
106
|
-
private initializeAvatarCore;
|
|
107
|
-
/**
|
|
108
|
-
* 加载模板资源(从预加载的 ArrayBuffers)
|
|
109
|
-
*/
|
|
110
|
-
loadTemplateResourcesFromBuffers(templateResources: Record<string, ArrayBuffer>): Promise<boolean>;
|
|
111
|
-
/**
|
|
112
|
-
* 加载角色数据(从预加载的 ArrayBuffers)
|
|
113
|
-
*/
|
|
114
|
-
/**
|
|
115
|
-
* Load character from buffers and return handle
|
|
116
|
-
* @param shapeBuffer Shape data buffer
|
|
117
|
-
* @param pointCloudBuffer Point cloud data buffer
|
|
118
|
-
* @param characterId Optional character ID for multi-character support
|
|
119
|
-
* @returns Character handle
|
|
120
|
-
*/
|
|
121
|
-
loadCharacterFromBuffers(shapeBuffer: ArrayBuffer, pointCloudBuffer: ArrayBuffer, characterId?: string): Promise<number>;
|
|
122
62
|
private loadAnimationFromData;
|
|
123
63
|
/**
|
|
124
64
|
* Load animation from ArrayBuffer (for CDN-based dynamic loading)
|
|
@@ -128,121 +68,10 @@ export declare class AvatarCoreAdapter {
|
|
|
128
68
|
*/
|
|
129
69
|
loadAnimationFromBuffer(animData: ArrayBuffer, characterId?: string): Promise<number>;
|
|
130
70
|
switchAnimationFile(animationFile: string): Promise<number>;
|
|
131
|
-
/**
|
|
132
|
-
* 获取动画总帧数
|
|
133
|
-
* @param animationHandle Optional animation handle (for multi-character support)
|
|
134
|
-
*/
|
|
135
|
-
getAnimationTotalFrames(animationHandle?: number): Promise<number>;
|
|
136
|
-
/**
|
|
137
|
-
* 从动画中获取指定帧的参数
|
|
138
|
-
* @param frameIndex Frame index
|
|
139
|
-
* @param characterId Optional character ID for multi-character support
|
|
140
|
-
*/
|
|
141
|
-
getAnimationFrameParams(frameIndex?: number, characterId?: string): Promise<number>;
|
|
142
|
-
/**
|
|
143
|
-
* 设置眼部追踪配置(对齐 app 实现)
|
|
144
|
-
* @param config Eye tracking configuration
|
|
145
|
-
* @param characterId Optional character ID for multi-character support
|
|
146
|
-
*/
|
|
147
|
-
setEyeTrackingConfig(config: {
|
|
148
|
-
enabled: boolean;
|
|
149
|
-
auto_eyelid_adjustment?: boolean;
|
|
150
|
-
eyelid_threshold?: number;
|
|
151
|
-
}, characterId?: string): Promise<boolean>;
|
|
152
|
-
/**
|
|
153
|
-
* 设置眼部追踪目标(高级功能)
|
|
154
|
-
* @param x Target X coordinate
|
|
155
|
-
* @param y Target Y coordinate
|
|
156
|
-
* @param z Target Z coordinate
|
|
157
|
-
* @param characterId Optional character ID for multi-character support
|
|
158
|
-
*/
|
|
159
|
-
setGazeTarget(x: number, y: number, z: number, characterId?: string): Promise<boolean>;
|
|
160
|
-
/**
|
|
161
|
-
* 重置眼部追踪
|
|
162
|
-
*/
|
|
163
|
-
resetEyeTracking(): Promise<boolean>;
|
|
164
|
-
/**
|
|
165
|
-
* 查询 FLAME 模型信息
|
|
166
|
-
*/
|
|
167
|
-
private queryFlameInfo;
|
|
168
|
-
/**
|
|
169
|
-
* 查询角色信息
|
|
170
|
-
*/
|
|
171
|
-
private queryCharacterInfo;
|
|
172
|
-
/**
|
|
173
|
-
* 检查错误码并抛出异常
|
|
174
|
-
*/
|
|
175
|
-
private checkError;
|
|
176
|
-
/**
|
|
177
|
-
* 更新进度回调
|
|
178
|
-
*/
|
|
179
|
-
private updateProgress;
|
|
180
|
-
/**
|
|
181
|
-
* 获取性能指标
|
|
182
|
-
*/
|
|
183
|
-
getPerformanceMetrics(): PerformanceMetrics & {
|
|
184
|
-
flameInfo?: FlameInfo;
|
|
185
|
-
characterInfo?: CharacterInfo;
|
|
186
|
-
version?: string;
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* 获取角色的点云数量
|
|
190
|
-
* @param characterHandle 角色 handle(可选,默认使用当前角色)
|
|
191
|
-
* @returns 点云数量,如果角色未加载则返回 null
|
|
192
|
-
*/
|
|
193
|
-
getPointCount(characterHandle?: number): number | null;
|
|
194
|
-
/**
|
|
195
|
-
* 释放当前角色和动画资源(但保留 core)
|
|
196
|
-
*/
|
|
197
|
-
/**
|
|
198
|
-
* Remove a specific character by handle
|
|
199
|
-
* @param characterHandle Character handle to remove
|
|
200
|
-
* @param characterId Optional character ID for cleanup
|
|
201
|
-
*/
|
|
202
|
-
removeCharacter(characterHandle: number, characterId?: string): void;
|
|
203
71
|
/**
|
|
204
72
|
* Release current character (legacy method, kept for backward compatibility)
|
|
205
73
|
* @deprecated Use removeCharacter() instead for multi-character support
|
|
206
74
|
*/
|
|
207
75
|
releaseCurrentCharacter(): void;
|
|
208
|
-
/**
|
|
209
|
-
* 释放所有资源(包括 core)
|
|
210
|
-
*/
|
|
211
|
-
release(): void;
|
|
212
|
-
/**
|
|
213
|
-
* 兼容性接口:提供与 FlameComplete3DGSManager 相同的接口
|
|
214
|
-
*/
|
|
215
|
-
loadFlameModel(_modelData: any): Promise<boolean>;
|
|
216
76
|
load3DGSData(_original3DGSPoints: any, _binding: any, _flameFaces: any): Promise<boolean>;
|
|
217
|
-
/**
|
|
218
|
-
* 计算帧并返回 GPU 友好的 flat 格式(零拷贝,协方差预计算)
|
|
219
|
-
* 🚀 性能优化版本:
|
|
220
|
-
* - C++ 预计算协方差矩阵
|
|
221
|
-
* - 零拷贝直接访问 WASM 内存http://localhost:3000/us/
|
|
222
|
-
* - 直接输出 GPU 格式 [pos3, color4, cov6]
|
|
223
|
-
*/
|
|
224
|
-
/**
|
|
225
|
-
* Compute complete frame from animation
|
|
226
|
-
* @param params Frame parameters
|
|
227
|
-
* @param characterHandle Optional character handle (for multi-character support)
|
|
228
|
-
*/
|
|
229
|
-
computeCompleteFrameFlat(params?: {
|
|
230
|
-
frameIndex?: number;
|
|
231
|
-
}, characterHandle?: number): Promise<Float32Array | null>;
|
|
232
|
-
/**
|
|
233
|
-
* 计算帧并返回 GPU 友好的 flat 格式(从 FLAME 参数)
|
|
234
|
-
* 🔑 用于 Realtime: 接受自定义 FLAME 参数并计算 Splat
|
|
235
|
-
*/
|
|
236
|
-
/**
|
|
237
|
-
* Compute frame from Flame parameters
|
|
238
|
-
* @param flameParams Flame parameters
|
|
239
|
-
* @param characterHandle Optional character handle (for multi-character support)
|
|
240
|
-
*/
|
|
241
|
-
computeFrameFlatFromParams(flameParams: FlameParams, characterHandle?: number): Promise<Float32Array | null>;
|
|
242
|
-
/**
|
|
243
|
-
* 获取 WASM 内存使用情况(MB)
|
|
244
|
-
* @returns WASM 内存使用量(MB),如果模块未加载则返回 null
|
|
245
|
-
*/
|
|
246
|
-
getWASMMemoryMB(): number | null;
|
|
247
77
|
}
|
|
248
|
-
export {};
|
package/package.json
CHANGED