update to use uniform scale calls to Transform
This commit is contained in:
+4
-4
@@ -35,7 +35,7 @@ namespace AZ
|
||||
// This equation is based off of the integration of a line segment against a perpendicular normal pointing at the center of the
|
||||
// line segment from some distance away.
|
||||
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
float h = GetInteriorHeight() * scale;
|
||||
float t2 = lightThreshold * lightThreshold;
|
||||
float h2 = h * h;
|
||||
@@ -54,7 +54,7 @@ namespace AZ
|
||||
const auto endpoints = m_shapeBus->GetCapsulePoints();
|
||||
GetFeatureProcessor()->SetCapsuleLineSegment(GetLightHandle(), endpoints.m_begin, endpoints.m_end);
|
||||
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
float radius = m_shapeBus->GetRadius();
|
||||
GetFeatureProcessor()->SetCapsuleRadius(GetLightHandle(), scale * radius);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace AZ
|
||||
|
||||
float CapsuleLightDelegate::GetSurfaceArea() const
|
||||
{
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
float radius = m_shapeBus->GetRadius();
|
||||
float capsArea = 4.0f * Constants::Pi * radius * radius; // both caps make a sphere
|
||||
float sideArea = 2.0f * Constants::Pi * radius * GetInteriorHeight(); // cylindrical area of capsule
|
||||
@@ -77,7 +77,7 @@ namespace AZ
|
||||
float radius = CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity);
|
||||
|
||||
// Add on the caps for the attenuation radius
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
float height = m_shapeBus->GetHeight() * scale;
|
||||
|
||||
debugDisplay.SetColor(color);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace AZ::Render
|
||||
|
||||
float DiskLightDelegate::GetRadius() const
|
||||
{
|
||||
return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement();
|
||||
return m_shapeBus->GetRadius() * GetTransform().GetUniformScale();
|
||||
}
|
||||
|
||||
void DiskLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& /*color*/, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ namespace AZ
|
||||
GetEntityId(),
|
||||
&TransformBus::Events::GetWorldTM);
|
||||
|
||||
transform.ExtractScale();
|
||||
transform.ExtractUniformScale();
|
||||
const Vector3 origin = transform.GetTranslation();
|
||||
const Vector3 originOffset = origin - (transform.TransformVector(forward) * arrowOffset);
|
||||
const Vector3 target = origin - (transform.TransformVector(forward) * (arrowLength + arrowOffset));
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ namespace AZ
|
||||
twiceArea += vertices.at(i).GetX() * vertices.at(j).GetY();
|
||||
twiceArea -= vertices.at(i).GetY() * vertices.at(j).GetX();
|
||||
}
|
||||
float scale = GetTransform().GetScale().GetMaxElement();
|
||||
float scale = GetTransform().GetUniformScale();
|
||||
return GetAbs(twiceArea * 0.5f * scale * scale);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ namespace AZ
|
||||
|
||||
float SphereLightDelegate::GetRadius() const
|
||||
{
|
||||
return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement();
|
||||
return m_shapeBus->GetRadius() * GetTransform().GetUniformScale();
|
||||
}
|
||||
|
||||
void SphereLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const
|
||||
|
||||
+1
-1
@@ -228,7 +228,7 @@ namespace AZ
|
||||
|
||||
// remove scale
|
||||
Transform worldNoScale = world;
|
||||
worldNoScale.ExtractScale();
|
||||
worldNoScale.ExtractUniformScale();
|
||||
|
||||
AZ::Matrix3x4 transformMatrix = AZ::Matrix3x4::CreateFromTransform(worldNoScale);
|
||||
transformMatrix.StoreToRowMajorFloat12(matrix);
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ namespace AZ
|
||||
SunPosition PhysicalSkyComponentController::GetSunTransform(const AZ::Transform& world)
|
||||
{
|
||||
Transform worldNoScale = world;
|
||||
worldNoScale.ExtractScale();
|
||||
worldNoScale.ExtractUniformScale();
|
||||
AZ::Vector3 sunPositionAtom = worldNoScale.TransformVector(AZ::Vector3(0, -1, 0)); // transform Sun from default position
|
||||
|
||||
// Convert sun position to Y-up coordinate
|
||||
|
||||
Reference in New Issue
Block a user