finger curl mounting reset

This commit is contained in:
Erimel committed 2026-09-08 17:54:38 -04:00
1 parent 94fa3f54a3
commit 2f120cfff7
13 files changed
+59 -86

No files matched your search

@@ -92,8 +92,6 @@ data class TapDetectionConfig(
data class ResetsConfig(
/** Always reset mounting for feet */
val resetMountingFeet: Boolean = false,
/** Always reset mounting for fingers */
val resetMountingFingers: Boolean = false,
/** Reset mode used for the arms */
val armsResetMode: ArmsResetMode = ArmsResetMode.BACK,
/** Yaw reset smoothing time in seconds */
@@ -101,7 +99,7 @@ data class ResetsConfig(
/** Save automatic mounting reset calibration */
val saveMountingReset: Boolean = false,
/** Reset a positional tracker's attitude full reset */
val resetPositionalHeadAttitude: Boolean = false, // TODO
val resetPositionalHeadAttitude: Boolean = false,
/** Used as preferred mounting method and tracking checklist */
val lastMountingMethod: MountingMethod = MountingMethod.POSE,
)
@@ -129,7 +127,7 @@ fun defaultKeybinds(): List<KeybindConfig> = listOf(
data class SkeletonTogglesConfig(
val floorClip: Boolean = true,
val skatingCorrection: Boolean = true,
val toeSnap: Boolean = true, // TODO this was false in main
val toeSnap: Boolean = true, // TODO this was false in main, evaluate if we want it on by default
val footPlant: Boolean = true,
val mocapMode: Boolean = false,
val useTrackerPositions: Boolean = true,
@@ -48,6 +48,13 @@ object ResetBodyParts {
BodyPart.LEFT_LITTLE_DISTAL,
)
val LEFT_FINGERS_NO_THUMB = LEFT_FINGERS -
setOf(
BodyPart.LEFT_THUMB_METACARPAL,
BodyPart.LEFT_THUMB_PROXIMAL,
BodyPart.LEFT_THUMB_DISTAL,
)
val RIGHT_FINGERS = setOf(
BodyPart.RIGHT_THUMB_METACARPAL,
BodyPart.RIGHT_THUMB_PROXIMAL,
@@ -66,19 +73,24 @@ object ResetBodyParts {
BodyPart.RIGHT_LITTLE_DISTAL,
)
val RIGHT_FINGERS_NO_THUMB = RIGHT_FINGERS -
setOf(
BodyPart.RIGHT_THUMB_METACARPAL,
BodyPart.RIGHT_THUMB_PROXIMAL,
BodyPart.RIGHT_THUMB_DISTAL,
)
val FINGERS = LEFT_FINGERS + RIGHT_FINGERS
val LEFT_LOWER_ARM = setOf(
BodyPart.LEFT_LOWER_ARM,
BodyPart.LEFT_HAND,
) +
LEFT_FINGERS
)
val RIGHT_LOWER_ARM = setOf(
BodyPart.RIGHT_LOWER_ARM,
BodyPart.RIGHT_HAND,
) +
RIGHT_FINGERS
)
val LOWER_ARMS = LEFT_LOWER_ARM + RIGHT_LOWER_ARM
@@ -141,7 +141,7 @@ class ResetsManager(val context: ResetsContext, val server: VRServer, val settin
resetType != ResetType.POSE_MOUNTING ||
(
(config.resetMountingFeet || bodyPart !in ResetBodyParts.FEET) &&
(config.resetMountingFingers || bodyPart !in ResetBodyParts.FINGERS) &&
bodyPart !in ResetBodyParts.FINGERS &&
bodyPart !in ResetBodyParts.TOES
)
}
@@ -173,12 +173,16 @@ class ResetsManager(val context: ResetsContext, val server: VRServer, val settin
in ResetBodyParts.ARMS if armsResetMode == ArmsResetMode.FORWARD -> 0f
// Going left
// Going left/
in ResetBodyParts.RIGHT_FINGERS_NO_THUMB -> -FastMath.HALF_PI
in ResetBodyParts.LEFT_ARM if armsResetMode == ArmsResetMode.T_POSE_UP -> -FastMath.HALF_PI
in ResetBodyParts.RIGHT_ARM if armsResetMode == ArmsResetMode.T_POSE_DOWN -> -FastMath.HALF_PI
// Going right
in ResetBodyParts.LEFT_FINGERS_NO_THUMB -> FastMath.HALF_PI
in ResetBodyParts.LEFT_ARM if armsResetMode == ArmsResetMode.T_POSE_DOWN -> FastMath.HALF_PI
in ResetBodyParts.RIGHT_ARM if armsResetMode == ArmsResetMode.T_POSE_UP -> FastMath.HALF_PI
@@ -19,7 +19,6 @@ class ResetsBehaviour(
receiver.sendRpc(
ResetsSettingsResponse(
resetMountingFeet = config.resetMountingFeet,
resetMountingFingers = config.resetMountingFingers,
armsResetMode = config.armsResetMode,
yawResetSmoothTime = config.yawResetSmoothTime,
saveMountingReset = config.saveMountingReset,
@@ -35,7 +34,6 @@ class ResetsBehaviour(
copy(
resetsConfig = ResetsConfig(
resetMountingFeet = req.resetMountingFeet,
resetMountingFingers = req.resetMountingFingers,
armsResetMode = req.armsResetMode,
yawResetSmoothTime = req.yawResetSmoothTime,
saveMountingReset = req.saveMountingReset,
@@ -42,8 +42,8 @@ class TrackerRestOrientationBehaviour(
private val quarterRollRight = EulerAngles(EulerOrder.YZX, 0f, 0f, FastMath.HALF_PI).toQuaternion()
private fun getRestOrientation(bodyPart: BodyPart?, armsResetMode: ArmsResetMode) = if (armsResetMode == ArmsResetMode.T_POSE_DOWN) {
when (bodyPart) {
in ResetBodyParts.LEFT_ARM -> quarterRollLeft
in ResetBodyParts.RIGHT_ARM -> quarterRollRight
in ResetBodyParts.LEFT_ARM + ResetBodyParts.LEFT_FINGERS -> quarterRollLeft
in ResetBodyParts.RIGHT_ARM + ResetBodyParts.RIGHT_FINGERS -> quarterRollRight
else -> Quaternion.IDENTITY
}
} else {