@aura3d/animation 1.4.5 → 1.5.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.
@@ -0,0 +1,12 @@
1
+ import { Matrix4 } from "@aura3d/math";
2
+ export interface RetargetBoneMap {
3
+ readonly source: string;
4
+ readonly target: string;
5
+ readonly scale?: number;
6
+ }
7
+ export interface RetargetPoseInput {
8
+ readonly sourcePose: ReadonlyMap<string, Matrix4>;
9
+ readonly boneMap: readonly RetargetBoneMap[];
10
+ }
11
+ export declare function retargetPose(input: RetargetPoseInput): Map<string, Matrix4>;
12
+ //# sourceMappingURL=Retargeting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Retargeting.d.ts","sourceRoot":"","sources":["../../../../packages/animation/src/Retargeting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;CAC9C;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAe3E"}
@@ -0,0 +1,19 @@
1
+ import { Matrix4 } from "@aura3d/math";
2
+ export function retargetPose(input) {
3
+ const output = new Map();
4
+ for (const mapping of input.boneMap) {
5
+ const source = input.sourcePose.get(mapping.source);
6
+ if (!source)
7
+ continue;
8
+ const elements = [...source.elements];
9
+ const scale = mapping.scale ?? 1;
10
+ if (scale !== 1) {
11
+ elements[12] *= scale;
12
+ elements[13] *= scale;
13
+ elements[14] *= scale;
14
+ }
15
+ output.set(mapping.target, new Matrix4(elements));
16
+ }
17
+ return output;
18
+ }
19
+ //# sourceMappingURL=Retargeting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Retargeting.js","sourceRoot":"","sources":["../../../../packages/animation/src/Retargeting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAavC,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC1C,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,MAAM,QAAQ,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;QACjC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,QAAQ,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;YACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;YACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;QACxB,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,OAAO,CAAC,QAA0C,CAAC,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aura3d/animation",
3
- "version": "1.4.5",
3
+ "version": "1.5.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@aura3d/math": "1.4.5"
15
+ "@aura3d/math": "1.5.1"
16
16
  },
17
17
  "description": "Deterministic animation clips, mixers, root motion, skeleton palettes, blend trees, state machines, and scene/ECS animation bridges for Aura3D.",
18
18
  "keywords": [