Skip to content

Commit c97d0cd

Browse files
committed
Merge remote-tracking branch 'origin/feature/packetmine-rewrite' into feature/packetmine-rewrite
2 parents 64206d5 + 38a86e5 commit c97d0cd

File tree

1 file changed

+5
-0
lines changed
  • common/src/main/kotlin/com/lambda/interaction/request/rotation/visibilty

1 file changed

+5
-0
lines changed

common/src/main/kotlin/com/lambda/interaction/request/rotation/visibilty/PlaceDirection.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ enum class PlaceDirection(
129129
* @return The calculated pitch value
130130
*/
131131
private fun calculateHorizontalPitch(currentPitch: Double, boundaryValue: Double): Double {
132+
// Handle extreme pitch values (-90 or 90) by returning 0
133+
if (abs(currentPitch) >= 90.0 - 0.1) {
134+
return 0.0
135+
}
136+
132137
val isWithinPositiveBoundary = abs(currentPitch - boundaryValue) < abs(currentPitch - (-boundaryValue))
133138
return if (isWithinPositiveBoundary) boundaryValue else -boundaryValue
134139
}

0 commit comments

Comments
 (0)