Change SetSunDirection to take in angle and pitch

This commit is contained in:
nashmuhandes 2024-10-24 11:31:12 +08:00 committed by Nash Muhandes
commit a37c47cf92
2 changed files with 8 additions and 6 deletions

View file

@ -2238,11 +2238,13 @@ DEFINE_ACTION_FUNCTION(_Lightmap, Invalidate)
DEFINE_ACTION_FUNCTION(_Lightmap, SetSunDirection)
{
PARAM_PROLOGUE;
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_FLOAT(z);
PARAM_FLOAT(ang);
PARAM_FLOAT(pch);
auto vec = FVector3(float(x), float(y), float(z));
auto a = FAngle::fromDeg(float(ang));
auto p = FAngle::fromDeg(float(pch));
auto cosp = p.Cos();
auto vec = -FVector3{ cosp * a.Cos(), cosp * a.Sin(), -p.Sin() };
if (!vec.isZero() && level.levelMesh)
{