fix(simulation): align LCC layers in PlayCanvas world

This commit is contained in:
DCCONSTRUCTIONS
2026-08-26 14:20:40 +03:00
parent 906a6ce37b
commit 424374263e
6 changed files with 545 additions and 60 deletions
+23 -3
View File
@@ -297,9 +297,17 @@ class SimulationProjectStore:
result: dict[str, Any],
artifacts: list[dict[str, Any]],
world_manifest: dict[str, Any],
provider_job_id: str | None = None,
provider_progress: object = None,
) -> dict[str, Any]:
with self._lock:
document = self._read(project_id)
if provider_job_id is not None:
if PROVIDER_JOB_ID_PATTERN.fullmatch(provider_job_id) is None:
raise SimulationProjectError("simulation provider job id is invalid")
document["provider"]["job_id"] = provider_job_id
if provider_progress is not None:
document["provider"]["progress"] = provider_progress
document["status"] = "ready"
document["provider"]["state"] = "ready"
document["provider"]["runtime"] = result.get("runtime")
@@ -464,10 +472,10 @@ class SimulationProjectService:
"outputs": {
"preview_sog": True,
"streamed_sog": True,
"collision": False,
"collision": True,
},
"preview_lod": "coarsest",
"collision_profile": None,
"collision_profile": _collision_profile(str(project["scene_type"])),
}
submitted = provider.submit_build(request)
job_id = submitted.get("job_id")
@@ -607,12 +615,24 @@ def _world_manifest(project_id: str, artifacts: list[dict[str, Any]]) -> dict[st
"available": url_for("collision-mesh") is not None,
},
"transforms": {
"world_from_visual": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
"world_from_visual": [1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1],
"world_from_collision": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
},
}
def _collision_profile(scene_type: str) -> dict[str, Any]:
"""Build the portable walkable-volume contract around the scanner origin."""
return {
"scene_type": scene_type,
"seed_position": [0, 1, 0],
"capsule_height": 1.6,
"capsule_radius": 0.2,
"voxel_size": 0.05,
"mesh_shape": "smooth",
}
def _project_name(value: str) -> str:
normalized = " ".join(value.split())
if not 1 <= len(normalized) <= 120: