@adatechnology/game-characters-three 0.8.1 → 0.9.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
|
@@ -1309,9 +1309,9 @@ var createPlayerAvatar = (THREE, options = {}) => {
|
|
|
1309
1309
|
const pivot = new THREE.Vector3(0, HIP_HEIGHT, 0).applyEuler(tilt.rotation);
|
|
1310
1310
|
tilt.position.set(0, hip, 0).sub(pivot);
|
|
1311
1311
|
};
|
|
1312
|
-
const placeBody = (progress) => {
|
|
1312
|
+
const placeBody = (progress, forward) => {
|
|
1313
1313
|
const fk = progress * progress * (3 - 2 * progress);
|
|
1314
|
-
const flip = fract(cycles * 1.7) >= 0.5 ? 1 : 0;
|
|
1314
|
+
const flip = forward === void 0 ? fract(cycles * 1.7) >= 0.5 ? 1 : 0 : forward ? 1 : 0;
|
|
1315
1315
|
tilt.rotation.set((-DOWN.tilt + flip * 2 * DOWN.tilt) * fk, 0, Math.sin(cycles * 7) * DOWN.roll * fk, "XYZ");
|
|
1316
1316
|
const hip = new THREE.Vector3(0, HIP_HEIGHT, 0);
|
|
1317
1317
|
const target = new THREE.Vector3(0, DOWN.hipY, -DOWN.hipZ + flip * DOWN.hipZFlip);
|
|
@@ -1402,7 +1402,7 @@ var createPlayerAvatar = (THREE, options = {}) => {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
1404
|
if (seat?.pose === "lie") layBody(seat.hip);
|
|
1405
|
-
else placeBody(fall);
|
|
1405
|
+
else placeBody(fall, state.fallForward);
|
|
1406
1406
|
stepClip(dt, down, Boolean(state.crouch || seat));
|
|
1407
1407
|
const cascadeDt = run && !run.clip.loop ? dt * clipCascade : dt;
|
|
1408
1408
|
const targetWithoutBob = rig.fig.position.y - bob;
|
|
@@ -1548,7 +1548,8 @@ var toRoomAvatar = (avatar, options = {}) => {
|
|
|
1548
1548
|
...state.itemUse !== void 0 ? { itemUse: state.itemUse } : {},
|
|
1549
1549
|
...state.push !== void 0 ? { push: state.push } : {},
|
|
1550
1550
|
...state.seat !== void 0 ? { seat: state.seat } : {},
|
|
1551
|
-
...state.door !== void 0 ? { door: state.door } : {}
|
|
1551
|
+
...state.door !== void 0 ? { door: state.door } : {},
|
|
1552
|
+
...state.fallForward !== void 0 ? { fallForward: state.fallForward } : {}
|
|
1552
1553
|
});
|
|
1553
1554
|
readFeet();
|
|
1554
1555
|
},
|