Include terrain in focus bounds calculation and create terrain focus target
This commit is contained in:
@@ -99,6 +99,11 @@ function includeBrush(bounds: FocusBoundsAccumulator, brush: Brush) {
|
|||||||
includeBounds(bounds, brushBounds.min, brushBounds.max);
|
includeBounds(bounds, brushBounds.min, brushBounds.max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function includeTerrain(bounds: FocusBoundsAccumulator, terrain: Terrain) {
|
||||||
|
const terrainBounds = getTerrainBounds(terrain);
|
||||||
|
includeBounds(bounds, terrainBounds.min, terrainBounds.max);
|
||||||
|
}
|
||||||
|
|
||||||
function includePlayerStart(bounds: FocusBoundsAccumulator, position: Vec3) {
|
function includePlayerStart(bounds: FocusBoundsAccumulator, position: Vec3) {
|
||||||
includeBounds(
|
includeBounds(
|
||||||
bounds,
|
bounds,
|
||||||
@@ -250,6 +255,12 @@ function createPathFocusTarget(path: ScenePath): ViewportFocusTarget | null {
|
|||||||
return finishBounds(bounds);
|
return finishBounds(bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createTerrainFocusTarget(terrain: Terrain): ViewportFocusTarget | null {
|
||||||
|
const bounds = createEmptyBoundsAccumulator();
|
||||||
|
includeTerrain(bounds, terrain);
|
||||||
|
return finishBounds(bounds);
|
||||||
|
}
|
||||||
|
|
||||||
function createMultiSelectionFocusTarget(
|
function createMultiSelectionFocusTarget(
|
||||||
document: SceneDocument,
|
document: SceneDocument,
|
||||||
selection: EditorSelection
|
selection: EditorSelection
|
||||||
|
|||||||
Reference in New Issue
Block a user