A threaded VCL component utilizing Raylib for 3D physics sandbox rendering with Kraft physics.
✨ Features
Architecture & Performance
Threaded Game Loop: The entire Raylib context, rendering, and physics logic are separated from the main UI thread to prevent VCL freezing.
VCL Embedding: The native Raylib window is dynamically parented to a TWinControl using the Windows API, allowing seamless integration into Delphi forms.
Hardened Physics Solver: Kraft physics engine settings are tuned with high iteration counts (16 velocity, 12 position) to prevent rigid bodies from sticking or freezing in mid-air.
Custom Frame Timing: Uses QueryPerformanceCounter for microsecond-accurate frame pacing and sleeping.
Visuals & Gameplay
Native Material Texturing: Bypasses R3D limitations by generating a 3D plane mesh and applying a loaded texture (wallpaper.jpg) directly via Raylib's TMaterial system.
Animated HUD Slide-In: The GUI menu starts off-screen and smoothly slides into view 1 second after initialization.
Cube Spawn Queue (Rain Effect): Spawning 30 cubes doesn't happen in a single frame. Cubes are queued and spawned sequentially (one every 0.04s) to prevent physics engine overloads and overlapping collisions.
Teal Collision Glow: Cubes emit a soft teal glow upon impact. This is filtered by velocity—cubes resting on the floor won't flicker, only those actively hitting surfaces with > 2.0 m/s force.
Fade-In Spawning: Newly spawned cubes fade into existence smoothly instead of popping in abruptly.
🎮 Controls
Left Mouse Button (Click & Drag): Grab a cube and throw it around. The physics engine will apply velocity to drag it across the floor.
Right Mouse Button (Hold & Move): Orbit the camera around the center of the sandbox.
Mouse Wheel (Scroll): Zoom the camera in and out.
SPAWN 30 CUBES Button: Drops 30 dynamic cubes from the sky.
CLEAR ALL Button: Removes all active cubes from the scene.
Raylib sandbox with jolt physics: JoltPhysics4Delphi https://github.com/LaMitaOne/JoltPhysics4Delphi