mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-30 05:42:46 -08:00
Fix height calculation and targetHeight order (#705)
This commit is contained in:
1 parent
309e78e47c
commit
760f775d60
2 files changed
+16
-14
No files matched your search
@@ -372,9 +372,11 @@ class AutoBone(server: VRServer) {
|
||||
skeleton1.setLegTweaksEnabled(false)
|
||||
skeleton2.setLegTweaksEnabled(false)
|
||||
|
||||
val intermediateOffsets = EnumMap(
|
||||
offsets
|
||||
)
|
||||
val intermediateOffsets = EnumMap(offsets)
|
||||
// If target height isn't specified, auto-detect
|
||||
if (targetHeight < 0f) {
|
||||
targetHeight = getTargetHeight(frames)
|
||||
}
|
||||
val trainingStep = AutoBoneTrainingStep(
|
||||
targetHeight,
|
||||
skeleton1,
|
||||
@@ -383,10 +385,6 @@ class AutoBone(server: VRServer) {
|
||||
intermediateOffsets
|
||||
)
|
||||
|
||||
// If target height isn't specified, auto-detect
|
||||
if (targetHeight < 0f) {
|
||||
targetHeight = getTargetHeight(frames)
|
||||
}
|
||||
val errorStats = StatsCalculator()
|
||||
|
||||
// Epoch loop, each epoch is one full iteration over the full dataset
|
||||
|
||||
+11
-7
@@ -35,7 +35,7 @@ public class SkeletonConfigManager {
|
||||
|
||||
protected final boolean autoUpdateOffsets;
|
||||
protected HumanPoseManager humanPoseManager;
|
||||
protected float userHeight;
|
||||
protected float userHeight = calculateUserHeight();
|
||||
static final float FLOOR_OFFSET = 0.05f;
|
||||
|
||||
public SkeletonConfigManager(boolean autoUpdateOffsets) {
|
||||
@@ -107,12 +107,7 @@ public class SkeletonConfigManager {
|
||||
}
|
||||
|
||||
// Re-calculate user height
|
||||
userHeight = getOffset(SkeletonConfigOffsets.NECK)
|
||||
+ getOffset(SkeletonConfigOffsets.CHEST)
|
||||
+ getOffset(SkeletonConfigOffsets.WAIST)
|
||||
+ getOffset(SkeletonConfigOffsets.HIP)
|
||||
+ getOffset(SkeletonConfigOffsets.UPPER_LEG)
|
||||
+ getOffset(SkeletonConfigOffsets.LOWER_LEG);
|
||||
userHeight = calculateUserHeight();
|
||||
}
|
||||
|
||||
public void setOffset(SkeletonConfigOffsets config, Float newValue) {
|
||||
@@ -128,6 +123,15 @@ public class SkeletonConfigManager {
|
||||
return val != null ? val : config.defaultValue;
|
||||
}
|
||||
|
||||
private float calculateUserHeight() {
|
||||
return getOffset(SkeletonConfigOffsets.NECK)
|
||||
+ getOffset(SkeletonConfigOffsets.CHEST)
|
||||
+ getOffset(SkeletonConfigOffsets.WAIST)
|
||||
+ getOffset(SkeletonConfigOffsets.HIP)
|
||||
+ getOffset(SkeletonConfigOffsets.UPPER_LEG)
|
||||
+ getOffset(SkeletonConfigOffsets.LOWER_LEG);
|
||||
}
|
||||
|
||||
public float getUserHeightFromOffsets() {
|
||||
return userHeight;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user