Skip to content

Comments

Align mesh base Y and remove legacy yOffset compensation#308

Merged
tracygardner merged 3 commits intomainfrom
codex/refactor-mesh-geometry-handling-and-offsets
Feb 22, 2026
Merged

Align mesh base Y and remove legacy yOffset compensation#308
tracygardner merged 3 commits intomainfrom
codex/refactor-mesh-geometry-handling-and-offsets

Conversation

@tracygardner
Copy link
Contributor

Motivation

  • Stop using runtime yOffset compensation and make mesh placement geometry-consistent by aligning the mesh base to the requested Y once during setup (and again when deferred ground resolution occurs).

Description

  • Add alignMeshBaseToY helper in api/mesh.js and call it during mesh initialization and after deferred ground-level resolution to align the wrapped mesh base to the requested Y.
  • Remove writes to legacy metadata.yOffset in api/mesh.js so initialization no longer persists runtime Y compensation data.
  • Simplify block/inspector Y handling by making calculateYPosition in ui/blocklyutil.js return mesh.position.y directly and rename the unused parameter to _block to avoid unused-variable warnings.
  • Update gizmo drag-end behavior in ui/gizmos.js to use the direct calculated mesh Y and stop subtracting the bounding-box extent so block position mirrors the mesh transform.

Testing

  • Ran npx eslint api/mesh.js ui/blocklyutil.js ui/gizmos.js; the run still fails due to multiple pre-existing lint issues unrelated to this change, though this PR removes the local unused-arg for calculateYPosition by renaming the parameter to _block.
  • No additional automated functional tests were added in this change.

Codex Task

@tracygardner tracygardner merged commit 235307d into main Feb 22, 2026
5 checks passed
@tracygardner tracygardner deleted the codex/refactor-mesh-geometry-handling-and-offsets branch February 22, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant