move non-uniform scale update after bus connection in polygon prism activation

This commit is contained in:
greerdv
2021-05-15 12:25:46 +01:00
parent f3c1878a8b
commit 05619f9244
@@ -215,10 +215,6 @@ namespace LmbrCentral
m_entityId = entityId;
m_currentTransform = AZ::Transform::CreateIdentity();
AZ::TransformBus::EventResult(m_currentTransform, entityId, &AZ::TransformBus::Events::GetWorldTM);
m_currentNonUniformScale = AZ::Vector3::CreateOne();
AZ::NonUniformScaleRequestBus::EventResult(m_currentNonUniformScale, m_entityId, &AZ::NonUniformScaleRequests::GetScale);
m_polygonPrism->SetNonUniformScale(m_currentNonUniformScale);
m_intersectionDataCache.InvalidateCache(InvalidateShapeCacheReason::ShapeChange);
AZ::TransformNotificationBus::Handler::BusConnect(entityId);
ShapeComponentRequestsBus::Handler::BusConnect(entityId);
@@ -226,6 +222,11 @@ namespace LmbrCentral
AZ::VariableVerticesRequestBus<AZ::Vector2>::Handler::BusConnect(entityId);
AZ::FixedVerticesRequestBus<AZ::Vector2>::Handler::BusConnect(entityId);
m_currentNonUniformScale = AZ::Vector3::CreateOne();
AZ::NonUniformScaleRequestBus::EventResult(m_currentNonUniformScale, m_entityId, &AZ::NonUniformScaleRequests::GetScale);
m_polygonPrism->SetNonUniformScale(m_currentNonUniformScale);
m_intersectionDataCache.InvalidateCache(InvalidateShapeCacheReason::ShapeChange);
AZ::NonUniformScaleRequestBus::Event(m_entityId, &AZ::NonUniformScaleRequests::RegisterScaleChangedEvent,
m_nonUniformScaleChangedHandler);