ラジアンの換算と光源の仰角の上限に名前を付ける

このコミットが含まれているのは:
routersys committed 2026-10-20 18:32:19 +09:00
1 親 889a556837
コミット 26d54a05c6
1ファイル変更
+4 -2
+4 -2
ファイルの表示
@@ -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));
}