@@ -234,7 +234,7 @@ func add_GPU_raycaster(probe: Node3D) -> void:
234234 depth_filter .rotation = Vector3 .ZERO
235235
236236
237- func generate_probes_raycasters (distance : float ) -> void :
237+ func generate_probes_raycasters () -> void :
238238 for probe in get_children ():
239239 add_GPU_raycaster (probe )
240240
@@ -265,7 +265,7 @@ func rotate_camera(camera: Camera3D, to: Vector3) -> void:
265265# Shoot rays from the center to all the probes. If any object is detected so the probe is
266266# obstructed and will be cut
267267func cut_obstructed () -> void :
268- await generate_probes_raycasters (far_distance )
268+ await generate_probes_raycasters ()
269269
270270 var probes_array : Array [LightmapProbe ] = []
271271 var camera_array : Array [Camera3D ] = []
@@ -289,7 +289,7 @@ func cut_obstructed() -> void:
289289
290290 camera .position = position
291291 # The lenght of the "Ray"
292- camera .far = ( probe_pos - position ).length ()
292+ camera .far = maxf (( probe_pos - position ).length (), 0.0021 )
293293 # The direction of the "Ray"
294294 rotate_camera (camera , probe_pos )
295295 sub_viewport .render_target_update_mode = SubViewport .UPDATE_ONCE
@@ -324,7 +324,7 @@ func cut_obstructed() -> void:
324324# Detect if the probe is far from any object. It will shoot rays on all 6 axis and 8 quadrants.
325325# If there aren't any objects the probe will be cut
326326func cut_far () -> void :
327- await generate_probes_raycasters (far_distance )
327+ await generate_probes_raycasters ()
328328
329329 # 6 axis and 8 quadrants
330330 var directions : Array [Vector3 ] = [
@@ -400,7 +400,7 @@ func cut_far() -> void:
400400# Detect if probe is inside an object. It will shoot rays from all 6 axis to the probe. If at least
401401# 4 are obstructed, the probe will be cut
402402func cut_inside () -> void :
403- await generate_probes_raycasters (far_distance )
403+ await generate_probes_raycasters ()
404404
405405 # 6 Axis
406406 var axis : Array [Vector3 ] = [
@@ -466,4 +466,3 @@ func cut_inside() -> void:
466466
467467 set_probes_number ()
468468 remove_probes_raycasters ()
469-
0 commit comments