Making terrain query resolution a single float instead of a Vector2 (#7186)
* Making terrain query resolution a single float instead of a Vector2 Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Keeping the concept of different x/y step sizes in region queries since that may be useful and is separate from query resolution. Also keeping the concept of different x/y step sizes in physics since that's independent of the terrain gem. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Formatting cleanups Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * A few more minor cleanups Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Added support to convert serialized Vector2 query resolution to a single float. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Switch ray intersection check back to using separate values for x and y resolution Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Fixing new unit tests added to use float query resolution. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Updating automated test Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>
This commit is contained in:
@@ -317,8 +317,8 @@ void CGameExporter::ExportLevelInfo(const QString& path)
|
||||
root->setAttr("Name", levelName.toUtf8().data());
|
||||
auto terrain = AzFramework::Terrain::TerrainDataRequestBus::FindFirstHandler();
|
||||
const AZ::Aabb terrainAabb = terrain ? terrain->GetTerrainAabb() : AZ::Aabb::CreateFromPoint(AZ::Vector3::CreateZero());
|
||||
const AZ::Vector2 terrainGridResolution = terrain ? terrain->GetTerrainHeightQueryResolution() : AZ::Vector2::CreateOne();
|
||||
const int compiledHeightmapSize = static_cast<int>(terrainAabb.GetXExtent() / terrainGridResolution.GetX());
|
||||
const float terrainGridResolution = terrain ? terrain->GetTerrainHeightQueryResolution() : 1.0f;
|
||||
const int compiledHeightmapSize = static_cast<int>(terrainAabb.GetXExtent() / terrainGridResolution);
|
||||
root->setAttr("HeightmapSize", compiledHeightmapSize);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user