From 26d54a05c633c96783dbb51ac6db72cbbf7e7f9c Mon Sep 17 00:00:00 2001 From: routersys Date: Tue, 20 Oct 2026 18:32:19 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A9=E3=82=B8=E3=82=A2=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E6=8F=9B=E7=AE=97=E3=81=A8=E5=85=89=E6=BA=90=E3=81=AE=E4=BB=B0?= =?UTF-8?q?=E8=A7=92=E3=81=AE=E4=B8=8A=E9=99=90=E3=81=AB=E5=90=8D=E5=89=8D?= =?UTF-8?q?=E3=82=92=E4=BB=98=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inflate/InflateSettings.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Inflate/InflateSettings.cs b/Inflate/InflateSettings.cs index 477561b..f8efc9e 100644 --- a/Inflate/InflateSettings.cs +++ b/Inflate/InflateSettings.cs @@ -14,6 +14,8 @@ internal static class InflateSettings public const int CorrectionGroupThreads = CorrectionGroupSize * CorrectionGroupSize; public const int CorrectionReduceThreads = 256; public const float MaximumCorrectionScale = 4f; + public const float RadiansPerDegree = MathF.PI / 180f; + public const float MaximumLightElevationDegrees = 90f; public const uint MaskInside = 1u; public const int MaskOutsideShift = 1; public const int MaskOutsideWidth = 3; @@ -115,8 +117,8 @@ internal static class InflateSettings public static (float X, float Y, float Z) GetLightVector(float azimuthDegrees, float elevationDegrees) { - var azimuth = azimuthDegrees * MathF.PI / 180f; - var elevation = Math.Clamp(elevationDegrees, 0f, 90f) * MathF.PI / 180f; + var azimuth = azimuthDegrees * RadiansPerDegree; + var elevation = Math.Clamp(elevationDegrees, 0f, MaximumLightElevationDegrees) * RadiansPerDegree; var horizontal = MathF.Cos(elevation); return (MathF.Sin(azimuth) * horizontal, -MathF.Cos(azimuth) * horizontal, MathF.Sin(elevation)); }