@adatechnology/game-characters-three 0.10.0 → 0.11.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/dist/index.global.js +11 -3
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.global.js
CHANGED
|
@@ -11631,6 +11631,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
11631
11631
|
parent.add(mesh2);
|
|
11632
11632
|
return mesh2;
|
|
11633
11633
|
};
|
|
11634
|
+
const TRIGGER_CURL = 1.22;
|
|
11634
11635
|
const hands = [];
|
|
11635
11636
|
rig.arms.forEach((arm, index) => {
|
|
11636
11637
|
const el = arm.el;
|
|
@@ -12031,6 +12032,13 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
12031
12032
|
if (run || fall > 0) return;
|
|
12032
12033
|
root.updateMatrixWorld(true);
|
|
12033
12034
|
armReach.apply(targets, view);
|
|
12035
|
+
for (const hand of hands) {
|
|
12036
|
+
const curl = hand.side < 0 ? targets?.fingers?.index : targets?.fingersL?.index;
|
|
12037
|
+
if (curl === void 0 || !hand.fingers[1]) continue;
|
|
12038
|
+
const k = TRIGGER_CURL * Math.min(1, Math.max(0, curl));
|
|
12039
|
+
hand.fingers[0].rotation.z = -hand.side * k * 0.9;
|
|
12040
|
+
hand.fingers[1].rotation.z = -hand.side * k * 1.1;
|
|
12041
|
+
}
|
|
12034
12042
|
},
|
|
12035
12043
|
on(_type, listener) {
|
|
12036
12044
|
listeners.add(listener);
|
|
@@ -12881,7 +12889,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
12881
12889
|
const channelPose = newPose(THREE);
|
|
12882
12890
|
const mixed = newPose(THREE);
|
|
12883
12891
|
const dropped = newPose(THREE);
|
|
12884
|
-
|
|
12892
|
+
const indexCurl = { R: void 0, L: void 0 };
|
|
12885
12893
|
const bone = createTwoBone(THREE);
|
|
12886
12894
|
const shoulder = new THREE.Vector3();
|
|
12887
12895
|
const wristAt = new THREE.Vector3();
|
|
@@ -12945,7 +12953,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
12945
12953
|
arm.anchor.quaternion.copy(pose.q);
|
|
12946
12954
|
arm.anchor.scale.setScalar(scale);
|
|
12947
12955
|
arm.hand.setGrip(pose.grip);
|
|
12948
|
-
arm.hand.setIndex(arm.side
|
|
12956
|
+
arm.hand.setIndex(indexCurl[arm.side]);
|
|
12949
12957
|
arm.joints.shoulder.copy(shoulder);
|
|
12950
12958
|
arm.joints.elbow.copy(bone.joint);
|
|
12951
12959
|
arm.joints.wrist.copy(bone.end);
|
|
@@ -13031,7 +13039,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
|
|
|
13031
13039
|
desired.p.add(bobOffset);
|
|
13032
13040
|
}
|
|
13033
13041
|
modeOf(mode, arm);
|
|
13034
|
-
|
|
13042
|
+
indexCurl[side] = mode === "target" ? side === "R" ? targets?.fingers?.index : targets?.fingersL?.index : void 0;
|
|
13035
13043
|
arm.blend = blendSeconds <= 0 ? 1 : Math.min(1, arm.blend + dt / blendSeconds);
|
|
13036
13044
|
if (arm.blend >= 1) copyPose(arm.shown, desired);
|
|
13037
13045
|
else mixPose(THREE, arm.shown, arm.from, desired, ease2(arm.blend));
|