@myned-ai/gsplat-flame-avatar-renderer 1.0.5 → 1.0.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/README.md +130 -32
- package/dist/gsplat-flame-avatar-renderer.cjs.js +3478 -722
- package/dist/gsplat-flame-avatar-renderer.cjs.min.js +2 -0
- package/dist/gsplat-flame-avatar-renderer.cjs.min.js.map +1 -0
- package/dist/gsplat-flame-avatar-renderer.esm.js +3439 -724
- package/dist/gsplat-flame-avatar-renderer.esm.min.js +2 -0
- package/dist/gsplat-flame-avatar-renderer.esm.min.js.map +1 -0
- package/package.json +10 -6
- package/src/core/SplatMesh.js +53 -46
- package/src/core/Viewer.js +47 -196
- package/src/errors/ApplicationError.js +185 -0
- package/src/errors/index.js +17 -0
- package/src/flame/FlameAnimator.js +282 -57
- package/src/loaders/PlyLoader.js +302 -44
- package/src/materials/SplatMaterial.js +13 -10
- package/src/materials/SplatMaterial3D.js +72 -27
- package/src/renderer/AnimationManager.js +8 -5
- package/src/renderer/GaussianSplatRenderer.js +668 -217
- package/src/utils/BlobUrlManager.js +294 -0
- package/src/utils/EventEmitter.js +349 -0
- package/src/utils/LoaderUtils.js +2 -1
- package/src/utils/Logger.js +171 -0
- package/src/utils/ObjectPool.js +248 -0
- package/src/utils/RenderLoop.js +306 -0
- package/src/utils/Util.js +59 -18
- package/src/utils/ValidationUtils.js +331 -0
- package/src/utils/index.js +10 -1
- package/dist/gsplat-flame-avatar-renderer.cjs.js.map +0 -1
- package/dist/gsplat-flame-avatar-renderer.esm.js.map +0 -1
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AnimationManager
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Derived from gaussian-splat-renderer-for-lam
|
|
5
5
|
* Manages animation state machine with Three.js AnimationMixer.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { LoopOnce, LoopRepeat } from 'three';
|
|
9
9
|
import { TYVoiceChatState } from './AppConstants.js';
|
|
10
|
+
import { getLogger } from '../utils/Logger.js';
|
|
11
|
+
|
|
12
|
+
const logger = getLogger('AnimationManager');
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* Base State class for animation states
|
|
@@ -256,7 +259,7 @@ class Think extends State {
|
|
|
256
259
|
class Speak extends State {
|
|
257
260
|
constructor(actions, isGroup) {
|
|
258
261
|
super(actions, isGroup);
|
|
259
|
-
|
|
262
|
+
logger.debug('[SPEAK] Initialized with', actions?.length || 0, 'actions, isGroup:', isGroup);
|
|
260
263
|
}
|
|
261
264
|
|
|
262
265
|
/**
|
|
@@ -271,7 +274,7 @@ class Speak extends State {
|
|
|
271
274
|
// Safety check: return early if no actions available
|
|
272
275
|
if (!this.actions || this.actions.length === 0) {
|
|
273
276
|
if (!this._warnedNoActions) {
|
|
274
|
-
|
|
277
|
+
logger.warn('[SPEAK] No actions available!');
|
|
275
278
|
this._warnedNoActions = true;
|
|
276
279
|
}
|
|
277
280
|
return;
|
|
@@ -283,7 +286,7 @@ class Speak extends State {
|
|
|
283
286
|
this.isPlaying === false) {
|
|
284
287
|
// Randomly select initial animation
|
|
285
288
|
this.stage = Math.ceil(this.getRandomNumber(0, this.actions.length - 1));
|
|
286
|
-
|
|
289
|
+
logger.debug('[SPEAK] Starting animation, stage:', this.stage, 'of', this.actions.length);
|
|
287
290
|
this.actions[this.stage].time = 0;
|
|
288
291
|
this.actions[this.stage].play();
|
|
289
292
|
AnimationManager.SetWeight(this.actions[this.stage], 1.0);
|
|
@@ -304,7 +307,7 @@ class Speak extends State {
|
|
|
304
307
|
const lastAction = this.actions[this.stage];
|
|
305
308
|
// Pick a different random animation
|
|
306
309
|
this.stage = (this.stage + Math.ceil(this.getRandomNumber(1, this.actions.length - 1))) % this.actions.length;
|
|
307
|
-
|
|
310
|
+
logger.debug('[SPEAK] Cycling to next animation, stage:', this.stage);
|
|
308
311
|
this.actions[this.stage].time = 0;
|
|
309
312
|
this.actions[this.stage].play();
|
|
310
313
|
AnimationManager.SetWeight(this.actions[this.stage], 1.0);
|