Update PosePhaseDetector.kt

This commit is contained in:
harine
2026-09-16 22:54:42 +08:00
parent 95a64de109
commit 1465b7984a
@@ -197,14 +197,18 @@ class PosePhaseDetector {
rightElbowAngleDegrees = angles.rightElbow rightElbowAngleDegrees = angles.rightElbow
) )
// Identify the next phase we are looking for in the sequence. // Identify the next phase we are looking for in the sequence. The
// only BowlingPhase values not already matched above are
// BACK_SWING/POWER_STEP (never currentPhase -- see this class's
// doc) and FOLLOW_THROUGH, so reaching else always means
// FOLLOW_THROUGH: the final phase, nothing to advance to.
val targetPhase = when (currentPhase) { val targetPhase = when (currentPhase) {
null -> BowlingPhase.STARTING_STANCE null -> BowlingPhase.STARTING_STANCE
BowlingPhase.STARTING_STANCE -> BowlingPhase.APPROACH BowlingPhase.STARTING_STANCE -> BowlingPhase.APPROACH
BowlingPhase.APPROACH -> BowlingPhase.PUSHAWAY BowlingPhase.APPROACH -> BowlingPhase.PUSHAWAY
BowlingPhase.PUSHAWAY -> BowlingPhase.SLIDE_AND_RELEASE BowlingPhase.PUSHAWAY -> BowlingPhase.SLIDE_AND_RELEASE
BowlingPhase.SLIDE_AND_RELEASE -> BowlingPhase.FOLLOW_THROUGH BowlingPhase.SLIDE_AND_RELEASE -> BowlingPhase.FOLLOW_THROUGH
else -> currentPhase else -> BowlingPhase.FOLLOW_THROUGH
} }
// 1. Check if the user is in the NEXT phase. // 1. Check if the user is in the NEXT phase.