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);
|
||||
}
|
||||
|
||||
function includeTerrain(bounds: FocusBoundsAccumulator, terrain: Terrain) {
|
||||
const terrainBounds = getTerrainBounds(terrain);
|
||||
includeBounds(bounds, terrainBounds.min, terrainBounds.max);
|
||||
}
|
||||
|
||||
function includePlayerStart(bounds: FocusBoundsAccumulator, position: Vec3) {
|
||||
includeBounds(
|
||||
bounds,
|
||||
@@ -250,6 +255,12 @@ function createPathFocusTarget(path: ScenePath): ViewportFocusTarget | null {
|
||||
return finishBounds(bounds);
|
||||
}
|
||||
|
||||
function createTerrainFocusTarget(terrain: Terrain): ViewportFocusTarget | null {
|
||||
const bounds = createEmptyBoundsAccumulator();
|
||||
includeTerrain(bounds, terrain);
|
||||
return finishBounds(bounds);
|
||||
}
|
||||
|
||||
function createMultiSelectionFocusTarget(
|
||||
document: SceneDocument,
|
||||
selection: EditorSelection
|
||||
|
||||
Reference in New Issue
Block a user