roamwright 0.61.8 → 0.61.9

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.
@@ -199,8 +199,14 @@ export function createBipedStride({ rig, foot, pace, ground }) {
199
199
  sinL = Math.sin(lean),
200
200
  cosL = Math.cos(lean),
201
201
  hipAt = rig.hipHeight * sinL + hipZ, // the hips forward of the point between the feet; a stride is taken under them
202
- landing = hipAt * go + (v < 0 ? -sweep : sweep) / 2,
203
- drift = ((v < 0 ? sweep : -sweep) * (1 - duty)) / duty,
202
+ // a walker's foot is planted as far ahead of the hips as it will leave the ground behind them; a runner's lands nearer
203
+ // under them, the knee still bent, and pushes off further behind (`runLanding`: the share of the foot's time on the ground
204
+ // spent ahead of the hips at a full run), so the leg never reaches out straight before the foot comes down
205
+ plantAhead = lerp(0.5, pace.runLanding ?? 0.5, run),
206
+ landing = hipAt * go + (v < 0 ? -sweep : sweep) * plantAhead,
207
+ // the swinging foot is drawn back to meet the ground moving as the ground does; over a run's long flight that pull, at
208
+ // full strength, first throws the foot far out ahead of where it lands (`runRetract`: the share of it kept at a full run)
209
+ drift = (((v < 0 ? sweep : -sweep) * (1 - duty)) / duty) * lerp(1, pace.runRetract ?? 1, run),
204
210
  gone = (actor.fwd * deltaSeconds) / h,
205
211
  leftFirst = Math.abs(stanceL - feet[0]) >= Math.abs(stanceR - feet[1]); // of two feet out of place, the one further out steps first
206
212
  footAt(
@@ -74,6 +74,8 @@ const FIGURE_STRIDE = {
74
74
  runBob: 0.03,
75
75
  walkLift: 0.085,
76
76
  runLift: 0.4,
77
+ runLanding: 0.3,
78
+ runRetract: 0.35,
77
79
  hipResponse: 18,
78
80
  idleRate: 1.4,
79
81
  runLean: 0.2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roamwright",
3
- "version": "0.61.8",
3
+ "version": "0.61.9",
4
4
  "description": "A procedural worldbuilding engine built on top of Three.js. Generate landscapes with rivers and changing weather, animate crowds, and explore on foot or in flight.",
5
5
  "keywords": [
6
6
  "threejs",