From df4b30ecc3f77f8e9b587e2fb6d5f149e862e72e Mon Sep 17 00:00:00 2001 From: emil28092005 Date: Thu, 18 Jun 2026 20:15:36 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20light=20moves=20in=20chaotic=20circle?= =?UTF-8?q?=20=E2=80=94=20dynamic=20shadows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Light position animated with sin/cos combinations at different frequencies - XZ plane: figure-8 pattern (sin*0.7 + cos*0.3, cos*0.6 + sin*0.4) - Y: oscillates 7-17 with sin*0.5 - Shadows move dynamically as light orbits the scene --- src/CortexEngine.App/Program.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/CortexEngine.App/Program.cs b/src/CortexEngine.App/Program.cs index 99b7a5e..704a5be 100644 --- a/src/CortexEngine.App/Program.cs +++ b/src/CortexEngine.App/Program.cs @@ -70,6 +70,7 @@ class Program var frames = 0; var lastFpsTime = 0.0; var timing = new Timing(); + var totalTime = 0.0f; while (!window.ShouldClose) { @@ -111,6 +112,7 @@ class Program } cameraController.Update(input, (float)timing.DeltaTime); + totalTime += (float)timing.DeltaTime; var toInit = new List<(Entity, RigidBody, Transform)>(); world.Each((Entity e, ref RigidBody rb, ref Transform t) => @@ -130,6 +132,19 @@ class Program physicsWorld.Update((float)timing.DeltaTime); physicsWorld.SyncTransforms(world); + // Move light in a chaotic circle + var lightEntity = world.Lookup("MainLight"); + if ((ulong)lightEntity.Id != 0) + { + var t = totalTime; + var lx = MathF.Sin(t * 0.7f) * 8f + MathF.Cos(t * 0.3f) * 3f; + var ly = 12f + MathF.Sin(t * 0.5f) * 5f; + var lz = MathF.Cos(t * 0.6f) * 8f + MathF.Sin(t * 0.4f) * 3f; + var lt = lightEntity.Get(); + lt.Position = new Vector3(lx, ly, lz); + lightEntity.Set(lt); + } + var processed = queue.ProcessPending(); if (processed > 0) Console.WriteLine($"[App] Processed {processed} AI command(s)");