From 568f418608c58a7ae2978a30b517314550d9c8fa Mon Sep 17 00:00:00 2001 From: dingo Date: Mon, 16 Mar 2026 17:17:37 -0400 Subject: [PATCH] Fix: stalagmite base at tile centre, not tile physical bottom The affinity model's visual base is at body-local Y=0 (= world Y=tile_h/2, the tile centre), because _fit_model_to_tile seats AABB bottom there. The stalagmite base (AABB top) must sit at the same height so it connects seamlessly. Previous shift -(tile_h/2 + scaled_h) placed the base at body-local Y=-tile_h/2 (world Y=0 = tile physical bottom), creating a gap of tile_h/2 between the affinity model and the stalagmite. Fix: shift by -scaled_h only, bringing AABB top to body-local Y=0. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Client/origin-client/scenes/game/game_screen.gd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index e8905c9..c1dff2c 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -542,14 +542,15 @@ func _try_load_tile_bottom(body_ref: Variant, url: String) -> void: # the internal _model_local_aabb call returns a valid AABB. _fit_model_to_tile(bottom_node, 0.98) - # After fitting: AABB bottom (spike tip) is at body-local Y=0, - # AABB top (wide base) is at body-local Y = scaled_h. - # We want the wide base flush with the tile underside (body-local Y=-tile_h/2). - # Shift = -(tile_h/2 + scaled_h). + # After _fit_model_to_tile: the model's AABB bottom (spike tip) is at + # body-local Y=0 and the AABB top (wide base) is at body-local Y = scaled_h. + # The affinity model's visual base sits at body-local Y=0 (tile centre, + # world Y = tile_h/2), so we want the stalagmite base there too. + # Shift down by exactly scaled_h to bring the AABB top to body-local Y=0. var btm_aabb := _model_local_aabb(bottom_node) if btm_aabb.size != Vector3.ZERO: var scaled_h := bottom_node.scale.y * btm_aabb.size.y - bottom_node.position.y -= tile_h * 0.5 + scaled_h + bottom_node.position.y -= scaled_h )