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:
1 parent
be16d2ee07
commit
682e1f18e5
5 files changed
+14
-16
No files matched your search
@@ -21,10 +21,10 @@ var _placeholder_count := 0
|
||||
func configure(definition: DiveSiteDefinition) -> String:
|
||||
if definition == null:
|
||||
return "dive site definition is missing"
|
||||
var error := definition.validation_error()
|
||||
if not error.is_empty():
|
||||
return error
|
||||
var terrain_error := _terrain.configure(definition.height_field())
|
||||
var field := definition.height_field()
|
||||
if field == null:
|
||||
return "dive site definition is invalid"
|
||||
var terrain_error := _terrain.configure(field)
|
||||
if not terrain_error.is_empty():
|
||||
return terrain_error
|
||||
_definition = definition
|
||||
|
||||
Reference in new issue
Block a user