Change SetSunDirection to take in angle and pitch
This commit is contained in:
parent
42a02eb2db
commit
a37c47cf92
2 changed files with 8 additions and 6 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue