various fixes

This commit is contained in:
bee
2026-07-09 08:18:48 +02:00
parent c4f2c0a202
commit e78d11998f
10 changed files with 33 additions and 25 deletions
+4 -3
View File
@@ -24,7 +24,6 @@ extends RigidBody3D
var _probe_offsets: Array[Vector3] = [] # local space
var _ocean: Ocean
# var _probes: Array[Marker3D] = [] TODO: Probably unused
var _gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
var submerged_ratio := 0.0
@@ -39,10 +38,12 @@ func _ready() -> void:
if _probe_offsets.is_empty():
for col in probe_grid.x:
for row in probe_grid.y:
var tx := 0.5 if probe_grid.x <= 1 else col / float(probe_grid.x - 1)
var tz := 0.5 if probe_grid.y <= 1 else row / float(probe_grid.y - 1)
_probe_offsets.append(Vector3(
lerpf(-probe_extents.x, probe_extents.x, col / float(probe_grid.x - 1)),
lerpf(-probe_extents.x, probe_extents.x, tx),
probe_extents.y,
lerpf(-probe_extents.z, probe_extents.z, row / float(probe_grid.y - 1))))
lerpf(-probe_extents.z, probe_extents.z, tz)))