mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-28 21:06:31 -08:00
Support receiving fingers via VMC
This commit is contained in:
1 parent
98c7db658f
commit
e1d9a2cd5b
2 files changed
+18
-4
No files matched your search
@@ -198,10 +198,12 @@ class UnityArmature(localRot: Boolean) {
|
||||
if (unityBone === UnityBone.HIPS) {
|
||||
node.worldTransform.rotation = localRot
|
||||
} else {
|
||||
node.localTransform.rotation = when (unityBone) {
|
||||
UnityBone.LEFT_UPPER_ARM -> localRot * RIGHT_SHOULDER_OFFSET
|
||||
UnityBone.RIGHT_UPPER_ARM -> localRot * LEFT_SHOULDER_OFFSET
|
||||
else -> localRot
|
||||
node.localTransform.rotation = if (UnityBone.isLeftStartOfArmOrFingerBone(unityBone)) {
|
||||
localRot * RIGHT_SHOULDER_OFFSET
|
||||
} else if (UnityBone.isRightStartOfArmOrFingerBone(unityBone)) {
|
||||
localRot * LEFT_SHOULDER_OFFSET
|
||||
} else {
|
||||
localRot
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,5 +148,17 @@ enum class UnityBone(
|
||||
bone == RIGHT_MIDDLE_PROXIMAL || bone == RIGHT_MIDDLE_INTERMEDIATE || bone == RIGHT_MIDDLE_DISTAL ||
|
||||
bone == RIGHT_RING_PROXIMAL || bone == RIGHT_RING_INTERMEDIATE || bone == RIGHT_RING_DISTAL ||
|
||||
bone == RIGHT_LITTLE_PROXIMAL || bone == RIGHT_LITTLE_INTERMEDIATE || bone == RIGHT_LITTLE_DISTAL
|
||||
|
||||
/**
|
||||
* Returns true if the bone is the left upper arm or proximal left finger bone
|
||||
*/
|
||||
fun isLeftStartOfArmOrFingerBone(bone: UnityBone): Boolean = bone == LEFT_UPPER_ARM || bone == LEFT_THUMB_PROXIMAL ||
|
||||
bone == LEFT_INDEX_PROXIMAL || bone == LEFT_MIDDLE_PROXIMAL || bone == LEFT_RING_PROXIMAL || bone == LEFT_LITTLE_PROXIMAL
|
||||
|
||||
/**
|
||||
* Returns true if the bone is the right upper arm or proximal right finger bone
|
||||
*/
|
||||
fun isRightStartOfArmOrFingerBone(bone: UnityBone): Boolean = bone == RIGHT_UPPER_ARM || bone == RIGHT_THUMB_PROXIMAL ||
|
||||
bone == RIGHT_INDEX_PROXIMAL || bone == RIGHT_MIDDLE_PROXIMAL || bone == RIGHT_RING_PROXIMAL || bone == RIGHT_LITTLE_PROXIMAL
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user