Ver Fonte

Variable fixes

Michael Riegger há 4 anos atrás
pai
commit
f05e7e5050
1 ficheiros alterados com 4 adições e 5 exclusões
  1. 4 5
      Gem/Code/Source/ShadowExampleComponent.cpp

+ 4 - 5
Gem/Code/Source/ShadowExampleComponent.cpp

@@ -170,8 +170,7 @@ namespace AtomSampleViewer
     {
     {
         using namespace AZ;
         using namespace AZ;
         constexpr float directionalLightPeriodTime = 5.f; // 5 seconds for a rotation of directional light position.
         constexpr float directionalLightPeriodTime = 5.f; // 5 seconds for a rotation of directional light position.
-        constexpr float diskLightPeriodTime = 7.f; // 7 seconds for a rotation of light positions.
-        constexpr float diskLightDist = 5.f;
+        constexpr float lightPeriodTime = 7.f; // 7 seconds for a rotation of light positions.
 
 
         if (m_elapsedTime == 0.f)
         if (m_elapsedTime == 0.f)
         {
         {
@@ -188,7 +187,7 @@ namespace AtomSampleViewer
         }
         }
         if (m_isPositionalLightAutoRotate)
         if (m_isPositionalLightAutoRotate)
         {
         {
-            m_positionalLightRotationAngle = fmodf(m_positionalLightRotationAngle - deltaTime * Constants::TwoPi / diskLightPeriodTime + Constants::TwoPi, Constants::TwoPi);
+            m_positionalLightRotationAngle = fmodf(m_positionalLightRotationAngle - deltaTime * Constants::TwoPi / lightPeriodTime + Constants::TwoPi, Constants::TwoPi);
         }
         }
 
 
 
 
@@ -220,10 +219,10 @@ namespace AtomSampleViewer
 
 
     AZ::Transform ShadowExampleComponent::GetTransformForLight(const uint32_t index) const
     AZ::Transform ShadowExampleComponent::GetTransformForLight(const uint32_t index) const
     {
     {
-        constexpr float diskLightDist = 5.f;
+        constexpr float lightDist = 5.f;
         using namespace AZ;
         using namespace AZ;
         const float angle = m_positionalLightRotationAngle + index * Constants::TwoPi / 3;
         const float angle = m_positionalLightRotationAngle + index * Constants::TwoPi / 3;
-        const auto location = Vector3(diskLightDist * sinf(angle), diskLightDist * cosf(angle), m_positionalLightHeights[index]);
+        const auto location = Vector3(lightDist * sinf(angle), lightDist * cosf(angle), m_positionalLightHeights[index]);
         const auto transform = Transform::CreateLookAt(location, Vector3::CreateZero());
         const auto transform = Transform::CreateLookAt(location, Vector3::CreateZero());
         return transform;
         return transform;
     }
     }