Skip to content

Commit

Permalink
Allow to set night-only with negative timescale value
Browse files Browse the repository at this point in the history
  • Loading branch information
SaiyansKing committed Sep 12, 2021
1 parent 8dfa95b commit 98ec319
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion D3D11Engine/zCSkyController_Outdoor.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ class zCSkyController_Outdoor : public zCSkyController {

//float angle = GetMasterTime() * XM_2PI; // Get mastertime into rad, 0 and 12 are now at the horizon, 18 is in the sky
//angle += XM_PIDIV2; // 12 is now in the sky, 18 horizon
float angle = ((GetMasterTime() * timeScale - 0.3f) * 1.25f + 0.5f) * XM_2PI;
float angle;
if ( timeScale <= -1 ) {
angle = 4.71375f;
} else {
angle = ((GetMasterTime() * timeScale - 0.3f) * 1.25f + 0.5f) * XM_2PI;
}

constexpr XMVECTORF32 sunPos = { -60, 0, 100, 0 };
XMFLOAT3 rotAxis = XMFLOAT3( 1, 0, 0 );
Expand Down

0 comments on commit 98ec319

Please sign in to comment.