Minor fixups for terrain physics collide lyn 7692 (#5413)

* First commit

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

* completed changes

Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>
This commit is contained in:
John Jones-Steele
2021-11-09 13:24:10 +00:00
committed by GitHub
parent 1998c53882
commit 938899a495
@@ -185,12 +185,12 @@ namespace Terrain
void TerrainPhysicsColliderComponent::GetHeightfieldHeightBounds(float& minHeightBounds, float& maxHeightBounds) const
{
AZ::Aabb heightfieldAabb = GetHeightfieldAabb();
const AZ::Aabb heightfieldAabb = GetHeightfieldAabb();
// Because our terrain heights are relative to the center of the bounding box, the min and max allowable heights are also
// relative to the center. They are also clamped to the size of the bounding box.
minHeightBounds = -(heightfieldAabb.GetZExtent() / 2.0f);
maxHeightBounds = heightfieldAabb.GetZExtent() / 2.0f;
minHeightBounds = -maxHeightBounds;
}
AZ::Transform TerrainPhysicsColliderComponent::GetHeightfieldTransform() const
@@ -199,9 +199,7 @@ namespace Terrain
AZ::Vector3 translate;
AZ::TransformBus::EventResult(translate, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation);
AZ::Transform transform = AZ::Transform::CreateTranslation(translate);
return transform;
return AZ::Transform::CreateTranslation(translate);
}
void TerrainPhysicsColliderComponent::GenerateHeightsInBounds(AZStd::vector<float>& heights) const