NEON-29: Fix idle_support_is_stable test normal vs 0.999 dot

(0.02, 0.995).normalized() dots ~0.9998 with UP, so default
STABLE_IDLE_FLOOR_MIN_UP_DOT (0.999) still treats it as flat.
Use the same tilted normal as min_flat_up_dot_parameter test.
pull/41/head
VinPropane 2026-04-12 17:27:37 -04:00
parent edec9158e4
commit 591db65b4a
1 changed files with 4 additions and 3 deletions

View File

@ -70,9 +70,10 @@ func test_idle_support_is_stable_on_flat_floor_without_wall_contacts() -> void:
func test_idle_support_is_stable_false_when_floor_is_not_flat_enough() -> void:
var slide_normals: Array[Vector3] = [Vector3.UP]
var stable: bool = PLAYER_SCRIPT.idle_support_is_stable(
true, Vector3(0.02, 0.995, 0.0).normalized(), slide_normals, 0
)
# Must have floor_normal.dot(UP) < STABLE_IDLE_FLOOR_MIN_UP_DOT (0.999).
# (0.02, 0.995).normalized() dots ~0.9998 and incorrectly passes as "flat" at 0.999.
var tilted_floor: Vector3 = Vector3(0.05, 0.99875, 0.0).normalized()
var stable: bool = PLAYER_SCRIPT.idle_support_is_stable(true, tilted_floor, slide_normals, 0)
assert_that(stable).is_false()