Add terrain support to runtime scene build
This commit is contained in:
@@ -1606,6 +1606,10 @@ export function buildRuntimeSceneFromDocument(
|
|||||||
const brushes = enabledBrushes.map((brush) =>
|
const brushes = enabledBrushes.map((brush) =>
|
||||||
buildRuntimeBrush(brush, document)
|
buildRuntimeBrush(brush, document)
|
||||||
);
|
);
|
||||||
|
const enabledTerrains = getTerrains(document.terrains).filter(
|
||||||
|
(terrain) => terrain.enabled
|
||||||
|
);
|
||||||
|
const terrains = enabledTerrains.map(buildRuntimeTerrain);
|
||||||
const staticColliders: RuntimeSceneCollider[] = [];
|
const staticColliders: RuntimeSceneCollider[] = [];
|
||||||
const volumes: RuntimeBoxVolumeCollection = {
|
const volumes: RuntimeBoxVolumeCollection = {
|
||||||
fog: [],
|
fog: [],
|
||||||
@@ -1724,7 +1728,10 @@ export function buildRuntimeSceneFromDocument(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const combinedSceneBounds = combineColliderBounds(colliders);
|
const combinedSceneBounds = combineSceneBounds(
|
||||||
|
combineColliderBounds(colliders),
|
||||||
|
terrains
|
||||||
|
);
|
||||||
const playerStart =
|
const playerStart =
|
||||||
playerStartEntity === null
|
playerStartEntity === null
|
||||||
? null
|
? null
|
||||||
@@ -1749,6 +1756,7 @@ export function buildRuntimeSceneFromDocument(
|
|||||||
control,
|
control,
|
||||||
localLights: collections.localLights,
|
localLights: collections.localLights,
|
||||||
brushes,
|
brushes,
|
||||||
|
terrains,
|
||||||
volumes,
|
volumes,
|
||||||
staticColliders,
|
staticColliders,
|
||||||
colliders,
|
colliders,
|
||||||
|
|||||||
Reference in New Issue
Block a user