diff --git a/Source/Engine/Core/Math/Math.h b/Source/Engine/Core/Math/Math.h index 63ac8710c..f2beba514 100644 --- a/Source/Engine/Core/Math/Math.h +++ b/Source/Engine/Core/Math/Math.h @@ -596,7 +596,8 @@ namespace Math /// The destination range minimum. /// The destination range maximum. /// The remapped value. - static float Remap(float value, float fromMin, float fromMax, float toMin, float toMax) + template + static float Remap(T value, T fromMin, T fromMax, T toMin, T toMax) { return (value - fromMin) / (fromMax - fromMin) * (toMax - toMin) + toMin; } diff --git a/Source/Engine/Engine/Units.h b/Source/Engine/Engine/Units.h index 52064882d..a355092c8 100644 --- a/Source/Engine/Engine/Units.h +++ b/Source/Engine/Engine/Units.h @@ -5,3 +5,4 @@ #define METERS_TO_UNITS(meters) (meters * 100.0f) #define UNITS_TO_METERS(units) (units * 0.01f) #define UNITS_TO_METERS_SCALE 0.01f +#define METERS_TO_UNITS_SCALE 100.0f diff --git a/Source/Engine/Level/Actors/EnvironmentProbe.cpp b/Source/Engine/Level/Actors/EnvironmentProbe.cpp index 73f80bd9f..916b114e0 100644 --- a/Source/Engine/Level/Actors/EnvironmentProbe.cpp +++ b/Source/Engine/Level/Actors/EnvironmentProbe.cpp @@ -188,7 +188,7 @@ void EnvironmentProbe::Draw(RenderContext& renderContext) { // Size culling const Float3 position = _sphere.Center - renderContext.View.Origin; - const float radius = _sphere.Radius; + const float radius = (float)_sphere.Radius; const float drawMinScreenSize = 0.02f; const auto lodView = (renderContext.LodProxyView ? renderContext.LodProxyView : &renderContext.View); const float screenRadiusSquared = RenderTools::ComputeBoundsScreenRadiusSquared(position, radius, *lodView) * renderContext.View.ModelLODDistanceFactorSqrt; diff --git a/Source/Engine/Physics/Actors/SplineRopeBody.h b/Source/Engine/Physics/Actors/SplineRopeBody.h index cf92a8921..1cc843eb6 100644 --- a/Source/Engine/Physics/Actors/SplineRopeBody.h +++ b/Source/Engine/Physics/Actors/SplineRopeBody.h @@ -43,7 +43,7 @@ public: float GravityScale = 1.0f; /// - /// The scale of velocity applied to rope. The greater the value, the more suppressed the movement. + /// The scale of velocity applied to rope. The greater the value, the more suppressed the movement. Lower values increase movement freedom. /// API_FIELD(Attributes="EditorOrder(15), EditorDisplay(\"Rope\"), Limit(0, 0.99f, 0.001f)") float Drag = 0.1f; diff --git a/Source/Engine/Renderer/ProbesRenderer.cpp b/Source/Engine/Renderer/ProbesRenderer.cpp index 772905e37..5ed2af5d9 100644 --- a/Source/Engine/Renderer/ProbesRenderer.cpp +++ b/Source/Engine/Renderer/ProbesRenderer.cpp @@ -450,7 +450,7 @@ void ProbesRendererService::OnRender(RenderTask* task, GPUContext* context) { auto envProbe = (EnvironmentProbe*)_current.Actor.Get(); Vector3 position = envProbe->GetTransform().LocalToWorld(envProbe->CaptureOffset); - float radius = envProbe->GetSphere().Radius; + float radius = (float)envProbe->GetSphere().Radius; float nearPlane = Math::Max(METERS_TO_UNITS(0.001f), envProbe->CaptureNearPlane); // Adjust far plane distance diff --git a/Source/Engine/Tools/ModelTool/ModelTool.h b/Source/Engine/Tools/ModelTool/ModelTool.h index 1a9414ed2..ff47e635d 100644 --- a/Source/Engine/Tools/ModelTool/ModelTool.h +++ b/Source/Engine/Tools/ModelTool/ModelTool.h @@ -307,7 +307,7 @@ public: // Whether to do a sloppy mesh optimization. This is faster but does not follow the topology of the original mesh. API_FIELD(Attributes="EditorOrder(1140), EditorDisplay(\"Level Of Detail\"), VisibleIf(nameof(ShowGeometry))") bool SloppyOptimization = false; - // Only used if Sloppy is false. Target error is an approximate measure of the deviation from the original mesh using distance normalized to [0..1] range (e.g. 1e-2f means that simplifier will try to maintain the error to be below 1% of the mesh extents). + // Target error is an approximate measure of the deviation from the original mesh using distance normalized to [0,1] range (e.g. 0.01 means that simplifier will try to maintain the error to be below 1% of the mesh extents). Only used if Sloppy is unchecked. API_FIELD(Attributes="EditorOrder(1150), EditorDisplay(\"Level Of Detail\"), VisibleIf(nameof(SloppyOptimization), true), VisibleIf(nameof(ShowGeometry)), Limit(0.01f, 1, 0.001f)") float LODTargetError = 0.05f;