class_name ShadowListener
extends Area3D

var _colliders: Dictionary = {}


func in_shadow() -> bool:
	return len(_colliders) > 0


func _on_body_shape_entered(
	body_rid: RID, _body: Node3D, _body_shape_index: int, _local_shape_index: int
) -> void:
	_colliders[body_rid] = true


func _on_body_shape_exited(
	body_rid: RID, _body: Node3D, _body_shape_index: int, _local_shape_index: int
) -> void:
	_colliders.erase(body_rid)
