Finalize math constants and build v1.9.0

This commit is contained in:
Michael Howard 2026-04-23 16:43:32 -05:00
parent 704dbae342
commit 53e1c931ab
1 changed files with 2 additions and 2 deletions

View File

@ -897,7 +897,7 @@ int main(void)
float cycleLength = 300.0f;
if (currentState == GAMEPLAY) gameTime += GetFrameTime();
float timeOfDay = fmodf(gameTime, cycleLength) / cycleLength;
float sunAngle = timeOfDay * 2.0f * PI - PI/2.0f;
float sunAngle = timeOfDay * 2.0f * 3.14159f - 3.14159f/2.0f;
float dayFactor = (sinf(sunAngle) + 1.0f) / 2.0f;
float quickMix = (dayFactor - 0.5f) * 5.0f + 0.5f;
if (quickMix > 1.0f) quickMix = 1.0f;
@ -1782,7 +1782,7 @@ int main(void)
BeginMode3D(camera3D);
// Draw Sun and Moon (simple billboards or spheres far away)
Vector3 sunPos = { camera3D.position.x + cosf(sunAngle) * 100, camera3D.position.y + sinf(sunAngle) * 100, camera3D.position.z };
Vector3 moonPos = { camera3D.position.x + cosf(sunAngle + PI) * 100, camera3D.position.y + sinf(sunAngle + PI) * 100, camera3D.position.z };
Vector3 moonPos = { camera3D.position.x + cosf(sunAngle + 3.14159f) * 100, camera3D.position.y + sinf(sunAngle + 3.14159f) * 100, camera3D.position.z };
DrawSphere(sunPos, 5.0f, YELLOW);
DrawSphere(moonPos, 4.0f, LIGHTGRAY);