Physics/test axis aligned box shape configuration works #7378a (#5366)

* Safety commit before merging

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Moved from Physics to Terrain

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Changes from PR + AR fix

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Fixed another AR bug

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Fixed another AR compilation bug

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* More PR changes

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Added virtual destructor

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Added TestSuite_main_Optimized.py

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Changes from PR

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Further fixes for PR

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Fix to editor_test.py

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Testing prefab level

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Testing slice level

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Testing prefab level

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>

* Disabled orefab loading for the time being.

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>
This commit is contained in:
John Jones-Steele
2021-11-09 14:11:33 +00:00
committed by GitHub
parent 938899a495
commit c35f74e9ce
17 changed files with 334 additions and 0 deletions
@@ -193,6 +193,22 @@ namespace Terrain
minHeightBounds = -maxHeightBounds;
}
float TerrainPhysicsColliderComponent::GetHeightfieldMinHeight() const
{
float minHeightBounds{ 0.0f };
float maxHeightBounds{ 0.0f };
GetHeightfieldHeightBounds(minHeightBounds, maxHeightBounds);
return minHeightBounds;
}
float TerrainPhysicsColliderComponent::GetHeightfieldMaxHeight() const
{
float minHeightBounds{ 0.0f };
float maxHeightBounds{ 0.0f };
GetHeightfieldHeightBounds(minHeightBounds, maxHeightBounds);
return maxHeightBounds;
}
AZ::Transform TerrainPhysicsColliderComponent::GetHeightfieldTransform() const
{
// We currently don't support rotation of terrain heightfields.
@@ -296,6 +312,24 @@ namespace Terrain
numRows = aznumeric_cast<int32_t>((bounds.GetMax().GetY() - bounds.GetMin().GetY()) / gridResolution.GetY());
}
int32_t TerrainPhysicsColliderComponent::GetHeightfieldGridColumns() const
{
int32_t numColumns{ 0 };
int32_t numRows{ 0 };
GetHeightfieldGridSize(numColumns, numRows);
return numColumns;
}
int32_t TerrainPhysicsColliderComponent::GetHeightfieldGridRows() const
{
int32_t numColumns{ 0 };
int32_t numRows{ 0 };
GetHeightfieldGridSize(numColumns, numRows);
return numRows;
}
AZStd::vector<Physics::MaterialId> TerrainPhysicsColliderComponent::GetMaterialList() const
{
return AZStd::vector<Physics::MaterialId>();