Added config for all body parts

This commit is contained in:
Eiren Rain committed 2021-05-23 11:57:08 +03:00
1 parent c5ffe0c2e8
commit b0e1c56dcc
3 files changed
+53 -15

No files matched your search

@@ -69,7 +69,7 @@ public class HumanSekeletonWithLegs extends HumanSkeleonWithWaist {
lat.setStatus(TrackerStatus.OK);
rat.setStatus(TrackerStatus.OK);
hipsWidth = server.config.getFloat("body.hipsWidth", hipsWidth);
hipsLength = server.config.getFloat("body.hipsLength", hipsLength);
hipsLength = server.config.getFloat("body.hipLength", hipsLength);
ankleLength = server.config.getFloat("body.ankleLength", ankleLength);
waistNode.attachChild(leftHipNode);
@@ -91,8 +91,8 @@ public class HumanSekeletonWithLegs extends HumanSkeleonWithWaist {
rightAnkleNode.localTransform.setTranslation(0, -ankleLength, 0);
configMap.put("Hips width", hipsWidth);
configMap.put("Hips length", hipsLength);
configMap.put("Legs length", ankleLength);
configMap.put("Hip length", hipsLength);
configMap.put("Ankle length", ankleLength);
}
@Override
@@ -105,13 +105,13 @@ public class HumanSekeletonWithLegs extends HumanSkeleonWithWaist {
leftHipNode.localTransform.setTranslation(hipsWidth / 2, 0, 0);
rightHipNode.localTransform.setTranslation(-hipsWidth / 2, 0, 0);
break;
case "Hips length":
case "Hip length":
hipsLength = newLength;
server.config.setProperty("body.hipsLength", hipsLength);
server.config.setProperty("body.hipLength", hipsLength);
leftKneeNode.localTransform.setTranslation(0, -hipsLength, 0);
rightKneeNode.localTransform.setTranslation(0, -hipsLength, 0);
break;
case "Legs length":
case "Ankle length":
ankleLength = newLength;
server.config.setProperty("body.ankleLength", ankleLength);
leftAnkleNode.localTransform.setTranslation(0, -ankleLength, 0);
@@ -33,6 +33,7 @@ public class HumanSkeleonWithWaist extends HumanSkeleton {
protected final TransformNode chestNode = new TransformNode("Chest", false);
protected final TransformNode trackerWaistNode = new TransformNode("Waist-Tracker", false);
protected float chestDistance = 0.42f;
/**
* Distance from eyes to waist
*/
@@ -67,6 +68,7 @@ public class HumanSkeleonWithWaist extends HumanSkeleton {
cwt.setStatus(TrackerStatus.OK);
headShift = server.config.getFloat("body.headShift", headShift);
neckLength = server.config.getFloat("body.neckLength", neckLength);
chestDistance = server.config.getFloat("body.chestDistance", chestDistance);
waistDistance = server.config.getFloat("body.waistDistance", waistDistance);
trackerWaistDistance = server.config.getFloat("body.trackerWaistDistance", trackerWaistDistance);
// Build skeleton
@@ -77,16 +79,17 @@ public class HumanSkeleonWithWaist extends HumanSkeleton {
neckNode.localTransform.setTranslation(0, -neckLength, 0);
neckNode.attachChild(chestNode);
chestNode.localTransform.setTranslation(0, -waistDistance / 2, 0);
chestNode.localTransform.setTranslation(0, -chestDistance, 0);
chestNode.attachChild(waistNode);
waistNode.localTransform.setTranslation(0, -waistDistance / 2, 0);
waistNode.localTransform.setTranslation(0, -(waistDistance - chestDistance), 0);
chestNode.attachChild(trackerWaistNode);
trackerWaistNode.localTransform.setTranslation(0, -(trackerWaistDistance - waistDistance / 2), 0);
trackerWaistNode.localTransform.setTranslation(0, -(trackerWaistDistance - chestDistance), 0);
configMap.put("Head", headShift);
configMap.put("Neck", neckLength);
configMap.put("Chest", chestDistance);
configMap.put("Waist", waistDistance);
configMap.put("Virtual waist", trackerWaistDistance);
}
@@ -113,14 +116,19 @@ public class HumanSkeleonWithWaist extends HumanSkeleton {
case "Waist":
waistDistance = newLength;
server.config.setProperty("body.waistDistance", waistDistance);
chestNode.localTransform.setTranslation(0, -waistDistance / 2, 0);
waistNode.localTransform.setTranslation(0, -waistDistance / 2, 0);
trackerWaistNode.localTransform.setTranslation(0, -(trackerWaistDistance - waistDistance / 2), 0);
waistNode.localTransform.setTranslation(0, -(waistDistance - chestDistance), 0);
break;
case "Chest":
chestDistance = newLength;
server.config.setProperty("body.chestDistance", chestDistance);
chestNode.localTransform.setTranslation(0, -chestDistance, 0);
waistNode.localTransform.setTranslation(0, -(waistDistance - chestDistance), 0);
trackerWaistNode.localTransform.setTranslation(0, -(trackerWaistDistance - chestDistance), 0);
break;
case "Virtual waist":
trackerWaistDistance = newLength;
server.config.setProperty("body.trackerWaistDistance", trackerWaistDistance);
trackerWaistNode.localTransform.setTranslation(0, -(trackerWaistDistance - waistDistance / 2), 0);
trackerWaistNode.localTransform.setTranslation(0, -(trackerWaistDistance - chestDistance), 0);
break;
}
}