Include terrain in viewport focus calculation and resolve terrain focus target
This commit is contained in:
@@ -450,6 +450,10 @@ function getSceneFocusTarget(document: SceneDocument): ViewportFocusTarget | nul
|
|||||||
includeBrush(bounds, brush);
|
includeBrush(bounds, brush);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const terrain of Object.values(document.terrains)) {
|
||||||
|
includeTerrain(bounds, terrain);
|
||||||
|
}
|
||||||
|
|
||||||
for (const modelInstance of Object.values(document.modelInstances)) {
|
for (const modelInstance of Object.values(document.modelInstances)) {
|
||||||
includeModelInstance(bounds, modelInstance, document.assets[modelInstance.assetId]);
|
includeModelInstance(bounds, modelInstance, document.assets[modelInstance.assetId]);
|
||||||
}
|
}
|
||||||
@@ -505,6 +509,16 @@ export function resolveViewportFocusTarget(document: SceneDocument, selection: E
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const selectedTerrainId = getSingleSelectedTerrainId(selection);
|
||||||
|
|
||||||
|
if (selectedTerrainId !== null) {
|
||||||
|
const terrain = document.terrains[selectedTerrainId];
|
||||||
|
|
||||||
|
if (terrain !== undefined) {
|
||||||
|
return createTerrainFocusTarget(terrain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const selectedPathPoint = getSingleSelectedPathPoint(selection);
|
const selectedPathPoint = getSingleSelectedPathPoint(selection);
|
||||||
|
|
||||||
if (selectedPathPoint !== null) {
|
if (selectedPathPoint !== null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user