@aura3d/animation 1.4.0 → 1.4.1

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.
Files changed (46) hide show
  1. package/package.json +36 -3
  2. package/src/AnimationAction.ts +0 -166
  3. package/src/AnimationClip.ts +0 -63
  4. package/src/AnimationClipEvents.ts +0 -501
  5. package/src/AnimationClipRegistry.ts +0 -404
  6. package/src/AnimationController.ts +0 -1017
  7. package/src/AnimationEvents.ts +0 -34
  8. package/src/AnimationLayer.ts +0 -73
  9. package/src/AnimationMixer.ts +0 -402
  10. package/src/AnimationStateGraph.ts +0 -105
  11. package/src/AnimationStateMachine.ts +0 -265
  12. package/src/AnimationTrack.ts +0 -176
  13. package/src/BlendTree.ts +0 -89
  14. package/src/Bone.ts +0 -40
  15. package/src/CrowdAnimation.ts +0 -25
  16. package/src/ECSAnimationBridge.ts +0 -30
  17. package/src/FighterAnimationAdapter.ts +0 -124
  18. package/src/FootIk.ts +0 -251
  19. package/src/HumanoidBoneInference.ts +0 -323
  20. package/src/HumanoidRetargeting.ts +0 -700
  21. package/src/IK.ts +0 -117
  22. package/src/Inertialization.ts +0 -269
  23. package/src/Keyframe.ts +0 -159
  24. package/src/LocomotionController.ts +0 -155
  25. package/src/LocomotionKit.ts +0 -89
  26. package/src/MotionMatchingFixtures.ts +0 -254
  27. package/src/MotionQuality.ts +0 -182
  28. package/src/RigQuality.ts +0 -101
  29. package/src/RootMotion.ts +0 -124
  30. package/src/SceneAnimationBridge.ts +0 -80
  31. package/src/SecondaryAnimationFixtures.ts +0 -210
  32. package/src/Skeleton.ts +0 -78
  33. package/src/Skinning.ts +0 -18
  34. package/src/SpringBones.ts +0 -243
  35. package/src/browser-index.ts +0 -66
  36. package/src/index.ts +0 -66
  37. package/src/library/performanceStateGraph.ts +0 -173
  38. package/src/library/standardHumanoidClips.ts +0 -659
  39. package/src/threejs-compatibility/AnimationAction.ts +0 -27
  40. package/src/threejs-compatibility/AnimationClip.ts +0 -16
  41. package/src/threejs-compatibility/AnimationDiagnostics.ts +0 -42
  42. package/src/threejs-compatibility/AnimationMixer.ts +0 -24
  43. package/src/threejs-compatibility/MorphTargetMixer.ts +0 -16
  44. package/src/threejs-compatibility/Skeleton.ts +0 -9
  45. package/src/threejs-compatibility/SkinnedMesh.ts +0 -12
  46. package/src/threejs-compatibility/index.ts +0 -11
@@ -1,42 +0,0 @@
1
- import type { AnimationMixerThreeCompat } from "./AnimationMixer";
2
- import type { MorphTargetMixerThreeCompat } from "./MorphTargetMixer";
3
- import type { SkinnedMeshThreeCompat } from "./SkinnedMesh";
4
-
5
- export interface ThreeCompatAnimatedAssetDiagnostic {
6
- readonly id: string;
7
- readonly path: string;
8
- readonly loaded: boolean;
9
- readonly bytes: number;
10
- readonly capabilities: readonly string[];
11
- }
12
-
13
- export const THREE_COMPAT_ANIMATED_GLTF_ASSETS = [
14
- { id: "cesium-man", path: "fixtures/three-compat/assets/corpus/cesium-man.glb", capabilities: ["skinning", "animation"] },
15
- { id: "animated-colors-cube", path: "fixtures/three-compat/assets/corpus/animated-colors-cube.glb", capabilities: ["animation"] },
16
- { id: "animated-morph-cube", path: "fixtures/three-compat/assets/corpus/animated-morph-cube.glb", capabilities: ["morph-target", "animation"] },
17
- { id: "box-animated", path: "fixtures/three-compat/assets/corpus/box-animated.glb", capabilities: ["animation"] },
18
- { id: "fox", path: "tests/assets/corpus/khronos/Fox/Fox.glb", capabilities: ["skinning", "animation"] }
19
- ] as const;
20
-
21
- export function inspectThreeCompatAnimatedAssets(): readonly ThreeCompatAnimatedAssetDiagnostic[] {
22
- const browserRuntime = typeof globalThis.window !== "undefined" && typeof globalThis.document !== "undefined";
23
- return THREE_COMPAT_ANIMATED_GLTF_ASSETS.map((asset) => {
24
- const loaded = !browserRuntime;
25
- return { ...asset, loaded, bytes: loaded ? 1 : 0 };
26
- });
27
- }
28
-
29
- export function createThreeCompatAnimationDiagnostics(mixer: AnimationMixerThreeCompat, skinnedMesh: SkinnedMeshThreeCompat, morphs: MorphTargetMixerThreeCompat) {
30
- const assets = inspectThreeCompatAnimatedAssets();
31
- return {
32
- loadedAnimatedAssets: assets.filter((asset) => asset.loaded).length,
33
- assets,
34
- actionCount: mixer.actions.length,
35
- playingActionCount: mixer.actions.filter((action) => action.playing && !action.paused).length,
36
- skinnedBoneCount: skinnedMesh.skeleton.boneCount,
37
- morphTargetCount: morphs.getWeights().length,
38
- supportsCrossfade: mixer.actions.length >= 2,
39
- supportsScrub: mixer.actions.every((action) => action.time >= 0),
40
- warnings: assets.filter((asset) => !asset.loaded).map((asset) => `${asset.id} missing`)
41
- };
42
- }
@@ -1,24 +0,0 @@
1
- import { AnimationActionThreeCompat } from "./AnimationAction";
2
- import type { AnimationClipThreeCompat } from "./AnimationClip";
3
-
4
- export class AnimationMixerThreeCompat {
5
- readonly actions: AnimationActionThreeCompat[] = [];
6
- time = 0;
7
-
8
- clipAction(clip: AnimationClipThreeCompat): AnimationActionThreeCompat {
9
- const existing = this.actions.find((action) => action.clip === clip);
10
- if (existing) return existing;
11
- const action = new AnimationActionThreeCompat(clip);
12
- this.actions.push(action);
13
- return action;
14
- }
15
-
16
- update(deltaSeconds: number): void {
17
- this.time += deltaSeconds;
18
- for (const action of this.actions) {
19
- if (!action.playing || action.paused) continue;
20
- action.time += deltaSeconds;
21
- if (action.time > action.clip.duration) action.time = action.loop === "once" ? action.clip.duration : action.time % action.clip.duration;
22
- }
23
- }
24
- }
@@ -1,16 +0,0 @@
1
- export interface ThreeCompatMorphTargetWeight {
2
- readonly name: string;
3
- readonly weight: number;
4
- }
5
-
6
- export class MorphTargetMixerThreeCompat {
7
- private readonly weights = new Map<string, number>();
8
-
9
- setWeight(name: string, weight: number): void {
10
- this.weights.set(name, Math.max(0, Math.min(1, weight)));
11
- }
12
-
13
- getWeights(): readonly ThreeCompatMorphTargetWeight[] {
14
- return [...this.weights.entries()].map(([name, weight]) => ({ name, weight }));
15
- }
16
- }
@@ -1,9 +0,0 @@
1
- export interface ThreeCompatBone {
2
- readonly name: string;
3
- readonly parentIndex: number;
4
- }
5
-
6
- export class SkeletonThreeCompat {
7
- constructor(public readonly bones: readonly ThreeCompatBone[]) {}
8
- get boneCount(): number { return this.bones.length; }
9
- }
@@ -1,12 +0,0 @@
1
- import type { SkeletonThreeCompat } from "./Skeleton";
2
-
3
- export class SkinnedMeshThreeCompat {
4
- readonly type = "SkinnedMesh";
5
- bindMatrixVersion = 1;
6
-
7
- constructor(public readonly skeleton: SkeletonThreeCompat, public readonly geometry: unknown = null, public readonly material: unknown = null) {}
8
-
9
- pose(): void {
10
- this.bindMatrixVersion += 1;
11
- }
12
- }
@@ -1,11 +0,0 @@
1
- export { AnimationClipThreeCompat } from "./AnimationClip";
2
- export type { ThreeCompatKeyframeTrack, ThreeCompatLoopMode } from "./AnimationClip";
3
- export { AnimationActionThreeCompat } from "./AnimationAction";
4
- export { AnimationMixerThreeCompat } from "./AnimationMixer";
5
- export { SkeletonThreeCompat } from "./Skeleton";
6
- export type { ThreeCompatBone } from "./Skeleton";
7
- export { SkinnedMeshThreeCompat } from "./SkinnedMesh";
8
- export { MorphTargetMixerThreeCompat } from "./MorphTargetMixer";
9
- export type { ThreeCompatMorphTargetWeight } from "./MorphTargetMixer";
10
- export { createThreeCompatAnimationDiagnostics, inspectThreeCompatAnimatedAssets, THREE_COMPAT_ANIMATED_GLTF_ASSETS } from "./AnimationDiagnostics";
11
- export type { ThreeCompatAnimatedAssetDiagnostic } from "./AnimationDiagnostics";