Skip to content

feat(terrain): add a shore prop for a walkable island beach - #78

Merged
anistark merged 2 commits into
mainfrom
claude/xenodochial-easley-39452b
Nov 15, 2026
Merged

anistark merged 2 commits into
mainfrom
claude/xenodochial-easley-39452b

Conversation

@anistark

Copy link
Copy Markdown
Contributor

Terrain gains shore, a beach an avatar can walk up out of the sea. A small island's bare coast is close to a cliff: on the workshop's "Island cove" it runs 30° to 66°, which testing the swimming in #76 showed an avatar can't climb.

  • shore is the width, in units, of a band past the land's edge where the ground falls 2 units at one slope, from 0.4 above the world ground to wading depth, then drops to the deep as before
  • So the beach is as gentle as it is wide: shore: 6 is about 18°, and about 4.3 is the 25° mark
  • Land near the coast is lowered to meet the beach, so nothing steeper stands behind it
  • With a shore, flatRadius flattens the land alone (scaling the sea bed would steepen it), and a pad wider than the land pushes the beach out to its edge
  • The island grows outward by shore, so it needs room inside size

Worlds without shore keep every height they had

  • The old path in terrainHeight() is untouched, and shore is read only on an island (one with falloff)
  • A test pins four shore-less shapes with toBe against heights recorded from main before the change

"Island cove" template

  • Its terrain takes shore: 6: the steepest stretch between +0.3 m and -1.5 m on the collider mesh goes from 60.8° to 19.6°
  • Dock moves from [0, 0, 19] to [0, 0, 9.4] and the Sailboat from z 24 to z 15.5. The dock used to start 9 m out from the waterline over 7 m of water, and now starts on the sand
  • The campfire, rocks and person stay at height 0, and the palms move by 1 to 4 mm

Also

Known limit: on a coarse grid (cells much wider than about 1.5 m) the crease at the bottom of the beach can show one steep triangle, 31° at resolution: 32 on an 80 x 60 terrain.

Testing: just check passes. In the workshop, a Player holding W walks from 1.6 m deep onto land in 2.5 s with shore: 6; on the old coast it slides to the bottom.

Refs #76

- `Terrain` takes `shore`, the width in units of a beach around an island (needs `falloff`)
- The beach falls 2 units at one slope, from 0.4 above the world ground to wading depth, so `shore: 6` is about 18°
- Land near the coast is lowered to meet the beach, and the island grows outward by `shore`
- Worlds that don't set `shore` keep every height they had
- The workshop's "Island cove" template has a beach, with its dock and sailboat moved in to meet it

[CONTRIBUTORS]
- New beach branch in `terrainHeight()` in `surfaces/terrain.ts`, the old path is untouched
- Tests pin shore-less heights to values recorded from `main` and hold the beach under 25°
- `shore` slider range in the workshop's `schema/ranges.ts`
- Regenerated `registry/` and the component docs, which also brings `person.md` up to date

Refs #76
@anistark
anistark merged commit 25af3e8 into main Nov 15, 2026
1 check passed
@anistark
anistark deleted the claude/xenodochial-easley-39452b branch November 15, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant