merge from main

This commit is contained in:
greerdv
2021-05-19 12:14:25 +01:00
11816 changed files with 189923 additions and 1002401 deletions
@@ -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);
@@ -399,29 +400,24 @@ namespace LmbrCentral
const ShapeDrawParams& shapeDrawParams, const PolygonPrismMesh& polygonPrismMesh,
AzFramework::DebugDisplayRequests& debugDisplay)
{
auto geomRenderer = gEnv->pRenderer->GetIRenderAuxGeom();
const SAuxGeomRenderFlags oldFlags = geomRenderer->GetRenderFlags();
SAuxGeomRenderFlags newFlags = oldFlags;
// ensure render state is configured correctly - we want to read the depth
// buffer but do not want to write to it (ensure objects inside the volume are not obscured)
newFlags.SetAlphaBlendMode(e_AlphaBlended);
newFlags.SetDepthWriteFlag(e_DepthWriteOff);
newFlags.SetDepthTestFlag(e_DepthTestOn);
geomRenderer->SetRenderFlags(newFlags);
if (shapeDrawParams.m_filled)
{
if (!polygonPrismMesh.m_triangles.empty())
{
auto rendererState = debugDisplay.GetState();
// ensure render state is configured correctly - we want to read the depth
// buffer but do not want to write to it (ensure objects inside the volume are not obscured)
debugDisplay.DepthWriteOff();
debugDisplay.DepthTestOn();
debugDisplay.DrawTriangles(polygonPrismMesh.m_triangles, shapeDrawParams.m_shapeColor);
// restore the previous renderer state
debugDisplay.SetState(rendererState);
}
}
geomRenderer->SetRenderFlags(oldFlags);
if (!polygonPrismMesh.m_lines.empty())
{
debugDisplay.DrawLines(polygonPrismMesh.m_lines, shapeDrawParams.m_wireColor);