mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-24 11:01:20 -08:00
Finger mounting same as arms
This commit is contained in:
1 parent
860ec28e1f
commit
afb00dcbf4
4 files changed
+8
-23
No files matched your search
@@ -48,13 +48,6 @@ 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,
|
||||
@@ -73,24 +66,19 @@ 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
|
||||
|
||||
|
||||
@@ -231,15 +231,11 @@ class ResetsManager(val context: ResetsContext, val server: VRServer, val settin
|
||||
in ResetBodyParts.ARMS if armsResetMode == ArmsResetMode.FORWARD -> 0f
|
||||
|
||||
// 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
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@ class TrackerDefaultMountingOrientationBehaviour : TrackerBehaviour {
|
||||
private fun defaultMountingForBodyPart(bodyPart: BodyPart?): Quaternion = when (bodyPart) {
|
||||
// Spine mounted on the back (TODO: hip too? Test if spine is fine)
|
||||
BodyPart.UPPER_CHEST, BodyPart.LOWER_CHEST,
|
||||
BodyPart.UPPER_WAIST, BodyPart.LOWER_WAIST -> Quaternion.SLIMEVR.BACK
|
||||
BodyPart.UPPER_WAIST, BodyPart.LOWER_WAIST,
|
||||
-> Quaternion.SLIMEVR.BACK
|
||||
|
||||
// Left lower arm mounted left
|
||||
BodyPart.LEFT_LOWER_ARM, BodyPart.LEFT_HAND,
|
||||
|
||||
@@ -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 + ResetBodyParts.LEFT_FINGERS -> quarterRollLeft
|
||||
in ResetBodyParts.RIGHT_ARM + 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