perf(sites): validate the site once and hand collision the field array

DiveSite.configure() builds the height field once (TerrainHeightField
validates the data) instead of running the definition validation and
then the field construction again; the composition root relies on the
error returned by configure(). The collision shape takes the field's
row-major elevations directly instead of copying 263k cells one by one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
OlivierandClaude Opus 5.5 committed 2026-10-06 20:52:04 +02:00
1 parent be16d2ee07
commit 682e1f18e5
5 files changed
+14 -16

No files matched your search

@@ -59,6 +59,11 @@ func maximum_elevation_m() -> float:
return _maximum_elevation_m
## Row-major elevations (index = row * columns + column), the HeightMapShape3D layout.
func elevations_m() -> PackedFloat32Array:
return _data.elevations_m
func elevation_at_cell(column: int, row: int) -> float:
return _data.elevations_m[_data.index_of(_clamp_column(column), _clamp_row(row))]