fix: elevate all gridmap meshes by 0.08 to prevent clipping into terrain shifted at -0.22

This commit is contained in:
2026-07-06 17:31:02 +08:00
parent b86011a6c6
commit ce515365a7
3 changed files with 5187 additions and 11 deletions
File diff suppressed because one or more lines are too long
Binary file not shown.
+13 -3
View File
@@ -192,9 +192,19 @@ func _hide_ground_tiles():
func _setup_effect_elevation(): func _setup_effect_elevation():
var em = get_node_or_null("EnhancedGridMap") var em = get_node_or_null("EnhancedGridMap")
if em and em.mesh_library: if em and em.mesh_library:
# Since the Freemode arena is now shifted to Y=0.0, we no longer need to lift # The arena is shifted down by -0.22, putting the physical 3D floor around Y=0.06.
# Wall(4) and Freeze(5) meshes by 0.28 to match the old floor height! # To prevent gridmap tiles from clipping or being buried under the terrain,
pass # we apply a universal Y-lift to all items in the mesh library so they render slightly above the grass.
var ml = em.mesh_library.duplicate()
var lift_transform = Transform3D().translated(Vector3(0, 0.08, 0))
for id in ml.get_item_list():
# Skip non-walkable blocks since we hide them anyway
if id == 4: continue
var current_transform = ml.get_item_mesh_transform(id)
ml.set_item_mesh_transform(id, lift_transform * current_transform)
em.mesh_library = ml
# Force gridmap cell size to match player logic (1, 0.05, 1) - >0.001 to avoid errors # Force gridmap cell size to match player logic (1, 0.05, 1) - >0.001 to avoid errors
if not em: if not em: