Merge raymath and rlgl into main raylib module

This commit is contained in:
Not-Nik 2024-06-05 22:56:07 +02:00
parent 171c2e100c
commit c0d07991d1
Failed to generate hash of commit
15 changed files with 1012 additions and 68 deletions

View file

@ -1,7 +1,6 @@
// raylib-zig (c) Nikolas Wipper 2023
const rl = @import("raylib");
const rlm = @import("raymath");
const MAX_BUILDINGS = 100;
@ -69,12 +68,12 @@ pub fn main() anyerror!void {
}
// Limit camera rotation to 80 degrees (-40 to 40)
camera.rotation = rlm.clamp(camera.rotation, -40, 40);
camera.rotation = rl.math.clamp(camera.rotation, -40, 40);
// Camera zoom controls
camera.zoom += rl.getMouseWheelMove() * 0.05;
camera.zoom = rlm.clamp(camera.zoom, 0.1, 3.0);
camera.zoom = rl.math.clamp(camera.zoom, 0.1, 3.0);
// Camera reset (zoom and rotation)
if (rl.isKeyPressed(rl.KeyboardKey.key_r)) {