fix: elevate all gridmap meshes by 0.08 to prevent clipping into terrain shifted at -0.22
This commit is contained in:
+5174
-8
File diff suppressed because one or more lines are too long
Binary file not shown.
+13
-3
@@ -192,9 +192,19 @@ func _hide_ground_tiles():
|
||||
func _setup_effect_elevation():
|
||||
var em = get_node_or_null("EnhancedGridMap")
|
||||
if em and em.mesh_library:
|
||||
# Since the Freemode arena is now shifted to Y=0.0, we no longer need to lift
|
||||
# Wall(4) and Freeze(5) meshes by 0.28 to match the old floor height!
|
||||
pass
|
||||
# The arena is shifted down by -0.22, putting the physical 3D floor around Y=0.06.
|
||||
# To prevent gridmap tiles from clipping or being buried under the terrain,
|
||||
# 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
|
||||
if not em:
|
||||
|
||||
Reference in New Issue
Block a user