Tune the flashlight against measured luminance and refresh the venue gallery
This commit is contained in:
1 parent
2ba40f3578
commit
16dc1dfea4
20 files changed
+77
-15
No files matched your search
@@ -38,16 +38,30 @@ func test_flashlight_aims_a_tight_forward_spot() -> bool:
|
||||
var guard: Node3D = gm.call("_build_guard")
|
||||
var lamp: SpotLight3D = guard.get_node_or_null("Head/Flashlight") as SpotLight3D
|
||||
var a := TestUtils.check(lamp != null, "flashlight lives on the guard's head")
|
||||
var b := TestUtils.check(lamp != null and lamp.rotation_degrees.is_equal_approx(Vector3.ZERO),
|
||||
"flashlight aims straight ahead")
|
||||
var c := TestUtils.check(lamp != null and lamp.spot_angle <= 20.0,
|
||||
"flashlight cone is narrow enough to read as a torch")
|
||||
# The lamp is tilted a few degrees down so the beam also puts a pool on the
|
||||
# pavement in front; straight ahead left that ground black. Anything past ~8 deg
|
||||
# drops the door being checked out of the cone.
|
||||
var b := TestUtils.check(lamp != null
|
||||
and lamp.rotation_degrees.x <= 0.0 and lamp.rotation_degrees.x >= -8.0
|
||||
and is_zero_approx(lamp.rotation_degrees.y) and is_zero_approx(lamp.rotation_degrees.z),
|
||||
"flashlight aims forward with a slight downward tilt (x %.1f)" % (
|
||||
lamp.rotation_degrees.x if lamp else 0.0))
|
||||
# Measured: the old 4.2 energy / 20 m / 14 deg beam changed the late-night frame by
|
||||
# 0.1/255 and read as off. These bounds keep it a torch (not a floodlight) while
|
||||
# still lighting what the guard looks at.
|
||||
var c := TestUtils.check(lamp != null and lamp.spot_angle >= 20.0
|
||||
and lamp.spot_angle <= 30.0,
|
||||
"flashlight cone reads as a torch (%.0f deg)" % (lamp.spot_angle if lamp else 0.0))
|
||||
var c2 := TestUtils.check(lamp != null and lamp.light_energy >= 8.0
|
||||
and lamp.spot_range >= 30.0,
|
||||
"flashlight is bright enough to see (energy %.1f, range %.0f m)" % [
|
||||
lamp.light_energy if lamp else 0.0, lamp.spot_range if lamp else 0.0])
|
||||
var d := TestUtils.check(lamp != null and not lamp.visible, "flashlight starts off")
|
||||
var e := TestUtils.check(lamp != null
|
||||
and is_zero_approx(lamp.light_volumetric_fog_energy),
|
||||
"headless/compatibility builds leave the flashlight non-volumetric")
|
||||
root.free()
|
||||
return a and b and c and d and e
|
||||
return a and b and c and c2 and d and e
|
||||
|
||||
func test_flashlight_widens_perception() -> bool:
|
||||
## Without the flashlight, an NPC at AWARE_RADIUS + 3 m is unaware.
|
||||
|
||||
Reference in new issue
Block a user