Skip to content

Commit d2ad0af

Browse files
committed
Add support for Godot 4.4
1 parent 8b69087 commit d2ad0af

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ export_presets.cfg
1313
.mono/
1414
data_*/
1515
mono_crash.*.json
16+
17+
# New crap
18+
*.uid

addons/lightmap_probe_grid/lightmap_probe_grid.gd

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
267267
func 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
326326
func 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
402402
func 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

Comments
 (0)