Fix the offsets of arms from controllers (#826)

This commit is contained in:
Erimel authored and GitHub committed 2023-08-19 18:04:21 +03:00
1 parent f3cefdcc61
commit 5211d340d2
1 file changed
+8 -2
@@ -1199,12 +1199,16 @@ public class HumanSkeleton {
.getLocalTransform()
.setTranslation(offset);
case LEFT_UPPER_ARM -> {
if (!isTrackingLeftArmFromController()) {
if (isTrackingLeftArmFromController()) {
leftElbowNode.getLocalTransform().setTranslation(Vector3.Companion.getNULL());
} else {
leftElbowNode.getLocalTransform().setTranslation(offset);
}
}
case RIGHT_UPPER_ARM -> {
if (!isTrackingRightArmFromController()) {
if (isTrackingRightArmFromController()) {
rightElbowNode.getLocalTransform().setTranslation(Vector3.Companion.getNULL());
} else {
rightElbowNode.getLocalTransform().setTranslation(offset);
}
}
@@ -1254,6 +1258,8 @@ public class HumanSkeleton {
humanPoseManager.computeNodeOffset(BoneType.RIGHT_UPPER_ARM);
humanPoseManager.computeNodeOffset(BoneType.LEFT_LOWER_ARM);
humanPoseManager.computeNodeOffset(BoneType.RIGHT_LOWER_ARM);
humanPoseManager.computeNodeOffset(BoneType.LEFT_HAND);
humanPoseManager.computeNodeOffset(BoneType.RIGHT_HAND);
}
public TransformNode getTailNodeOfBone(BoneType bone) {