Skip to content

Commit b097278

Browse files
author
Avaer Kazmer
committed
More VRArmIK flipZ handling
1 parent ba30544 commit b097278

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vrarmik/VRArmIK.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,11 @@ function toPositiveEulerAngle(n)
397397
if (this.arm.wrist2 !== null)
398398
this.setWrist2Rotation(new Quaternion().multiplyQuaternions(Quaternion.AngleAxis(elbowTargetAngle * .8, this.armDirection.clone().applyQuaternion(this.lowerArmRotation)), this.lowerArmRotation));
399399
}
400-
this.setHandRotation(this.target.rotation);
400+
const targetRotation = this.target.rotation;
401+
if (PoseManager.Instance.flipZ) {
402+
targetRotation.premultiply(new Quaternion().setFromAxisAngle(new Vector3(0, 1, 0), Math.PI))
403+
}
404+
this.setHandRotation(targetRotation);
401405
}
402406

403407
removeShoulderRightRotation(direction) {

0 commit comments

Comments
 (0)