Skip to content

Commit

Permalink
Change SetSunDirection to take in angle and pitch
Browse files Browse the repository at this point in the history
  • Loading branch information
nashmuhandes committed Oct 24, 2024
1 parent 42a02eb commit 66cd55b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/rendering/hwrenderer/doom_levelmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2238,11 +2238,11 @@ 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));
double cosp = g_cos(pch);
auto vec = FVector3(float(g_cos(ang) * cosp), float(g_sin(ang) * cosp), float(-g_sin(pch)));

if (!vec.isZero() && level.levelMesh)
{
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/doombase.zs
Original file line number Diff line number Diff line change
Expand Up @@ -817,9 +817,9 @@ struct Lightmap
// Mark all lightmap surfaces for recalculation. The internal lightmapper will gradually recalculate every single lightmap surface in the level.
native static void Invalidate();

// Set direction of the light towards the sun.
// Set direction of the light towards the sun. Angle and pitch matches ZDRayInfo.
// Calling this does NOT recalculate the lightmap.
native static void SetSunDirection(Vector3 dir);
native static void SetSunDirection(double ang, double pch);

// Can go above 1.0 (call Invalidate())
// Calling this does NOT recalculate the lightmap.
Expand Down

0 comments on commit 66cd55b

Please sign in to comment.