@spatialwalk/avatarkit 1.0.0-beta.82 → 1.0.0-beta.84
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 +17 -0
- package/README.md +54 -71
- package/dist/{StreamingAudioPlayer-Pe6o4lP8.js → StreamingAudioPlayer-CCQgsR1j.js} +1 -1
- package/dist/avatar_core_wasm-e68766db.wasm +0 -0
- package/dist/core/AvatarController.d.ts +2 -2
- package/dist/core/AvatarView.d.ts +3 -5
- package/dist/{index-DvCy6yVA.js → index-BNATNpKA.js} +366 -572
- package/dist/index.js +1 -1
- package/dist/marble-test/src/billboard.d.ts +22 -0
- package/dist/marble-test/src/main.d.ts +6 -0
- package/dist/marble-test/src/spzLoader.d.ts +18 -0
- package/dist/marble-test/vite.config.d.ts +2 -0
- package/dist/tools/capture-messages/capture.d.ts +15 -0
- package/dist/tools/capture-messages/verify.d.ts +5 -0
- package/dist/tools/replay-web/vite.config.d.ts +2 -0
- package/package.json +17 -20
package/dist/index.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Billboard transform for avatar splats.
|
|
3
|
+
* Uses CYLINDRICAL billboard (Y-axis only rotation) so the avatar
|
|
4
|
+
* stays upright regardless of camera pitch, only rotating left/right.
|
|
5
|
+
*
|
|
6
|
+
* Packed format per splat: 13 floats = [pos3, color4, cov6]
|
|
7
|
+
* Covariance layout: [xx, xy, xz, yy, yz, zz]
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Apply billboard transform to avatar splat data.
|
|
11
|
+
*
|
|
12
|
+
* - Rotates each splat position by R, then translates to avatarWorldPos
|
|
13
|
+
* - Rotates covariance: C' = R * C * R^T
|
|
14
|
+
* - Color (4 floats) is copied unchanged
|
|
15
|
+
*
|
|
16
|
+
* @param avatarSplats Source packed Float32Array from SDK (13 floats/splat)
|
|
17
|
+
* @param avatarWorldPos Where to place the avatar in the scene
|
|
18
|
+
* @param cameraPos Current camera position (avatar faces this)
|
|
19
|
+
* @param scale Optional uniform scale for the avatar (default 1.0)
|
|
20
|
+
* @returns New Float32Array with transformed splats
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyBillboardTransform(avatarSplats: Float32Array, avatarWorldPos: [number, number, number], cameraPos: [number, number, number], scale?: number): Float32Array;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPZ (Splat Zip) decoder → packed format [pos3, color4, cov6] × N
|
|
3
|
+
*
|
|
4
|
+
* SPZ format (Niantic Labs):
|
|
5
|
+
* - gzip-compressed stream
|
|
6
|
+
* - 16-byte header + column-based attribute data
|
|
7
|
+
*
|
|
8
|
+
* Reference: https://github.com/nianticlabs/spz
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Load and decode an SPZ file into packed format [pos3, color4, cov6] × N
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadSpz(buffer: ArrayBuffer, onProgress?: (msg: string) => void): Promise<{
|
|
14
|
+
packedData: Float32Array;
|
|
15
|
+
pointCount: number;
|
|
16
|
+
center: [number, number, number];
|
|
17
|
+
extent: number;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebSocket Animation Message Capture Tool
|
|
3
|
+
*
|
|
4
|
+
* Connects to the driving service, sends a pre-recorded audio file,
|
|
5
|
+
* and captures all SERVER_RESPONSE_ANIMATION messages as raw binary files.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* npx tsx capture.ts \
|
|
9
|
+
* --avatar-id "CHARACTER_ID" \
|
|
10
|
+
* --api-key "sk-xxx" \
|
|
11
|
+
* --env intl \
|
|
12
|
+
* --audio ./test-audio/hello.pcm \
|
|
13
|
+
* --output ./captured_data/session_001
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spatialwalk/avatarkit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.84",
|
|
5
|
+
"packageManager": "pnpm@10.18.2",
|
|
5
6
|
"description": "AvatarKit SDK - 3D Gaussian Splatting Avatar Rendering SDK",
|
|
6
7
|
"author": "AvatarKit Team",
|
|
7
8
|
"license": "MIT",
|
|
@@ -43,18 +44,26 @@
|
|
|
43
44
|
"next.js",
|
|
44
45
|
"next.d.ts"
|
|
45
46
|
],
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "SDK_BUILD=true vite build --mode library && npm run build:vite-plugin && npm run build:next-plugin",
|
|
49
|
+
"build:vite-plugin": "tsc vite.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
|
|
50
|
+
"build:next-plugin": "tsc next.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
|
|
51
|
+
"dev": "vite build --mode library --watch",
|
|
52
|
+
"clean": "rm -rf dist",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"test": "cd tests && pnpm test",
|
|
55
|
+
"test:watch": "cd tests && pnpm run test:watch",
|
|
56
|
+
"test:e2e": "cd tests && pnpm run test:e2e",
|
|
57
|
+
"test:perf": "cd tests && pnpm run test:perf"
|
|
58
|
+
},
|
|
46
59
|
"peerDependencies": {
|
|
47
60
|
"@webgpu/types": "*",
|
|
48
61
|
"vite": "^5.0.0",
|
|
49
62
|
"next": ">=13.0.0"
|
|
50
63
|
},
|
|
51
64
|
"peerDependenciesMeta": {
|
|
52
|
-
"vite": {
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
"next": {
|
|
56
|
-
"optional": true
|
|
57
|
-
}
|
|
65
|
+
"vite": { "optional": true },
|
|
66
|
+
"next": { "optional": true }
|
|
58
67
|
},
|
|
59
68
|
"dependencies": {
|
|
60
69
|
"@bufbuild/protobuf": "^2.10.0",
|
|
@@ -69,17 +78,5 @@
|
|
|
69
78
|
"typescript": "^5.0.0",
|
|
70
79
|
"vite": "^5.0.0",
|
|
71
80
|
"vite-plugin-dts": "^4.5.4"
|
|
72
|
-
},
|
|
73
|
-
"scripts": {
|
|
74
|
-
"build": "SDK_BUILD=true vite build --mode library && npm run build:vite-plugin && npm run build:next-plugin",
|
|
75
|
-
"build:vite-plugin": "tsc vite.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
|
|
76
|
-
"build:next-plugin": "tsc next.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
|
|
77
|
-
"dev": "vite build --mode library --watch",
|
|
78
|
-
"clean": "rm -rf dist",
|
|
79
|
-
"typecheck": "tsc --noEmit",
|
|
80
|
-
"test": "cd tests && pnpm test",
|
|
81
|
-
"test:watch": "cd tests && pnpm run test:watch",
|
|
82
|
-
"test:e2e": "cd tests && pnpm run test:e2e",
|
|
83
|
-
"test:perf": "cd tests && pnpm run test:perf"
|
|
84
81
|
}
|
|
85
|
-
}
|
|
82
|
+
}
|