@ikijs/editor 0.30.0 → 0.30.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.
package/dist/index.js CHANGED
@@ -2309,7 +2309,7 @@ var import_format3 = require("@ikijs/format");
2309
2309
  var SWAY_RANGE = 20;
2310
2310
  var SWAY_CURVE = 1.4;
2311
2311
  var HAIR_HANG = 0.35;
2312
- var LOCK_HANG_SPAN = 1;
2312
+ var LOCK_HANG = 0.45;
2313
2313
  var Z_STOPS = [-30, 0, 30];
2314
2314
  function localWarp(parameter, mesh, box, values, f) {
2315
2315
  const pts = meshPoints(mesh, box);
@@ -2490,8 +2490,8 @@ function hairHangWeight(pivotY, bottom) {
2490
2490
  if (bottom >= pivotY) return () => 0;
2491
2491
  return (y) => HAIR_HANG * smoothstep(pivotY, bottom, y);
2492
2492
  }
2493
- function lockHangWeight(pivotY, bottom, hh) {
2494
- return hairHangWeight(pivotY, Math.min(bottom, pivotY - LOCK_HANG_SPAN * hh));
2493
+ function lockHangWeight(free) {
2494
+ return (y) => LOCK_HANG * free(y);
2495
2495
  }
2496
2496
  var round1 = (v) => roundTo(v, 0.1);
2497
2497
 
@@ -6880,14 +6880,18 @@ function buildPart(spec, b, order, frame, byRole, plan, frontGrid, lips) {
6880
6880
  break;
6881
6881
  case "hair_side_L":
6882
6882
  case "hair_side_R": {
6883
- const attach = {
6884
- box: box("hair_front"),
6885
- weight: sideRootBlend(frame, spec.role, b).weight
6886
- };
6883
+ const { rootEnd, weight } = sideRootBlend(frame, spec.role, b);
6884
+ const attach = { box: box("hair_front"), weight };
6887
6885
  warps.push(
6888
6886
  lockSway(import_format12.StandardParameter.HairSwayX, mesh, b, swayAmp, attach),
6889
6887
  lockSway(import_format12.StandardParameter.HairSwayZ, mesh, b, swayAmp, attach),
6890
- tiltHang(mesh, b, pivot, lockHangWeight(frame.chinY, b.y0, hh))
6888
+ // Under a roll it swings about its root, where it leaves the bangs.
6889
+ tiltHang(
6890
+ mesh,
6891
+ b,
6892
+ [(b.x0 + b.x1) / 2, rootEnd],
6893
+ lockHangWeight(weight)
6894
+ )
6891
6895
  );
6892
6896
  break;
6893
6897
  }