Gate venue light falloff with a test (physical attenuation = 1.0)
This commit is contained in:
1 parent
e3ec4a356a
commit
93da916f90
3 files changed
+25
-5
No files matched your search
@@ -388,6 +388,24 @@ func test_library_dressing_collision_matches_the_documented_exemptions() -> bool
|
||||
return TestUtils.check(problems.is_empty(),
|
||||
"library dressing is covered: %s" % ", ".join(problems.slice(0, 6)))
|
||||
|
||||
func test_venue_lights_use_physical_falloff() -> bool:
|
||||
var problems: Array[String] = []
|
||||
for venue in ["hollywood_building", "joke_shop", "tv_studio"]:
|
||||
var root := Node3D.new()
|
||||
var builder := WorldBuilder.new(root, venue)
|
||||
builder.build()
|
||||
for light in root.find_children("*", "OmniLight3D", true, false):
|
||||
if not is_equal_approx((light as OmniLight3D).omni_attenuation, 1.0):
|
||||
problems.append("%s/%s omni_attenuation=%.2f" % [venue, light.name,
|
||||
(light as OmniLight3D).omni_attenuation])
|
||||
for light in root.find_children("*", "SpotLight3D", true, false):
|
||||
if not is_equal_approx((light as SpotLight3D).spot_attenuation, 1.0):
|
||||
problems.append("%s/%s spot_attenuation=%.2f" % [venue, light.name,
|
||||
(light as SpotLight3D).spot_attenuation])
|
||||
root.free()
|
||||
return TestUtils.check(problems.is_empty(),
|
||||
"every venue light uses physical falloff: %s" % ", ".join(problems.slice(0, 6)))
|
||||
|
||||
func _walk_blocking_body(node: Node) -> StaticBody3D:
|
||||
for child in node.find_children("*", "StaticBody3D", true, false):
|
||||
var body := child as StaticBody3D
|
||||
|
||||
Reference in new issue
Block a user