Hook up the "Use Ground Plane" toggle.

The "Use Ground Plane" toggle is now functional.  When disabled, the terrain layer spawner will say "terrain exists = false" for any point in its bounds unless there's also a Terrain Height Gradient List component with a valid entry.  When enabled, it will always say "terrain exists = true", and it will return the min height of the spawner box as the ground plane if there's no valid Terrain Height Gradient List height provider.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2021-11-04 17:56:55 -05:00
parent 20edb35cdc
commit 97b0eddcb4
3 changed files with 48 additions and 22 deletions
@@ -168,7 +168,14 @@ namespace Terrain
bool m_terrainSurfacesDirty = false;
AZ::Aabb m_dirtyRegion;
// Cached data for each terrain area to use when looking up terrain data.
struct TerrainAreaData
{
AZ::Aabb m_areaBounds{ AZ::Aabb::CreateNull() };
bool m_useGroundPlane{ false };
};
mutable AZStd::shared_mutex m_areaMutex;
AZStd::map<AZ::EntityId, AZ::Aabb, TerrainLayerPriorityComparator> m_registeredAreas;
AZStd::map<AZ::EntityId, TerrainAreaData, TerrainLayerPriorityComparator> m_registeredAreas;
};
} // namespace Terrain