@oyna360/lobby-sdk 0.1.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.
- package/LICENSE +21 -0
- package/README.md +123 -0
- package/dist/avatar-accessories.d.ts +16 -0
- package/dist/avatar-accessories.d.ts.map +1 -0
- package/dist/avatar-accessories.js +214 -0
- package/dist/avatar-accessories.js.map +1 -0
- package/dist/avatar-asset-manager.d.ts +54 -0
- package/dist/avatar-asset-manager.d.ts.map +1 -0
- package/dist/avatar-asset-manager.js +215 -0
- package/dist/avatar-asset-manager.js.map +1 -0
- package/dist/avatar-clips.d.ts +17 -0
- package/dist/avatar-clips.d.ts.map +1 -0
- package/dist/avatar-clips.js +47 -0
- package/dist/avatar-clips.js.map +1 -0
- package/dist/avatar-config.d.ts +4 -0
- package/dist/avatar-config.d.ts.map +1 -0
- package/dist/avatar-config.js +9 -0
- package/dist/avatar-config.js.map +1 -0
- package/dist/avatar-factory.d.ts +64 -0
- package/dist/avatar-factory.d.ts.map +1 -0
- package/dist/avatar-factory.js +464 -0
- package/dist/avatar-factory.js.map +1 -0
- package/dist/avatar-instance.d.ts +31 -0
- package/dist/avatar-instance.d.ts.map +1 -0
- package/dist/avatar-instance.js +56 -0
- package/dist/avatar-instance.js.map +1 -0
- package/dist/avatar-material-pipeline.d.ts +34 -0
- package/dist/avatar-material-pipeline.d.ts.map +1 -0
- package/dist/avatar-material-pipeline.js +580 -0
- package/dist/avatar-material-pipeline.js.map +1 -0
- package/dist/avatar-rig-builder.d.ts +74 -0
- package/dist/avatar-rig-builder.d.ts.map +1 -0
- package/dist/avatar-rig-builder.js +347 -0
- package/dist/avatar-rig-builder.js.map +1 -0
- package/dist/draco.d.ts +7 -0
- package/dist/draco.d.ts.map +1 -0
- package/dist/draco.js +82 -0
- package/dist/draco.js.map +1 -0
- package/dist/humanoid-animator.d.ts +35 -0
- package/dist/humanoid-animator.d.ts.map +1 -0
- package/dist/humanoid-animator.js +191 -0
- package/dist/humanoid-animator.js.map +1 -0
- package/dist/humanoid-bone-names.d.ts +35 -0
- package/dist/humanoid-bone-names.d.ts.map +1 -0
- package/dist/humanoid-bone-names.js +126 -0
- package/dist/humanoid-bone-names.js.map +1 -0
- package/dist/humanoid-locomotion.d.ts +101 -0
- package/dist/humanoid-locomotion.d.ts.map +1 -0
- package/dist/humanoid-locomotion.js +300 -0
- package/dist/humanoid-locomotion.js.map +1 -0
- package/dist/humanoid-rig.d.ts +51 -0
- package/dist/humanoid-rig.d.ts.map +1 -0
- package/dist/humanoid-rig.js +304 -0
- package/dist/humanoid-rig.js.map +1 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/lobby-chat-ui.d.ts +3 -0
- package/dist/lobby-chat-ui.d.ts.map +1 -0
- package/dist/lobby-chat-ui.js +258 -0
- package/dist/lobby-chat-ui.js.map +1 -0
- package/dist/lobby-colliders.d.ts +10 -0
- package/dist/lobby-colliders.d.ts.map +1 -0
- package/dist/lobby-colliders.js +225 -0
- package/dist/lobby-colliders.js.map +1 -0
- package/dist/lobby-connection-ui.d.ts +8 -0
- package/dist/lobby-connection-ui.d.ts.map +1 -0
- package/dist/lobby-connection-ui.js +68 -0
- package/dist/lobby-connection-ui.js.map +1 -0
- package/dist/lobby-debug.d.ts +50 -0
- package/dist/lobby-debug.d.ts.map +1 -0
- package/dist/lobby-debug.js +132 -0
- package/dist/lobby-debug.js.map +1 -0
- package/dist/lobby-font.d.ts +5 -0
- package/dist/lobby-font.d.ts.map +1 -0
- package/dist/lobby-font.js +35 -0
- package/dist/lobby-font.js.map +1 -0
- package/dist/lobby-music.d.ts +40 -0
- package/dist/lobby-music.d.ts.map +1 -0
- package/dist/lobby-music.js +250 -0
- package/dist/lobby-music.js.map +1 -0
- package/dist/lobby-orientation-ui.d.ts +10 -0
- package/dist/lobby-orientation-ui.d.ts.map +1 -0
- package/dist/lobby-orientation-ui.js +64 -0
- package/dist/lobby-orientation-ui.js.map +1 -0
- package/dist/lobby-perf-diag.d.ts +254 -0
- package/dist/lobby-perf-diag.d.ts.map +1 -0
- package/dist/lobby-perf-diag.js +775 -0
- package/dist/lobby-perf-diag.js.map +1 -0
- package/dist/lobby-plaza-diag.d.ts +103 -0
- package/dist/lobby-plaza-diag.d.ts.map +1 -0
- package/dist/lobby-plaza-diag.js +534 -0
- package/dist/lobby-plaza-diag.js.map +1 -0
- package/dist/lobby-presence-ui.d.ts +4 -0
- package/dist/lobby-presence-ui.d.ts.map +1 -0
- package/dist/lobby-presence-ui.js +89 -0
- package/dist/lobby-presence-ui.js.map +1 -0
- package/dist/lobby-real-device-diag.d.ts +119 -0
- package/dist/lobby-real-device-diag.d.ts.map +1 -0
- package/dist/lobby-real-device-diag.js +468 -0
- package/dist/lobby-real-device-diag.js.map +1 -0
- package/dist/lobby-spawn.d.ts +15 -0
- package/dist/lobby-spawn.d.ts.map +1 -0
- package/dist/lobby-spawn.js +18 -0
- package/dist/lobby-spawn.js.map +1 -0
- package/dist/lobby-ui-i18n.d.ts +11 -0
- package/dist/lobby-ui-i18n.d.ts.map +1 -0
- package/dist/lobby-ui-i18n.js +21 -0
- package/dist/lobby-ui-i18n.js.map +1 -0
- package/dist/lobby-voice-ui.d.ts +3 -0
- package/dist/lobby-voice-ui.d.ts.map +1 -0
- package/dist/lobby-voice-ui.js +105 -0
- package/dist/lobby-voice-ui.js.map +1 -0
- package/dist/local-player-controller.d.ts +80 -0
- package/dist/local-player-controller.d.ts.map +1 -0
- package/dist/local-player-controller.js +422 -0
- package/dist/local-player-controller.js.map +1 -0
- package/dist/name-tag.d.ts +3 -0
- package/dist/name-tag.d.ts.map +1 -0
- package/dist/name-tag.js +59 -0
- package/dist/name-tag.js.map +1 -0
- package/dist/network-client.d.ts +87 -0
- package/dist/network-client.d.ts.map +1 -0
- package/dist/network-client.js +182 -0
- package/dist/network-client.js.map +1 -0
- package/dist/platform-bridge.d.ts +17 -0
- package/dist/platform-bridge.d.ts.map +1 -0
- package/dist/platform-bridge.js +90 -0
- package/dist/platform-bridge.js.map +1 -0
- package/dist/platform-lobby.d.ts +176 -0
- package/dist/platform-lobby.d.ts.map +1 -0
- package/dist/platform-lobby.js +679 -0
- package/dist/platform-lobby.js.map +1 -0
- package/dist/platform-types.d.ts +56 -0
- package/dist/platform-types.d.ts.map +1 -0
- package/dist/platform-types.js +3 -0
- package/dist/platform-types.js.map +1 -0
- package/dist/player-label.d.ts +9 -0
- package/dist/player-label.d.ts.map +1 -0
- package/dist/player-label.js +14 -0
- package/dist/player-label.js.map +1 -0
- package/dist/playground/playground-layout.d.ts +14 -0
- package/dist/playground/playground-layout.d.ts.map +1 -0
- package/dist/playground/playground-layout.js +320 -0
- package/dist/playground/playground-layout.js.map +1 -0
- package/dist/playground/playground-system.d.ts +30 -0
- package/dist/playground/playground-system.d.ts.map +1 -0
- package/dist/playground/playground-system.js +202 -0
- package/dist/playground/playground-system.js.map +1 -0
- package/dist/plaza-layout.d.ts +30 -0
- package/dist/plaza-layout.d.ts.map +1 -0
- package/dist/plaza-layout.js +527 -0
- package/dist/plaza-layout.js.map +1 -0
- package/dist/plugins.d.ts +5 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +26 -0
- package/dist/plugins.js.map +1 -0
- package/dist/protocol.d.ts +276 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +107 -0
- package/dist/protocol.js.map +1 -0
- package/dist/quality.d.ts +39 -0
- package/dist/quality.d.ts.map +1 -0
- package/dist/quality.js +95 -0
- package/dist/quality.js.map +1 -0
- package/dist/remote-player-manager.d.ts +48 -0
- package/dist/remote-player-manager.d.ts.map +1 -0
- package/dist/remote-player-manager.js +339 -0
- package/dist/remote-player-manager.js.map +1 -0
- package/dist/scene-manager.d.ts +26 -0
- package/dist/scene-manager.d.ts.map +1 -0
- package/dist/scene-manager.js +169 -0
- package/dist/scene-manager.js.map +1 -0
- package/dist/spawn-utils.d.ts +8 -0
- package/dist/spawn-utils.d.ts.map +1 -0
- package/dist/spawn-utils.js +29 -0
- package/dist/spawn-utils.js.map +1 -0
- package/dist/starter-layout.d.ts +17 -0
- package/dist/starter-layout.d.ts.map +1 -0
- package/dist/starter-layout.js +102 -0
- package/dist/starter-layout.js.map +1 -0
- package/dist/third-person-camera.d.ts +35 -0
- package/dist/third-person-camera.d.ts.map +1 -0
- package/dist/third-person-camera.js +181 -0
- package/dist/third-person-camera.js.map +1 -0
- package/dist/types.d.ts +164 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/voice-chat.d.ts +78 -0
- package/dist/voice-chat.d.ts.map +1 -0
- package/dist/voice-chat.js +321 -0
- package/dist/voice-chat.js.map +1 -0
- package/dist/yield-to-render.d.ts +3 -0
- package/dist/yield-to-render.d.ts.map +1 -0
- package/dist/yield-to-render.js +11 -0
- package/dist/yield-to-render.js.map +1 -0
- package/dist/zones.d.ts +36 -0
- package/dist/zones.d.ts.map +1 -0
- package/dist/zones.js +68 -0
- package/dist/zones.js.map +1 -0
- package/docs/00-overview.md +47 -0
- package/docs/01-connect.md +85 -0
- package/docs/02-github.md +43 -0
- package/docs/03-modes.md +70 -0
- package/docs/04-api.md +106 -0
- package/docs/05-features.md +55 -0
- package/docs/06-controls.md +34 -0
- package/docs/07-troubleshooting.md +39 -0
- package/package.json +65 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { pickAvatarClip } from './avatar-clips';
|
|
2
|
+
import { HumanoidPose, RUN_GAIT, WALK_GAIT, approach, cloneGait, footContacts, gaitFrequency, lerpGait, writeAirPose, writeGaitPose, writeIdlePose, writeSlidePose, } from './humanoid-locomotion';
|
|
3
|
+
import { applyHumanoidPose } from './humanoid-rig';
|
|
4
|
+
/** Nominal speeds used to normalise cadence when a caller reports no velocity. */
|
|
5
|
+
const DEFAULT_WALK_SPEED = 10.5;
|
|
6
|
+
const DEFAULT_RUN_SPEED = 13.65;
|
|
7
|
+
/** Blend times, seconds. Start-up is a touch faster than wind-down. */
|
|
8
|
+
const BLEND_IN = 0.11;
|
|
9
|
+
const BLEND_OUT = 0.16;
|
|
10
|
+
const RUN_BLEND = 0.2;
|
|
11
|
+
const AIR_BLEND = 0.07;
|
|
12
|
+
const SLIDE_BLEND = 0.12;
|
|
13
|
+
/**
|
|
14
|
+
* Legacy 6-pivot fallback (box avatars and GLBs whose skeleton could not be
|
|
15
|
+
* mapped). Character-space angles → local Euler on plain pivot nodes.
|
|
16
|
+
*/
|
|
17
|
+
function applySimplePose(rig, pose) {
|
|
18
|
+
setPivot(rig, 'torso', pose.pitch('chest') + pose.pitch('spine'), pose.yaw('chest'), pose.roll('chest'));
|
|
19
|
+
setPivot(rig, 'head', pose.pitch('head'), pose.yaw('head'), pose.roll('head'));
|
|
20
|
+
setPivot(rig, 'armL', pose.pitch('upperArmL'), pose.yaw('upperArmL'), pose.roll('upperArmL'));
|
|
21
|
+
setPivot(rig, 'armR', pose.pitch('upperArmR'), pose.yaw('upperArmR'), pose.roll('upperArmR'));
|
|
22
|
+
setPivot(rig, 'legL', pose.pitch('thighL'), pose.yaw('thighL'), pose.roll('thighL'));
|
|
23
|
+
setPivot(rig, 'legR', pose.pitch('thighR'), pose.yaw('thighR'), pose.roll('thighR'));
|
|
24
|
+
}
|
|
25
|
+
function setPivot(rig, limb, pitch, yaw, roll) {
|
|
26
|
+
const node = rig[limb];
|
|
27
|
+
// Pivots hang down the -Y axis, so a forward swing is a negative X rotation.
|
|
28
|
+
const x = -pitch;
|
|
29
|
+
const y = -yaw;
|
|
30
|
+
const rest = rig.restRotation?.[limb];
|
|
31
|
+
if (rig.boneDriven && rest) {
|
|
32
|
+
node.rotationQuaternion = null;
|
|
33
|
+
node.rotation.set(rest.x + x, rest.y + y, rest.z + roll);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
node.rotation.set(x, y, roll);
|
|
37
|
+
}
|
|
38
|
+
export class HumanoidAnimator {
|
|
39
|
+
avatar;
|
|
40
|
+
time = 0;
|
|
41
|
+
phase = 0;
|
|
42
|
+
walkWeight = 0;
|
|
43
|
+
runWeight = 0;
|
|
44
|
+
airWeight = 0;
|
|
45
|
+
slideWeight = 0;
|
|
46
|
+
speed = 0;
|
|
47
|
+
pendingContacts = 0;
|
|
48
|
+
clipStepAcc = 0;
|
|
49
|
+
slideMode = false;
|
|
50
|
+
walkSpeedRef = DEFAULT_WALK_SPEED;
|
|
51
|
+
runSpeedRef = DEFAULT_RUN_SPEED;
|
|
52
|
+
pose = new HumanoidPose();
|
|
53
|
+
gait = cloneGait(WALK_GAIT);
|
|
54
|
+
groups;
|
|
55
|
+
activeClip = null;
|
|
56
|
+
constructor(avatar, animationGroups) {
|
|
57
|
+
this.avatar = avatar;
|
|
58
|
+
const groups = animationGroups?.length ? animationGroups : avatar.animationGroups;
|
|
59
|
+
this.groups = groups.length ? groups : null;
|
|
60
|
+
}
|
|
61
|
+
setSlideMode(on) {
|
|
62
|
+
this.slideMode = on;
|
|
63
|
+
}
|
|
64
|
+
/** Lets cadence be normalised against the lobby's configured move speeds. */
|
|
65
|
+
setSpeedReference(walkSpeed, runSpeed) {
|
|
66
|
+
if (walkSpeed > 0.1)
|
|
67
|
+
this.walkSpeedRef = walkSpeed;
|
|
68
|
+
if (runSpeed > 0.1)
|
|
69
|
+
this.runSpeedRef = runSpeed;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @param speed horizontal speed in units/s; drives stride cadence so the feet
|
|
73
|
+
* cannot scrub the floor. Omit to fall back to nominal speeds.
|
|
74
|
+
*/
|
|
75
|
+
update(dt, state, grounded, speed) {
|
|
76
|
+
if (this.groups) {
|
|
77
|
+
this.playClip(state);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const rig = this.avatar.rig;
|
|
81
|
+
if (!rig)
|
|
82
|
+
return;
|
|
83
|
+
const humanoid = rig.humanoid ?? null;
|
|
84
|
+
// Unskinned rigid GLB: no limb bones — keep the visual stable.
|
|
85
|
+
if (this.avatar.rigidGlb && !rig.boneDriven) {
|
|
86
|
+
rig.visual.position.y = 0;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const step = dt > 0.1 ? 0.1 : dt;
|
|
90
|
+
this.time += step;
|
|
91
|
+
const moving = state === 'walk' || state === 'run';
|
|
92
|
+
const airborne = state === 'jump' || (state === 'fall' && !grounded);
|
|
93
|
+
const running = state === 'run';
|
|
94
|
+
this.walkWeight = approach(this.walkWeight, moving ? 1 : 0, moving ? BLEND_IN : BLEND_OUT, step);
|
|
95
|
+
this.runWeight = approach(this.runWeight, running ? 1 : 0, RUN_BLEND, step);
|
|
96
|
+
this.airWeight = approach(this.airWeight, airborne ? 1 : 0, AIR_BLEND, step);
|
|
97
|
+
this.slideWeight = approach(this.slideWeight, this.slideMode ? 1 : 0, SLIDE_BLEND, step);
|
|
98
|
+
const reference = this.walkSpeedRef + (this.runSpeedRef - this.walkSpeedRef) * this.runWeight;
|
|
99
|
+
const measured = speed !== undefined
|
|
100
|
+
? speed
|
|
101
|
+
: moving
|
|
102
|
+
? running
|
|
103
|
+
? this.runSpeedRef
|
|
104
|
+
: this.walkSpeedRef
|
|
105
|
+
: 0;
|
|
106
|
+
// Smooth the reported speed so accel/decel does not jitter the cadence.
|
|
107
|
+
this.speed = approach(this.speed, measured, 0.12, step);
|
|
108
|
+
lerpGait(this.gait, WALK_GAIT, RUN_GAIT, this.runWeight);
|
|
109
|
+
const ratio = reference > 0.01 ? this.speed / reference : 0;
|
|
110
|
+
const advance = gaitFrequency(this.speed, reference, this.gait) * step;
|
|
111
|
+
if (this.walkWeight > 0.02) {
|
|
112
|
+
this.pendingContacts += footContacts(this.phase, advance);
|
|
113
|
+
this.phase += advance;
|
|
114
|
+
if (this.phase >= 1 || this.phase < 0)
|
|
115
|
+
this.phase -= Math.floor(this.phase);
|
|
116
|
+
}
|
|
117
|
+
const groundWeight = (1 - this.airWeight) * (1 - this.slideWeight);
|
|
118
|
+
// Shorter steps at low speed, full stride at cruising speed.
|
|
119
|
+
const strideScale = 0.55 + 0.45 * (ratio < 0.4 ? 0.4 : ratio > 1 ? 1 : ratio);
|
|
120
|
+
const gaitWeight = this.walkWeight * groundWeight * strideScale;
|
|
121
|
+
this.pose.reset();
|
|
122
|
+
writeIdlePose(this.pose, this.time, groundWeight * (1 - this.walkWeight));
|
|
123
|
+
writeGaitPose(this.pose, this.phase, this.gait, gaitWeight);
|
|
124
|
+
if (this.airWeight > 0.002) {
|
|
125
|
+
writeAirPose(this.pose, state === 'jump', this.airWeight * (1 - this.slideWeight));
|
|
126
|
+
}
|
|
127
|
+
if (this.slideWeight > 0.002)
|
|
128
|
+
writeSlidePose(this.pose, this.slideWeight);
|
|
129
|
+
if (humanoid) {
|
|
130
|
+
applyHumanoidPose(humanoid, this.pose);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
applySimplePose(rig, this.pose);
|
|
134
|
+
if (!rig.boneDriven)
|
|
135
|
+
rig.torso.position.y = 1.18;
|
|
136
|
+
}
|
|
137
|
+
rig.visual.position.y = this.pose.bob;
|
|
138
|
+
}
|
|
139
|
+
/** True on each visual foot plant (walk / run), for footstep audio. */
|
|
140
|
+
takeFootPlant(state, dt = 1 / 60) {
|
|
141
|
+
if (state !== 'walk' && state !== 'run') {
|
|
142
|
+
this.pendingContacts = 0;
|
|
143
|
+
this.clipStepAcc = 0;
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
const rig = this.avatar.rig;
|
|
147
|
+
const posed = !this.groups && !(this.avatar.rigidGlb && !rig?.boneDriven);
|
|
148
|
+
if (!posed) {
|
|
149
|
+
this.clipStepAcc += dt;
|
|
150
|
+
const interval = state === 'run' ? 0.28 : 0.42;
|
|
151
|
+
if (this.clipStepAcc >= interval) {
|
|
152
|
+
this.clipStepAcc = 0;
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
if (this.pendingContacts <= 0)
|
|
158
|
+
return false;
|
|
159
|
+
this.pendingContacts--;
|
|
160
|
+
return this.walkWeight > 0.35;
|
|
161
|
+
}
|
|
162
|
+
playClip(state) {
|
|
163
|
+
if (!this.groups)
|
|
164
|
+
return;
|
|
165
|
+
const match = pickAvatarClip(this.groups, state);
|
|
166
|
+
// No Idle/Jump clip (common for Meshy walk-only packs) → freeze bind pose.
|
|
167
|
+
if (!match) {
|
|
168
|
+
if (!this.activeClip && !this.groups.some((g) => g.isPlaying))
|
|
169
|
+
return;
|
|
170
|
+
for (const g of this.groups) {
|
|
171
|
+
if (g.isPlaying)
|
|
172
|
+
g.stop();
|
|
173
|
+
g.reset();
|
|
174
|
+
}
|
|
175
|
+
this.activeClip = null;
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (this.activeClip === match && match.isPlaying)
|
|
179
|
+
return;
|
|
180
|
+
for (const g of this.groups) {
|
|
181
|
+
if (g === match)
|
|
182
|
+
continue;
|
|
183
|
+
if (g.isPlaying)
|
|
184
|
+
g.stop();
|
|
185
|
+
}
|
|
186
|
+
if (!match.isPlaying)
|
|
187
|
+
match.start(true);
|
|
188
|
+
this.activeClip = match;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=humanoid-animator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanoid-animator.js","sourceRoot":"","sources":["../src/humanoid-animator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,GAEf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,kFAAkF;AAClF,MAAM,kBAAkB,GAA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I,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAAE,OAAO;YACtE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAC5B,IAAI,CAAC,CAAC,SAAS;oBAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC1B,CAAC,CAAC,KAAK,EAAE,CAAC;YACZ,CAAC;YACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,OAAO;QACT,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,IAAI,KAAK,CAAC,SAAS;YAAE,OAAO;QAEzD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,KAAK,KAAK;gBAAE,SAAS;YAC1B,IAAI,CAAC,CAAC,SAAS;gBAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,SAAS;YAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HumanoidJoint } from './humanoid-locomotion';
|
|
2
|
+
/**
|
|
3
|
+
* Skeleton name → humanoid joint resolution (pure, no Babylon import).
|
|
4
|
+
*
|
|
5
|
+
* Rig naming is wildly inconsistent (Mixamo `LeftUpLeg`, Meshy `LeftLeg` for the
|
|
6
|
+
* shin, Tripo `L_Thigh`, Blender `thigh.L`), and spine chains are sometimes
|
|
7
|
+
* numbered downwards (`Hips → Spine02 → Spine01 → Spine`). So roles come from
|
|
8
|
+
* name patterns while ordering comes from the real hierarchy depth.
|
|
9
|
+
*/
|
|
10
|
+
export type BoneRole = 'hips' | 'spineish' | 'neck' | 'head' | 'shoulder' | 'upperArm' | 'foreArm' | 'hand' | 'thigh' | 'shin' | 'foot';
|
|
11
|
+
export type BoneSide = 'L' | 'R';
|
|
12
|
+
export interface BoneRef {
|
|
13
|
+
name: string;
|
|
14
|
+
/** Distance from the hierarchy root; used to order chains and skip helpers. */
|
|
15
|
+
depth: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function normalizeBoneName(name: string): string;
|
|
18
|
+
export declare function detectBoneSide(raw: string): BoneSide | null;
|
|
19
|
+
/** Strips side markers without eating letters ("LeftLeg" → "leg", "L_Thigh" → "thigh"). */
|
|
20
|
+
export declare function boneCoreName(raw: string): string;
|
|
21
|
+
export declare function detectBoneRole(core: string): BoneRole | null;
|
|
22
|
+
export interface ClassifiedBone<T extends BoneRef> {
|
|
23
|
+
ref: T;
|
|
24
|
+
role: BoneRole;
|
|
25
|
+
side: BoneSide | null;
|
|
26
|
+
}
|
|
27
|
+
export declare function classifyBone<T extends BoneRef>(ref: T): ClassifiedBone<T> | null;
|
|
28
|
+
/** Joints without which no believable walk cycle is possible. */
|
|
29
|
+
export declare const REQUIRED_JOINTS: HumanoidJoint[];
|
|
30
|
+
export declare function resolveHumanoidJoints<T extends BoneRef>(refs: readonly T[]): {
|
|
31
|
+
joints: Partial<Record<"head" | "hips" | "spine" | "chest" | "neck" | "shoulderL" | "shoulderR" | "upperArmL" | "upperArmR" | "foreArmL" | "foreArmR" | "handL" | "handR" | "thighL" | "thighR" | "shinL" | "shinR" | "footL" | "footR", T>>;
|
|
32
|
+
missing: ("head" | "hips" | "spine" | "chest" | "neck" | "shoulderL" | "shoulderR" | "upperArmL" | "upperArmR" | "foreArmL" | "foreArmR" | "handL" | "handR" | "thighL" | "thighR" | "shinL" | "shinR" | "footL" | "footR")[];
|
|
33
|
+
classified: ClassifiedBone<T>[];
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=humanoid-bone-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanoid-bone-names.d.ts","sourceRoot":"","sources":["../src/humanoid-bone-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;;;GAOG;AAEH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,UAAU,GACV,MAAM,GACN,MAAM,GACN,UAAU,GACV,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjC,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;CACf;AAoBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAE7C;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAM3D;AAED,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,UAMvC;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAK5D;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,OAAO;IAC/C,GAAG,EAAE,CAAC,CAAC;IACP,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAQhF;AAuCD,iEAAiE;AACjE,eAAO,MAAM,eAAe,EAAE,aAAa,EAK1C,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE;;;;EA8B1E"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/** Nodes that are containers or leaf markers, never animated joints. */
|
|
2
|
+
const IGNORED = /^(__root__|root|armature|scene|world|skeleton|humanoidrootnode|mesh_?\d*)(__a\d+)?$/;
|
|
3
|
+
const TIP = /(end|tip|nub|front|top)$/;
|
|
4
|
+
const ROLE_PATTERNS = [
|
|
5
|
+
[/^hips?\d*$|pelvis/, 'hips'],
|
|
6
|
+
[/spine|chest|torso|waist|abdomen|upperbody|ribcage/, 'spineish'],
|
|
7
|
+
[/neck/, 'neck'],
|
|
8
|
+
[/^head\d*$/, 'head'],
|
|
9
|
+
[/shoulder|clavicle|collar/, 'shoulder'],
|
|
10
|
+
[/forearm|lowerarm|elbow/, 'foreArm'],
|
|
11
|
+
[/upperarm|^arm\d*$|humerus/, 'upperArm'],
|
|
12
|
+
[/^hand\d*$|wrist/, 'hand'],
|
|
13
|
+
[/upleg|thigh|upperleg|femur/, 'thigh'],
|
|
14
|
+
[/lowerleg|^leg\d*$|calf|shin|knee|tibia/, 'shin'],
|
|
15
|
+
[/^foot\d*$|ankle/, 'foot'],
|
|
16
|
+
];
|
|
17
|
+
export function normalizeBoneName(name) {
|
|
18
|
+
return name.toLowerCase().replace(/^mixamorig[:_]?/, '');
|
|
19
|
+
}
|
|
20
|
+
export function detectBoneSide(raw) {
|
|
21
|
+
if (raw.includes('left'))
|
|
22
|
+
return 'L';
|
|
23
|
+
if (raw.includes('right'))
|
|
24
|
+
return 'R';
|
|
25
|
+
if (/(^|[_.\- ])l([_.\- ]|\d|$)/.test(raw))
|
|
26
|
+
return 'L';
|
|
27
|
+
if (/(^|[_.\- ])r([_.\- ]|\d|$)/.test(raw))
|
|
28
|
+
return 'R';
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
/** Strips side markers without eating letters ("LeftLeg" → "leg", "L_Thigh" → "thigh"). */
|
|
32
|
+
export function boneCoreName(raw) {
|
|
33
|
+
return raw
|
|
34
|
+
.replace(/left|right/g, '')
|
|
35
|
+
.replace(/(^|[_.\- ])[lr]([_.\- ])/g, '$1')
|
|
36
|
+
.replace(/(^|[_.\- ])[lr]$/, '')
|
|
37
|
+
.replace(/[^a-z0-9]/g, '');
|
|
38
|
+
}
|
|
39
|
+
export function detectBoneRole(core) {
|
|
40
|
+
for (const [pattern, role] of ROLE_PATTERNS) {
|
|
41
|
+
if (pattern.test(core))
|
|
42
|
+
return role;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
export function classifyBone(ref) {
|
|
47
|
+
const raw = normalizeBoneName(ref.name);
|
|
48
|
+
if (IGNORED.test(raw))
|
|
49
|
+
return null;
|
|
50
|
+
const core = boneCoreName(raw);
|
|
51
|
+
if (!core || TIP.test(core) || core.startsWith('toe'))
|
|
52
|
+
return null;
|
|
53
|
+
const role = detectBoneRole(core);
|
|
54
|
+
if (!role)
|
|
55
|
+
return null;
|
|
56
|
+
return { ref, role, side: detectBoneSide(raw) };
|
|
57
|
+
}
|
|
58
|
+
/** Shallowest wins: primary bones sit above twist/helper bones in the hierarchy. */
|
|
59
|
+
function pickPrimary(bones, role, side) {
|
|
60
|
+
let best = null;
|
|
61
|
+
for (const bone of bones) {
|
|
62
|
+
if (bone.role !== role || bone.side !== side)
|
|
63
|
+
continue;
|
|
64
|
+
if (!best ||
|
|
65
|
+
bone.ref.depth < best.ref.depth ||
|
|
66
|
+
(bone.ref.depth === best.ref.depth && bone.ref.name.length < best.ref.name.length)) {
|
|
67
|
+
best = bone;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return best?.ref ?? null;
|
|
71
|
+
}
|
|
72
|
+
const SIDED = [
|
|
73
|
+
['shoulderL', 'shoulder', 'L'],
|
|
74
|
+
['shoulderR', 'shoulder', 'R'],
|
|
75
|
+
['upperArmL', 'upperArm', 'L'],
|
|
76
|
+
['upperArmR', 'upperArm', 'R'],
|
|
77
|
+
['foreArmL', 'foreArm', 'L'],
|
|
78
|
+
['foreArmR', 'foreArm', 'R'],
|
|
79
|
+
['handL', 'hand', 'L'],
|
|
80
|
+
['handR', 'hand', 'R'],
|
|
81
|
+
['thighL', 'thigh', 'L'],
|
|
82
|
+
['thighR', 'thigh', 'R'],
|
|
83
|
+
['shinL', 'shin', 'L'],
|
|
84
|
+
['shinR', 'shin', 'R'],
|
|
85
|
+
['footL', 'foot', 'L'],
|
|
86
|
+
['footR', 'foot', 'R'],
|
|
87
|
+
];
|
|
88
|
+
/** Joints without which no believable walk cycle is possible. */
|
|
89
|
+
export const REQUIRED_JOINTS = [
|
|
90
|
+
'thighL',
|
|
91
|
+
'thighR',
|
|
92
|
+
'upperArmL',
|
|
93
|
+
'upperArmR',
|
|
94
|
+
];
|
|
95
|
+
export function resolveHumanoidJoints(refs) {
|
|
96
|
+
const bones = [];
|
|
97
|
+
for (const ref of refs) {
|
|
98
|
+
const classified = classifyBone(ref);
|
|
99
|
+
if (classified)
|
|
100
|
+
bones.push(classified);
|
|
101
|
+
}
|
|
102
|
+
const joints = {};
|
|
103
|
+
const assign = (joint, role, side) => {
|
|
104
|
+
const found = pickPrimary(bones, role, side);
|
|
105
|
+
if (found)
|
|
106
|
+
joints[joint] = found;
|
|
107
|
+
};
|
|
108
|
+
assign('hips', 'hips', null);
|
|
109
|
+
assign('neck', 'neck', null);
|
|
110
|
+
assign('head', 'head', null);
|
|
111
|
+
for (const [joint, role, side] of SIDED)
|
|
112
|
+
assign(joint, role, side);
|
|
113
|
+
// Depth, not the number in the name, decides which vertebra is the chest:
|
|
114
|
+
// Meshy exports `Hips → Spine02 → Spine01 → Spine`, Mixamo does the reverse.
|
|
115
|
+
const spineChain = bones
|
|
116
|
+
.filter((b) => b.role === 'spineish')
|
|
117
|
+
.sort((a, b) => a.ref.depth - b.ref.depth || a.ref.name.length - b.ref.name.length);
|
|
118
|
+
if (spineChain.length) {
|
|
119
|
+
joints.spine = spineChain[0].ref;
|
|
120
|
+
if (spineChain.length > 1)
|
|
121
|
+
joints.chest = spineChain[spineChain.length - 1].ref;
|
|
122
|
+
}
|
|
123
|
+
const missing = REQUIRED_JOINTS.filter((joint) => !joints[joint]);
|
|
124
|
+
return { joints, missing, classified: bones };
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=humanoid-bone-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanoid-bone-names.js","sourceRoot":"","sources":["../src/humanoid-bone-names.ts"],"names":[],"mappings":"AAgCA,wEAAwE;AACxE,MAAM,OAAO,GAAG,qFAAqF,CAAC;AACtG,MAAM,GAAG,GAAG,0BAA0B,CAAC;AAEvC,MAAM,aAAa,GAAyB;IAC1C,CAAC,mBAAmB,EAAE,MAAM,CAAC;IAC7B,CAAC,mDAAmD,EAAE,UAAU,CAAC;IACjE,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,WAAW,EAAE,MAAM,CAAC;IACrB,CAAC,0BAA0B,EAAE,UAAU,CAAC;IACxC,CAAC,wBAAwB,EAAE,SAAS,CAAC;IACrC,CAAC,2BAA2B,EAAE,UAAU,CAAC;IACzC,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAC3B,CAAC,4BAA4B,EAAE,OAAO,CAAC;IACvC,CAAC,wCAAwC,EAAE,MAAM,CAAC;IAClD,CAAC,iBAAiB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,GAAG,CAAC;IACrC,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,GAAG,CAAC;IACtC,IAAI,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACvD,IAAI,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACvD,OAAO,IAAI,CAAC;AACd,CAA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I,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtF,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QACtB,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACjC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAClF,CAAC;IAED,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Procedural humanoid locomotion (pure math, no Babylon import).
|
|
3
|
+
*
|
|
4
|
+
* Angle convention — every value below is expressed in *character space*, so it
|
|
5
|
+
* stays correct no matter how the GLB skeleton is oriented:
|
|
6
|
+
* pitch > 0 → distal end of the bone swings forward (character +Z)
|
|
7
|
+
* yaw > 0 → distal end swings toward the character's left
|
|
8
|
+
* roll > 0 → distal end tilts toward the character's right
|
|
9
|
+
*
|
|
10
|
+
* `humanoid-rig.ts` converts these into per-bone parent-space rotations.
|
|
11
|
+
*/
|
|
12
|
+
export declare const HUMANOID_JOINT_INDEX: {
|
|
13
|
+
readonly hips: 0;
|
|
14
|
+
readonly spine: 1;
|
|
15
|
+
readonly chest: 2;
|
|
16
|
+
readonly neck: 3;
|
|
17
|
+
readonly head: 4;
|
|
18
|
+
readonly shoulderL: 5;
|
|
19
|
+
readonly shoulderR: 6;
|
|
20
|
+
readonly upperArmL: 7;
|
|
21
|
+
readonly upperArmR: 8;
|
|
22
|
+
readonly foreArmL: 9;
|
|
23
|
+
readonly foreArmR: 10;
|
|
24
|
+
readonly handL: 11;
|
|
25
|
+
readonly handR: 12;
|
|
26
|
+
readonly thighL: 13;
|
|
27
|
+
readonly thighR: 14;
|
|
28
|
+
readonly shinL: 15;
|
|
29
|
+
readonly shinR: 16;
|
|
30
|
+
readonly footL: 17;
|
|
31
|
+
readonly footR: 18;
|
|
32
|
+
};
|
|
33
|
+
export type HumanoidJoint = keyof typeof HUMANOID_JOINT_INDEX;
|
|
34
|
+
export declare const HUMANOID_JOINTS: HumanoidJoint[];
|
|
35
|
+
export declare const HUMANOID_JOINT_COUNT: number;
|
|
36
|
+
/** Additive pose buffer — zero allocation per frame. */
|
|
37
|
+
export declare class HumanoidPose {
|
|
38
|
+
/** [pitch, yaw, roll] per joint, radians. */
|
|
39
|
+
readonly angles: Float32Array<ArrayBuffer>;
|
|
40
|
+
/** Vertical body bob in metres (applied to the avatar root, never to bones). */
|
|
41
|
+
bob: number;
|
|
42
|
+
reset(): void;
|
|
43
|
+
add(joint: HumanoidJoint, pitch: number, yaw: number, roll: number, weight?: number): void;
|
|
44
|
+
pitch(joint: HumanoidJoint): number;
|
|
45
|
+
yaw(joint: HumanoidJoint): number;
|
|
46
|
+
roll(joint: HumanoidJoint): number;
|
|
47
|
+
}
|
|
48
|
+
export interface GaitParams {
|
|
49
|
+
/** Cycles per second at the reference speed (one cycle = two steps). */
|
|
50
|
+
frequency: number;
|
|
51
|
+
/** Thigh forward/back amplitude. */
|
|
52
|
+
thighSwing: number;
|
|
53
|
+
/** Peak knee flexion at mid-swing. */
|
|
54
|
+
kneeSwing: number;
|
|
55
|
+
/** Small knee flexion while the foot carries the body. */
|
|
56
|
+
kneeStance: number;
|
|
57
|
+
/** How much the ankle counter-rotates to keep the sole level (0..1). */
|
|
58
|
+
footLevel: number;
|
|
59
|
+
/** Extra plantar flexion (toes down) at toe-off. */
|
|
60
|
+
toeOff: number;
|
|
61
|
+
armSwing: number;
|
|
62
|
+
elbowBase: number;
|
|
63
|
+
elbowSwing: number;
|
|
64
|
+
/** Constant inward roll so arms stay close to the body. */
|
|
65
|
+
armTuck: number;
|
|
66
|
+
shoulderFollow: number;
|
|
67
|
+
hipsPitch: number;
|
|
68
|
+
hipsYaw: number;
|
|
69
|
+
hipsRoll: number;
|
|
70
|
+
/** Torso counter-rotation against the pelvis. */
|
|
71
|
+
chestYaw: number;
|
|
72
|
+
chestRoll: number;
|
|
73
|
+
/** Forward lean, split between spine and chest. */
|
|
74
|
+
lean: number;
|
|
75
|
+
headYaw: number;
|
|
76
|
+
bob: number;
|
|
77
|
+
}
|
|
78
|
+
export declare const WALK_GAIT: GaitParams;
|
|
79
|
+
export declare const RUN_GAIT: GaitParams;
|
|
80
|
+
/** Cross-fade walk → run in place (same phase, so the blend never snaps). */
|
|
81
|
+
export declare function lerpGait(out: GaitParams, a: GaitParams, b: GaitParams, t: number): GaitParams;
|
|
82
|
+
export declare function cloneGait(source: GaitParams): GaitParams;
|
|
83
|
+
/**
|
|
84
|
+
* Full walk/run cycle at normalized `phase` (0..1, wraps seamlessly).
|
|
85
|
+
* Left leg leads at phase 0.25, right leg at 0.75.
|
|
86
|
+
*/
|
|
87
|
+
export declare function writeGaitPose(pose: HumanoidPose, phase: number, g: GaitParams, weight: number): void;
|
|
88
|
+
/** Calm standing pose: planted feet, slow breathing, a touch of sway. */
|
|
89
|
+
export declare function writeIdlePose(pose: HumanoidPose, time: number, weight: number): void;
|
|
90
|
+
export declare function writeAirPose(pose: HumanoidPose, rising: boolean, weight: number): void;
|
|
91
|
+
export declare function writeSlidePose(pose: HumanoidPose, weight: number): void;
|
|
92
|
+
/** Exponential smoothing that is stable for any dt. */
|
|
93
|
+
export declare function approach(current: number, target: number, tau: number, dt: number): number;
|
|
94
|
+
/**
|
|
95
|
+
* Cadence locked to real speed so the feet never scrub the floor:
|
|
96
|
+
* frequency scales linearly with velocity, clamped to a believable range.
|
|
97
|
+
*/
|
|
98
|
+
export declare function gaitFrequency(speed: number, referenceSpeed: number, gait: GaitParams): number;
|
|
99
|
+
/** How many foot contacts happen when the cycle advances by `advance` from `prevPhase`. */
|
|
100
|
+
export declare function footContacts(prevPhase: number, advance: number): number;
|
|
101
|
+
//# sourceMappingURL=humanoid-locomotion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanoid-locomotion.d.ts","sourceRoot":"","sources":["../src/humanoid-locomotion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;CAoBvB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAE9D,eAAO,MAAM,eAAe,EAAwC,aAAa,EAAE,CAAC;AACpF,eAAO,MAAM,oBAAoB,QAAyB,CAAC;AAI3D,wDAAwD;AACxD,qBAAa,YAAY;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,4BAA8C;IAC7D,gFAAgF;IAChF,GAAG,SAAK;IAER,KAAK;IAKL,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAI;IAQ9E,KAAK,CAAC,KAAK,EAAE,aAAa;IAI1B,GAAG,CAAC,KAAK,EAAE,aAAa;IAIxB,IAAI,CAAC,KAAK,EAAE,aAAa;CAG1B;AAED,MAAM,WAAW,UAAU;IACzB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EA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