Merge branch 'main' into Atom/dmcdiar/ATOM-15517
This commit is contained in:
+1
-3
@@ -78,11 +78,9 @@ namespace AZ
|
||||
if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serializeContext->Class<EditorMaterialComponentSlot>()
|
||||
->Version(4, &EditorMaterialComponentSlot::ConvertVersion)
|
||||
->Version(5, &EditorMaterialComponentSlot::ConvertVersion)
|
||||
->Field("id", &EditorMaterialComponentSlot::m_id)
|
||||
->Field("materialAsset", &EditorMaterialComponentSlot::m_materialAsset)
|
||||
->Field("propertyOverrides", &EditorMaterialComponentSlot::m_propertyOverrides)
|
||||
->Field("matModUvOverrides", &EditorMaterialComponentSlot::m_matModUvOverrides)
|
||||
;
|
||||
|
||||
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
|
||||
|
||||
@@ -140,9 +140,16 @@ namespace AZ
|
||||
AZ::Vector3 nonUniformScale = AZ::Vector3::CreateOne();
|
||||
AZ::NonUniformScaleRequestBus::EventResult(nonUniformScale, GetEntityId(), &AZ::NonUniformScaleRequests::GetScale);
|
||||
|
||||
float t;
|
||||
AZ::Vector3 ignoreNormal;
|
||||
constexpr float rayLength = 1000.0f;
|
||||
if (m_controller.GetModel()->RayIntersection(transform, nonUniformScale, src, dir * rayLength, t, ignoreNormal))
|
||||
{
|
||||
distance = rayLength * t;
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_controller.GetModel()->RayIntersection(transform, nonUniformScale, src, dir, distance, ignoreNormal);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EditorMeshComponent::SupportsEditorRayIntersect()
|
||||
|
||||
@@ -485,16 +485,12 @@ namespace AZ
|
||||
m_transformInterface->GetWorldTM(), m_cachedNonUniformScale, ray.m_startWorldPosition,
|
||||
ray.m_endWorldPosition - ray.m_startWorldPosition, t, normal))
|
||||
{
|
||||
// note: this is a temporary workaround to handle cases where model->RayIntersection
|
||||
// returns negative distances, follow-up ATOM-15673
|
||||
const auto absT = AZStd::abs(t);
|
||||
|
||||
// fill in ray result structure after successful intersection
|
||||
const auto intersectionLine = (ray.m_endWorldPosition - ray.m_startWorldPosition);
|
||||
result.m_uv = AZ::Vector2::CreateZero();
|
||||
result.m_worldPosition = ray.m_startWorldPosition + intersectionLine * absT;
|
||||
result.m_worldPosition = ray.m_startWorldPosition + intersectionLine * t;
|
||||
result.m_worldNormal = normal;
|
||||
result.m_distance = intersectionLine.GetLength() * absT;
|
||||
result.m_distance = intersectionLine.GetLength() * t;
|
||||
result.m_entityAndComponent = m_entityComponentIdPair;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user