@ikijs/editor 0.3.0 → 0.3.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 +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2060,14 +2060,18 @@ function bakeHairBackTurnWarp(mesh, parameter) {
|
|
|
2060
2060
|
const radius = halfWidth * HAIR_BACK_BEND_RADIUS_FACTOR;
|
|
2061
2061
|
const bulge = HAIR_BACK_FAR_BULGE * halfWidth;
|
|
2062
2062
|
const DEG_TO_RAD = Math.PI / 180;
|
|
2063
|
-
const keyforms =
|
|
2063
|
+
const keyforms = HEAD_TURN_STOPS.map((deg) => {
|
|
2064
2064
|
const theta = deg * DEG_TO_RAD;
|
|
2065
2065
|
const s = Math.sign(deg);
|
|
2066
|
+
const turnFraction = Math.abs(deg) / HEAD_TURN_MAX_DEG;
|
|
2067
|
+
const fullTheta = s * HEAD_TURN_MAX_DEG * DEG_TO_RAD;
|
|
2068
|
+
const bulgeAtStop = bulge * deg / HEAD_TURN_MAX_DEG;
|
|
2066
2069
|
const offsets = [];
|
|
2067
2070
|
for (let i = 0; i < mesh.vertices.length; i += 2) {
|
|
2068
2071
|
const x = mesh.vertices[i];
|
|
2069
2072
|
const far = Math.max(0, -s * x / halfWidth);
|
|
2070
|
-
|
|
2073
|
+
const bend = far > 0 ? turnFraction * pinnedCylinderBend(x, radius, fullTheta) : pinnedCylinderBend(x, radius, theta);
|
|
2074
|
+
offsets.push(bend - bulgeAtStop * far, 0);
|
|
2071
2075
|
}
|
|
2072
2076
|
return { value: deg, offsets };
|
|
2073
2077
|
});
|