Skip to content

Commit

Permalink
Fix the offsets of arms from controllers (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erimelowo authored Aug 19, 2023
1 parent f3cefdc commit 5211d34
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1199,12 +1199,16 @@ public void updateNodeOffset(BoneType nodeOffset, Vector3 offset) {
.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);
}
}
Expand Down Expand Up @@ -1254,6 +1258,8 @@ private void computeDependentArmOffsets() {
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) {
Expand Down

0 comments on commit 5211d34

Please sign in to comment.