mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-04 15:52:35 -08:00
Align finger mounting with arms
This commit is contained in:
1 parent
cf94fc6a6b
commit
d67223a6bb
3 files changed
+26
-34
No files matched your search
@@ -8,34 +8,6 @@ object ResetBodyParts {
|
||||
BodyPart.RIGHT_UPPER_LEG,
|
||||
)
|
||||
|
||||
val LEFT_ARM = setOf(
|
||||
BodyPart.LEFT_SHOULDER,
|
||||
BodyPart.LEFT_UPPER_ARM,
|
||||
BodyPart.LEFT_LOWER_ARM,
|
||||
BodyPart.LEFT_HAND,
|
||||
)
|
||||
|
||||
val RIGHT_ARM = setOf(
|
||||
BodyPart.RIGHT_SHOULDER,
|
||||
BodyPart.RIGHT_UPPER_ARM,
|
||||
BodyPart.RIGHT_LOWER_ARM,
|
||||
BodyPart.RIGHT_HAND,
|
||||
)
|
||||
|
||||
val ARMS = LEFT_ARM + RIGHT_ARM
|
||||
|
||||
val LEFT_LOWER_ARM = setOf(
|
||||
BodyPart.LEFT_LOWER_ARM,
|
||||
BodyPart.LEFT_HAND,
|
||||
)
|
||||
|
||||
val RIGHT_LOWER_ARM = setOf(
|
||||
BodyPart.RIGHT_LOWER_ARM,
|
||||
BodyPart.RIGHT_HAND,
|
||||
)
|
||||
|
||||
val LOWER_ARMS = LEFT_LOWER_ARM + RIGHT_LOWER_ARM
|
||||
|
||||
val FEET = setOf(
|
||||
BodyPart.LEFT_FOOT,
|
||||
BodyPart.RIGHT_FOOT,
|
||||
@@ -76,4 +48,28 @@ object ResetBodyParts {
|
||||
BodyPart.RIGHT_LITTLE_INTERMEDIATE,
|
||||
BodyPart.RIGHT_LITTLE_DISTAL,
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
val LEFT_ARM = setOf(
|
||||
BodyPart.LEFT_SHOULDER,
|
||||
BodyPart.LEFT_UPPER_ARM,
|
||||
) + LEFT_LOWER_ARM
|
||||
|
||||
val RIGHT_ARM = setOf(
|
||||
BodyPart.RIGHT_SHOULDER,
|
||||
BodyPart.RIGHT_UPPER_ARM,
|
||||
) + RIGHT_LOWER_ARM
|
||||
|
||||
val ARMS = LEFT_ARM + RIGHT_ARM
|
||||
}
|
||||
@@ -166,15 +166,11 @@ class ResetsManager(val context: ResetsContext, val server: VRServer, val settin
|
||||
|
||||
in ResetBodyParts.RIGHT_ARM if armsResetMode == ArmsResetMode.T_POSE_DOWN -> -FastMath.HALF_PI
|
||||
|
||||
in ResetBodyParts.RIGHT_FINGERS -> -FastMath.HALF_PI
|
||||
|
||||
// Going right
|
||||
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
|
||||
|
||||
in ResetBodyParts.LEFT_FINGERS -> FastMath.HALF_PI
|
||||
|
||||
// Going back
|
||||
else -> FastMath.PI
|
||||
}
|
||||
|
||||
@@ -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, in ResetBodyParts.LEFT_FINGERS -> quarterRollLeft
|
||||
in ResetBodyParts.RIGHT_ARM, in ResetBodyParts.RIGHT_FINGERS -> quarterRollRight
|
||||
in ResetBodyParts.LEFT_ARM -> quarterRollLeft
|
||||
in ResetBodyParts.RIGHT_ARM -> quarterRollRight
|
||||
else -> Quaternion.IDENTITY
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user