Fixed crash and asserts when heightfield is used without Terrain World

Signed-off-by: Sergey Pereslavtsev <pereslav@amazon.com>
This commit is contained in:
Sergey Pereslavtsev
2022-01-28 17:14:21 +00:00
parent ff79931d1d
commit fc02783200
3 changed files with 19 additions and 3 deletions
@@ -150,7 +150,13 @@ namespace PhysX
{
ClearHeightfield();
InitHeightfieldShapeConfiguration();
InitStaticRigidBody();
Physics::HeightfieldShapeConfiguration& configuration = static_cast<Physics::HeightfieldShapeConfiguration&>(*m_shapeConfig.second);
if (!configuration.GetSamples().empty())
{
InitStaticRigidBody();
}
Physics::ColliderComponentEventBus::Event(GetEntityId(), &Physics::ColliderComponentEvents::OnColliderChanged);
}