@margoengine/rigging 0.0.0-stage → 1.0.0

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 (84) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +4 -0
  3. package/README.md +1443 -2
  4. package/dist/anatomy-data-ansur2.d.ts +63 -0
  5. package/dist/anatomy-data-cdc.d.ts +16 -0
  6. package/dist/anatomy-data-deleva.d.ts +86 -0
  7. package/dist/anatomy-human.d.ts +67 -0
  8. package/dist/anatomy-human.js +2229 -0
  9. package/dist/anatomy.d.ts +638 -0
  10. package/dist/anatomy.js +1112 -0
  11. package/dist/autorig.d.ts +50 -0
  12. package/dist/autorig.js +663 -0
  13. package/dist/bar-grip.d.ts +7 -0
  14. package/dist/body-volumes-DTym0RVY.js +56 -0
  15. package/dist/body-volumes.d.ts +19 -0
  16. package/dist/checks.d.ts +50 -0
  17. package/dist/contact.d.ts +186 -0
  18. package/dist/contact.js +746 -0
  19. package/dist/correctives.d.ts +92 -0
  20. package/dist/correctives.js +162 -0
  21. package/dist/coupling.d.ts +57 -0
  22. package/dist/coupling.js +330 -0
  23. package/dist/errors-D8rc8kzg.js +7 -0
  24. package/dist/face.d.ts +93 -0
  25. package/dist/face.js +144 -0
  26. package/dist/hands.d.ts +209 -0
  27. package/dist/hands.js +510 -0
  28. package/dist/heat.d.ts +38 -0
  29. package/dist/hinged-contact.d.ts +7 -0
  30. package/dist/hulls.d.ts +54 -0
  31. package/dist/hulls.js +134 -0
  32. package/dist/ik.d.ts +162 -0
  33. package/dist/ik.js +561 -0
  34. package/dist/index.d.ts +6 -0
  35. package/dist/index.js +390 -0
  36. package/dist/joint-limits.d.ts +44 -0
  37. package/dist/joint-limits.js +74 -0
  38. package/dist/limb-collision.d.ts +99 -0
  39. package/dist/loading-CZaYr1N7.js +67 -0
  40. package/dist/mesh-CyvLHNp0.js +142 -0
  41. package/dist/mesh.d.ts +47 -0
  42. package/dist/mtoon-data.d.ts +118 -0
  43. package/dist/mtoon-legacy.d.ts +17 -0
  44. package/dist/mtoon-shader.d.ts +4 -0
  45. package/dist/mtoon.d.ts +84 -0
  46. package/dist/mtoon.js +990 -0
  47. package/dist/paint.d.ts +82 -0
  48. package/dist/pose-tracking.d.ts +117 -0
  49. package/dist/pose-tracking.js +488 -0
  50. package/dist/retarget.d.ts +78 -0
  51. package/dist/retarget.js +375 -0
  52. package/dist/rig-BawZ5OLb.js +127 -0
  53. package/dist/rig.d.ts +65 -0
  54. package/dist/shared/gltf.d.ts +257 -0
  55. package/dist/shared/layers.d.ts +16 -0
  56. package/dist/springs.d.ts +180 -0
  57. package/dist/springs.js +458 -0
  58. package/dist/strand-springs.d.ts +46 -0
  59. package/dist/strand-springs.js +168 -0
  60. package/dist/swim.d.ts +55 -0
  61. package/dist/swim.js +167 -0
  62. package/dist/transfer.d.ts +41 -0
  63. package/dist/transfer.js +136 -0
  64. package/dist/validate.d.ts +188 -0
  65. package/dist/validate.js +440 -0
  66. package/dist/voxel-weights-48ok-Dax.js +255 -0
  67. package/dist/voxel-weights.d.ts +42 -0
  68. package/dist/voxel-weights.js +1 -0
  69. package/dist/voxels.d.ts +36 -0
  70. package/dist/vrm-constraints.d.ts +60 -0
  71. package/dist/vrm-constraints.js +261 -0
  72. package/dist/vrm-first-person.d.ts +115 -0
  73. package/dist/vrm-first-person.js +618 -0
  74. package/dist/vrm-presets-CU4V4yq6.js +47 -0
  75. package/dist/vrm-presets.d.ts +1 -0
  76. package/dist/vrm.d.ts +303 -0
  77. package/dist/vrm.js +574 -0
  78. package/dist/vrm0.d.ts +134 -0
  79. package/dist/vrm0.js +377 -0
  80. package/dist/vrma.d.ts +90 -0
  81. package/dist/vrma.js +315 -0
  82. package/dist/weight-map-D8cAONQQ.js +92 -0
  83. package/dist/weight-map.d.ts +58 -0
  84. package/package.json +189 -4
@@ -0,0 +1,257 @@
1
+ /** Structural glTF 2.0 data consumed by the optional loaders. Runtime validation stays at each use site. */
2
+ export interface GLTFProperty<E extends Record<string, unknown> = GLTFExtensions> {
3
+ name?: string;
4
+ extras?: unknown;
5
+ extensions?: E;
6
+ [key: string]: unknown;
7
+ }
8
+
9
+ /** One entry of EXT_lights_image_based `lights`. */
10
+ export interface GLTFImageBasedLight extends GLTFProperty {
11
+ rotation?: number[];
12
+ intensity?: number;
13
+ irradianceCoefficients: number[][];
14
+ specularImages: number[][];
15
+ specularImageSize: number;
16
+ }
17
+
18
+ /** Known extension payloads retain their schema; application-specific extensions remain unknown. */
19
+ export interface GLTFExtensions {
20
+ [key: string]: unknown;
21
+ KHR_draco_mesh_compression?: { bufferView: number; attributes: Record<string, number> };
22
+ EXT_meshopt_compression?: GLTFMeshopt;
23
+ KHR_meshopt_compression?: GLTFMeshopt;
24
+ KHR_texture_basisu?: { source: number };
25
+ MSFT_texture_dds?: { source: number };
26
+ EXT_texture_webp?: { source: number };
27
+ EXT_texture_avif?: { source: number };
28
+ KHR_texture_transform?: GLTFTextureTransform;
29
+ EXT_mesh_gpu_instancing?: GLTFInstancing;
30
+ KHR_lights_punctual?: { light?: number; lights?: GLTFLightDefinition[] };
31
+ // On the document: `lights`. On a node: `light`, `multiplier`, `color`.
32
+ EXT_lights_ies?: {
33
+ lights?: { name?: string; uri?: string; bufferView?: number; mimeType?: string }[];
34
+ light?: number;
35
+ multiplier?: number;
36
+ color?: number[];
37
+ };
38
+ // On the document: `lights`. On a scene: `light`.
39
+ EXT_lights_image_based?: { lights?: GLTFImageBasedLight[]; light?: number };
40
+ KHR_node_visibility?: { visible?: boolean };
41
+ KHR_materials_variants?: { variants?: { name: string }[]; mappings?: { material: number; variants: number[] }[] };
42
+ KHR_materials_unlit?: object;
43
+ KHR_materials_emissive_strength?: { emissiveStrength?: number };
44
+ KHR_materials_ior?: { ior?: number };
45
+ KHR_materials_dispersion?: { dispersion?: number };
46
+ KHR_materials_clearcoat?: {
47
+ clearcoatFactor?: number;
48
+ clearcoatRoughnessFactor?: number;
49
+ clearcoatTexture?: GLTFTextureInfo;
50
+ clearcoatRoughnessTexture?: GLTFTextureInfo;
51
+ clearcoatNormalTexture?: GLTFTextureInfo;
52
+ };
53
+ KHR_materials_transmission?: { transmissionFactor?: number; transmissionTexture?: GLTFTextureInfo };
54
+ KHR_materials_volume?: {
55
+ thicknessFactor?: number;
56
+ thicknessTexture?: GLTFTextureInfo;
57
+ attenuationDistance?: number;
58
+ attenuationColor?: number[];
59
+ };
60
+ KHR_materials_sheen?: {
61
+ sheenColorFactor?: number[];
62
+ sheenRoughnessFactor?: number;
63
+ sheenColorTexture?: GLTFTextureInfo;
64
+ sheenRoughnessTexture?: GLTFTextureInfo;
65
+ };
66
+ KHR_materials_specular?: {
67
+ specularFactor?: number;
68
+ specularColorFactor?: number[];
69
+ specularTexture?: GLTFTextureInfo;
70
+ specularColorTexture?: GLTFTextureInfo;
71
+ };
72
+ KHR_materials_iridescence?: {
73
+ iridescenceFactor?: number;
74
+ iridescenceIor?: number;
75
+ iridescenceThicknessMinimum?: number;
76
+ iridescenceThicknessMaximum?: number;
77
+ iridescenceTexture?: GLTFTextureInfo;
78
+ iridescenceThicknessTexture?: GLTFTextureInfo;
79
+ };
80
+ KHR_materials_anisotropy?: {
81
+ anisotropyStrength?: number;
82
+ anisotropyRotation?: number;
83
+ anisotropyTexture?: GLTFTextureInfo;
84
+ };
85
+ KHR_materials_diffuse_roughness?: {
86
+ diffuseRoughnessFactor?: number;
87
+ diffuseRoughnessTexture?: GLTFTextureInfo;
88
+ };
89
+ KHR_materials_diffuse_transmission?: {
90
+ diffuseTransmissionFactor?: number;
91
+ diffuseTransmissionColorFactor?: number[];
92
+ diffuseTransmissionTexture?: GLTFTextureInfo;
93
+ diffuseTransmissionColorTexture?: GLTFTextureInfo;
94
+ };
95
+ KHR_materials_volume_scatter?: {
96
+ multiscatterColorFactor?: number[];
97
+ multiscatterColorTexture?: GLTFTextureInfo;
98
+ scatterAnisotropy?: number;
99
+ };
100
+ EXT_materials_bump?: {
101
+ bumpFactor?: number;
102
+ bumpTexture?: GLTFTextureInfo;
103
+ heightSpace?: 'world' | 'object';
104
+ };
105
+ }
106
+ export interface GLTFMeshopt {
107
+ fallback?: boolean;
108
+ buffer: number;
109
+ byteOffset?: number;
110
+ byteLength: number;
111
+ byteStride: number;
112
+ count: number;
113
+ mode: string;
114
+ filter?: string;
115
+ }
116
+ export interface GLTFInstancing {
117
+ attributes: Record<string, number>;
118
+ }
119
+ export interface GLTFTextureTransform {
120
+ offset?: readonly [number, number];
121
+ rotation?: number;
122
+ scale?: readonly [number, number];
123
+ texCoord?: number;
124
+ }
125
+ export interface GLTFTextureInfo extends GLTFProperty {
126
+ index: number;
127
+ texCoord?: number;
128
+ scale?: number;
129
+ strength?: number;
130
+ }
131
+ export interface GLTFBufferExtensions {
132
+ [key: string]: unknown;
133
+ EXT_meshopt_compression?: { fallback?: boolean };
134
+ }
135
+ export interface GLTFBuffer extends GLTFProperty<GLTFBufferExtensions> {
136
+ byteLength: number;
137
+ uri?: string;
138
+ }
139
+ export interface GLTFBufferView extends GLTFProperty {
140
+ buffer: number;
141
+ byteLength: number;
142
+ byteOffset?: number;
143
+ byteStride?: number;
144
+ target?: number;
145
+ }
146
+ export interface GLTFAccessor extends GLTFProperty {
147
+ bufferView?: number;
148
+ byteOffset?: number;
149
+ componentType: number;
150
+ count: number;
151
+ type: string;
152
+ normalized?: boolean;
153
+ min?: number[];
154
+ max?: number[];
155
+ sparse?: {
156
+ count: number;
157
+ indices: { bufferView: number; byteOffset?: number; componentType: number };
158
+ values: { bufferView: number; byteOffset?: number };
159
+ };
160
+ }
161
+ export interface GLTFPrimitive extends GLTFProperty {
162
+ /** Absent for engine-owned prepared geometry whose vertices are supplied separately. */
163
+ attributes?: Record<string, number>;
164
+ indices?: number;
165
+ material?: number;
166
+ mode?: number;
167
+ targets?: Record<string, number>[];
168
+ }
169
+ export interface GLTFMesh extends GLTFProperty {
170
+ primitives: GLTFPrimitive[];
171
+ weights?: number[];
172
+ }
173
+ export interface GLTFNode extends GLTFProperty {
174
+ mesh?: number;
175
+ skin?: number;
176
+ camera?: number;
177
+ children?: number[];
178
+ matrix?: number[];
179
+ translation?: number[];
180
+ rotation?: number[];
181
+ scale?: number[];
182
+ weights?: number[];
183
+ }
184
+ export interface GLTFMaterial extends GLTFProperty {
185
+ pbrMetallicRoughness?: {
186
+ baseColorFactor?: number[];
187
+ metallicFactor?: number;
188
+ roughnessFactor?: number;
189
+ baseColorTexture?: GLTFTextureInfo;
190
+ metallicRoughnessTexture?: GLTFTextureInfo;
191
+ };
192
+ normalTexture?: GLTFTextureInfo;
193
+ occlusionTexture?: GLTFTextureInfo;
194
+ emissiveTexture?: GLTFTextureInfo;
195
+ emissiveFactor?: number[];
196
+ alphaMode?: string;
197
+ alphaCutoff?: number;
198
+ doubleSided?: boolean;
199
+ }
200
+ export interface GLTFTexture extends GLTFProperty {
201
+ source?: number;
202
+ sampler?: number;
203
+ }
204
+ export interface GLTFImageDefinition extends GLTFProperty {
205
+ uri?: string;
206
+ mimeType?: string;
207
+ bufferView?: number;
208
+ }
209
+ export interface GLTFSampler extends GLTFProperty {
210
+ wrapS?: number;
211
+ wrapT?: number;
212
+ magFilter?: number;
213
+ minFilter?: number;
214
+ }
215
+ export interface GLTFSkin extends GLTFProperty {
216
+ joints: number[];
217
+ inverseBindMatrices?: number;
218
+ skeleton?: number;
219
+ }
220
+ export interface GLTFAnimation extends GLTFProperty {
221
+ samplers: { input: number; output: number; interpolation?: string }[];
222
+ channels: { sampler: number; target: { node?: number; path: string; extensions?: Record<string, unknown> } }[];
223
+ }
224
+ export interface GLTFLightDefinition extends GLTFProperty {
225
+ type: 'directional' | 'point' | 'spot';
226
+ color?: number[];
227
+ intensity?: number;
228
+ range?: number;
229
+ spot?: { innerConeAngle?: number; outerConeAngle?: number };
230
+ }
231
+ export interface GLTFCameraDefinition extends GLTFProperty {
232
+ type: 'perspective' | 'orthographic';
233
+ perspective?: { yfov: number; znear: number; zfar?: number; aspectRatio?: number };
234
+ orthographic?: { xmag: number; ymag: number; znear: number; zfar: number };
235
+ }
236
+ /**
237
+ * A glTF 2.0 JSON document as the loaders read it: scenes, nodes, meshes, materials, animations and the other top-level arrays.
238
+ */
239
+ export interface GLTFDocument extends GLTFProperty {
240
+ asset?: { version: string; generator?: string; [key: string]: unknown };
241
+ buffers?: GLTFBuffer[];
242
+ bufferViews?: GLTFBufferView[];
243
+ accessors?: GLTFAccessor[];
244
+ meshes?: GLTFMesh[];
245
+ nodes?: GLTFNode[];
246
+ scenes?: (GLTFProperty & { nodes?: number[] })[];
247
+ scene?: number;
248
+ materials?: GLTFMaterial[];
249
+ textures?: GLTFTexture[];
250
+ images?: GLTFImageDefinition[];
251
+ samplers?: GLTFSampler[];
252
+ skins?: GLTFSkin[];
253
+ animations?: GLTFAnimation[];
254
+ cameras?: GLTFCameraDefinition[];
255
+ extensionsUsed?: string[];
256
+ extensionsRequired?: string[];
257
+ }
@@ -0,0 +1,16 @@
1
+ /** The render-layer registry on `globalThis` that core, @margoengine/cameras and @margoengine/environment read. */
2
+ export interface LayerRegistry {
3
+ readonly masks: WeakMap<object, number>;
4
+ readonly cameras: WeakMap<object, number>;
5
+ source: ((mesh: never) => number) | null;
6
+ used: boolean;
7
+ maskOf(mesh: object): number;
8
+ }
9
+ /** The registry, created on first use. */
10
+ export function renderLayers(): LayerRegistry;
11
+ /** Sets the layer mask of `mesh` (32-bit, default 1). @throws RangeError for a mask outside 0..0xffffffff. */
12
+ export function setRenderLayers(mesh: object, mask: number): void;
13
+ /** Layer of VRM `firstPersonOnly` meshes: 29. */
14
+ export const FIRST_PERSON_ONLY_LAYER: 29;
15
+ /** Layer of VRM `thirdPersonOnly` meshes: 30. */
16
+ export const THIRD_PERSON_ONLY_LAYER: 30;
@@ -0,0 +1,180 @@
1
+ import type { Vec3 } from '@margoengine/math';
2
+ // @ts-ignore optional peer: its types apply when it is installed
3
+ import type { Animator } from '@margoengine/animator';
4
+ // @ts-ignore optional peer: its types apply when it is installed
5
+ import type { Mesh as MeshHandle } from '@margoengine/core';
6
+ /** How one bone of a chain moves; the numbers mean what VRMC_springBone's joint fields mean. */
7
+ export interface SpringSettings {
8
+ /** Pull back toward the animated direction, 0 or more (default 1). */
9
+ stiffness?: number;
10
+ /** Share of the speed lost each 1/60 s, 0 to 1 (default 0.5). */
11
+ drag?: number;
12
+ /** Strength of gravity on the tail (default 0: hair settles on the animated pose). */
13
+ gravity?: number;
14
+ /** World direction of gravity (default straight down, [0, -1, 0]); need not be unit length. */
15
+ gravityDirection?: Vec3;
16
+ /** Radius of the tail against colliders, world units at scale 1 (default 0). */
17
+ radius?: number;
18
+ }
19
+ /** One chain of swinging bones. */
20
+ export interface SpringChain extends SpringSettings {
21
+ /**
22
+ * Bones from the first to the last (glTF node indices with {@link addSpringBones}), each an ancestor of the next;
23
+ * bones left out between two joints ride along. The last joint is only a tail and does not turn, unless `tail` is
24
+ * set. At most 256.
25
+ */
26
+ joints: readonly number[];
27
+ /** Settings of single joints, by position in `joints`, over the chain's own. */
28
+ settings?: readonly (SpringSettings | undefined)[];
29
+ /**
30
+ * End point past the last joint, in that joint's local space, so the last joint turns too. A single joint with a
31
+ * `tail` is an accessory: an earring or an antenna. Default none.
32
+ */
33
+ tail?: Vec3 | null;
34
+ /**
35
+ * Bone the chain's inertia is measured against: `joints[0]` or one of its ancestors. Motion of that bone does not
36
+ * swing the chain, so a running character's hair moves with the head alone. Default none: world space.
37
+ */
38
+ center?: number | null;
39
+ /** Indices into {@link SpringBonesOptions.colliders} this chain hits. Default all of them. */
40
+ colliders?: readonly number[];
41
+ }
42
+ /** A sphere, or a capsule when `tail` is set, that tails cannot enter. */
43
+ export interface SpringCollider {
44
+ /** Bone the shape rides on. Default none: `offset` and `tail` are world points. */
45
+ node?: number | null;
46
+ /** Centre of the sphere, or of the capsule's first end, in the bone's space. Default [0, 0, 0]. */
47
+ offset?: Vec3;
48
+ /** Centre of the capsule's second end, in the bone's space. Default none: a sphere. */
49
+ tail?: Vec3 | null;
50
+ /** Radius, above 0. */
51
+ radius: number;
52
+ }
53
+ /** A bone that lags and wobbles in place: its position trails the animated one on a damped spring. */
54
+ export interface Jiggle {
55
+ /** The bone. */
56
+ joint: number;
57
+ /** Wobbles a second, above 0 and at most 15 (default 4). */
58
+ frequency?: number;
59
+ /** Share of critical damping, above 0 (default 0.35): 1 stops without a wobble. */
60
+ damping?: number;
61
+ /** Farthest the bone strays from its animated position, world units at scale 1 (default 0.05). */
62
+ limit?: number;
63
+ /** Share of the movement shown, 0 to 1 (default 1). */
64
+ amount?: number;
65
+ }
66
+ /** What {@link SpringBones} simulates. The object is kept and read every frame, so settings can change live. */
67
+ export interface SpringBonesOptions {
68
+ /** Swinging chains. A joint can belong to one chain only. */
69
+ chains?: readonly SpringChain[];
70
+ /** Spheres and capsules. */
71
+ colliders?: readonly SpringCollider[];
72
+ /** Bones that wobble in place. */
73
+ jiggles?: readonly Jiggle[];
74
+ /** Extra world force on every tail, such as wind, in `gravity` units. Default none. */
75
+ force?: Vec3 | null;
76
+ /** Blend from the animated pose (0) to the simulated one (1); default 1. */
77
+ weight?: number;
78
+ /**
79
+ * World speed (units a second at scale 1) above which a chain counts as teleported and restarts from the animated
80
+ * pose instead of whipping across the gap. Default 100.
81
+ */
82
+ teleportSpeed?: number;
83
+ }
84
+ /** Reads and writes of the bones {@link SpringBones.step} moves. */
85
+ export interface SpringAccess {
86
+ /** World matrix of a bone, 16 numbers, column-major, current after `flush`. */
87
+ world(bone: number): ArrayLike<number>;
88
+ /** World matrix of a bone's parent, or null for a bone with none. */
89
+ parentWorld(bone: number): ArrayLike<number> | null;
90
+ /** Sets a bone's local rotation. */
91
+ rotate(bone: number, rotation: readonly number[]): void;
92
+ /** Adds to a bone's local translation. */
93
+ move(bone: number, offset: readonly number[]): void;
94
+ /** Brings `world` up to date with the writes so far. */
95
+ flush(): void;
96
+ }
97
+ /** A pose as plain data: parents, and 10 numbers per bone (translation xyz, rotation xyzw, scale xyz). */
98
+ export interface SpringPose {
99
+ readonly parents: readonly number[];
100
+ readonly local: Float64Array | number[];
101
+ }
102
+ /** A skeleton {@link SpringBones.stepSkeleton} can pose: `@margoengine/animation`'s `Skeleton` fits. */
103
+ export interface SpringSkeleton {
104
+ readonly parents: readonly number[];
105
+ getPose(bone: number): {
106
+ translation: ArrayLike<number>;
107
+ rotation: ArrayLike<number>;
108
+ scale: ArrayLike<number>;
109
+ };
110
+ setPose(bone: number, pose: {
111
+ translation: readonly [number, number, number];
112
+ rotation: readonly [number, number, number, number];
113
+ }): unknown;
114
+ }
115
+ /**
116
+ * The simulation behind {@link addSpringBones}, for any skeleton: pure data in and out, no engine or GPU. Use
117
+ * {@link stepPose} for a plain pose, {@link stepSkeleton} for a `Skeleton`, or {@link step} for your own bones.
118
+ */
119
+ export declare class SpringBones {
120
+ private readonly parents;
121
+ readonly options: SpringBonesOptions;
122
+ private readonly chains;
123
+ private readonly jiggles;
124
+ private world;
125
+ /**
126
+ * @param parents parent of each bone, -1 at the top (glTF nodes in node order with {@link addSpringBones}).
127
+ * @param options what to simulate; kept and read every frame.
128
+ * @throws RangeError for bad bones or settings, TypeError for chains that are not ancestor lines.
129
+ */
130
+ constructor(parents: readonly number[], options: SpringBonesOptions);
131
+ /** The bones this simulation turns or moves, each once. */
132
+ bones(): number[];
133
+ /** Forgets all motion: the next step starts from the animated pose. Call it after moving a character by hand. */
134
+ reset(): void;
135
+ /** Reads and checks the live settings. */
136
+ private settings;
137
+ /**
138
+ * Advances `delta` seconds on bones reached through `access`: reads their animated world matrices and writes the
139
+ * swung rotations and jiggled positions. Run it after the frame's animation, once per frame. A `delta` of 0 holds
140
+ * the motion. Long frames take at most 8 steps of 1/60 s, so a stall slows the swing and cannot blow it up.
141
+ * @throws RangeError for a bad `delta` or settings.
142
+ */
143
+ step(delta: number, access: SpringAccess): void;
144
+ private solveChain;
145
+ private solveJiggle;
146
+ /**
147
+ * Advances a plain pose in place: `pose.local` holds the animated pose going in and the swung one coming out.
148
+ * @param root World matrix of the skeleton (16 numbers), for a character that moves. Default none: skeleton space.
149
+ */
150
+ stepPose(pose: SpringPose, delta: number, root?: ArrayLike<number>): void;
151
+ /** Advances a `Skeleton` from `@margoengine/animation` in place, after its pose is set. `root` as in {@link stepPose}. */
152
+ stepSkeleton(skeleton: SpringSkeleton, delta: number, root?: ArrayLike<number>): void;
153
+ }
154
+ /** What {@link springAccess} reads of a model: `animation.model` fits. */
155
+ export interface SpringModel {
156
+ readonly nodes: readonly MeshHandle[];
157
+ readonly root: MeshHandle;
158
+ }
159
+ /**
160
+ * The {@link SpringAccess} of a model's glTF nodes, for running {@link SpringBones.step} by hand. `writeRotation`
161
+ * replaces `setQuaternion`, as `animator.writeNodeRotation` does on an animated model.
162
+ */
163
+ export declare function springAccess(model: SpringModel, writeRotation?: (bone: number, rotation: readonly number[]) => void): SpringAccess;
164
+ /** A running {@link addSpringBones}. */
165
+ export interface SpringBonesHandle {
166
+ /** The simulation; its `options` are the object passed in. */
167
+ readonly springs: SpringBones;
168
+ /** Forgets all motion, for a character moved by hand. */
169
+ reset(): void;
170
+ /** Stops the simulation. */
171
+ dispose(): void;
172
+ [Symbol.dispose](): void;
173
+ }
174
+ /**
175
+ * Runs spring bones on `animator` (`@margoengine/animator`), every frame after the pose, layers, foot IK and the solvers
176
+ * added before it. Joints, centers and collider nodes are glTF node indices of the animator's model. Joints and their
177
+ * ancestors need positive scales. Returns the handle; dispose it to stop.
178
+ * @throws RangeError for bad bones or settings, TypeError for chains that are not ancestor lines.
179
+ */
180
+ export declare function addSpringBones(animator: Animator, options: SpringBonesOptions): SpringBonesHandle;