allow a single spine tracker to control the whole spine without warning

This commit is contained in:
loucass003 committed 2026-10-05 20:44:41 +02:00
1 parent c30efd2317
commit 753fdb527e
3 files changed
+9 -13

No files matched your search

@@ -78,11 +78,10 @@ fun bodyPartPrerequisites(bodyPart: BodyPart, ikSolved: Set<BodyPart> = emptySet
requirementGroups(bodyPart).filterNot { group -> group.all { it in ikSolved } }
private fun requirementGroups(bodyPart: BodyPart): List<List<BodyPart>> {
val spineIndex = SPINE_IMPUTED_PARTS.indexOf(bodyPart)
if (spineIndex >= 0) return listOfNotNull(SPINE_IMPUTED_PARTS.take(spineIndex).ifEmpty { null })
// The head roots the skeleton and the neck hangs off it, so neither waits on anything.
if (bodyPart == BodyPart.HEAD || bodyPart == BodyPart.NECK) return emptyList()
val standsAlone = bodyPart in SPINE_IMPUTED_PARTS ||
bodyPart == BodyPart.HEAD ||
bodyPart == BodyPart.NECK
if (standsAlone) return emptyList()
return limbPrerequisites(bodyPart) + listOf(SPINE_IMPUTED_PARTS)
}