fix build and tests

This commit is contained in:
Erimel committed 2026-09-09 17:34:41 -04:00
1 parent 99de177797
commit 2c1bce29c2
6 files changed
+11 -12

No files matched your search

@@ -230,7 +230,7 @@ class Skeleton(
),
targetProcessors = listOf(
// FloorClipTargetProcessor(settings),
SkatingCorrectionTargetProcessor(settings).also { resettableSkeletonProcessors.add(it) },
// SkatingCorrectionTargetProcessor(settings).also { resettableSkeletonProcessors.add(it) },
),
ikComputedProcessors = listOf(
VelocityComputedProcessor().also { resettableSkeletonProcessors.add(it) },
@@ -212,14 +212,14 @@ class VMCInputBehaviour(
val unityName = BODY_PART_TO_UNITY_BONE[bodyPart]?.first() ?: continue
val tracker = registry.boneTracker(bodyPart, unityName)
tracker.context.dispatch(TrackerActions.SetStatus(TrackerStatus.OK))
tracker.setRotation(rotation = transform.rotation, position = transform.position)
tracker.context.dispatch(TrackerActions.SetRotation(rotation = transform.rotation, position = transform.position))
}
for (pose in frame.poseTrackers.values) {
val tracker = registry.poseTracker(pose.serial)
val position = if (pose.deviceScale) pose.position else pose.position * scale
tracker.context.dispatch(TrackerActions.SetStatus(TrackerStatus.OK))
tracker.setRotation(rotation = pose.rotation, position = position)
tracker.context.dispatch(TrackerActions.SetRotation(rotation = pose.rotation, position = position))
}
registry.setStatus(TrackerStatus.OK)
@@ -163,10 +163,11 @@ private class VmcBoneTree(hierarchy: BodyPartMap<Array<BodyPart>>) {
val VMC_OUTPUT_BONE_PARENTS: BodyPartMap<BodyPart?> = VmcBoneTree(VMC_HIERARCHY_MAP).parents
val VMC_INPUT_HIERARCHY_MAP: BodyPartMap<Array<BodyPart>> = BodyPartMap(
VMC_HIERARCHY_MAP + mapOf(
BodyPart.CHEST to arrayOf(BodyPart.UPPER_CHEST),
BodyPart.UPPER_CHEST to arrayOf(BodyPart.NECK, BodyPart.LEFT_SHOULDER, BodyPart.RIGHT_SHOULDER),
),
VMC_HIERARCHY_MAP +
mapOf(
BodyPart.CHEST to arrayOf(BodyPart.UPPER_CHEST),
BodyPart.UPPER_CHEST to arrayOf(BodyPart.NECK, BodyPart.LEFT_SHOULDER, BodyPart.RIGHT_SHOULDER),
),
)
private val vmcInputTree = VmcBoneTree(VMC_INPUT_HIERARCHY_MAP)
val VMC_INPUT_BONE_ORDER: List<BodyPart> = vmcInputTree.order
@@ -117,7 +117,7 @@ fun buildTestSkeleton(scope: CoroutineScope): Skeleton {
onBufferOverflow = BufferOverflow.DROP_OLDEST,
)
computed.tryEmit(buildBones(context.state.value.boneInputs))
val skeleton = Skeleton(context, buildTestSettings(scope), computed)
val skeleton = Skeleton(context, computed, emptySet())
skeleton.startObserving()
return skeleton
}
@@ -21,8 +21,7 @@ import kotlin.test.assertNotNull
import kotlin.test.assertTrue
import kotlin.time.Duration.Companion.seconds
private fun assertApprox(expected: Vector3, actual: Vector3, message: String = "") =
vectorAssertEquals(expected, actual, message = message)
private fun assertApprox(expected: Vector3, actual: Vector3, message: String = "") = vectorAssertEquals(expected, actual, message = message)
// Quaternions q and -q represent the same rotation, so either sign is an acceptable match.
private fun assertApprox(expected: Quaternion, actual: Quaternion, message: String = "") {
@@ -63,8 +63,7 @@ private fun transformArgs(name: String, pos: Vector3, rot: Quaternion): List<Osc
private fun bundleOf(vararg messages: OscMessage) = OscBundle(1L, messages.map { OscContent.Message(it) })
private fun boneBundle(unityName: String, pos: Vector3, rot: Quaternion) =
bundleOf(OscMessage("/VMC/Ext/Bone/Pos", transformArgs(unityName, pos, rot)))
private fun boneBundle(unityName: String, pos: Vector3, rot: Quaternion) = bundleOf(OscMessage("/VMC/Ext/Bone/Pos", transformArgs(unityName, pos, rot)))
// Quaternions q and -q represent the same rotation, so either sign is an acceptable match.
private fun assertApprox(expected: Quaternion, actual: Quaternion) {