Skip to content

Commit

Permalink
feat(model): reduce overhead of animation mixer updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fallenoak committed Feb 12, 2024
1 parent ca0a022 commit 33730d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/model/ModelAnimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ModelAnimation extends THREE.Object3D {
resume() {
for (const action of this.#suspendedActions) {
action.enabled = true;
(action.getMixer() as any)._activateAction(action);

this.#suspendedActions.delete(action);
this.#playingActions.add(action);
Expand All @@ -65,6 +66,7 @@ class ModelAnimation extends THREE.Object3D {
suspend() {
for (const action of this.#playingActions) {
action.enabled = false;
(action.getMixer() as any)._deactivateAction(action);

this.#playingActions.delete(action);
this.#suspendedActions.add(action);
Expand Down

0 comments on commit 33730d1

Please sign in to comment.