wall primitives

This commit is contained in:
2026-04-01 12:16:59 -03:00
parent 339fe842fb
commit bf9c2fd8cc
8 changed files with 10 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
#include <exception>
#include <glm/trigonometric.hpp>
#include <limits>
#include <print>
#include <ranges>
#include "glm/ext/matrix_clip_space.hpp"
@@ -98,12 +99,18 @@ engine::engine()
::load_scene_to_renderer(renderer, level_border)) {}
void engine::run() {
auto boxes = load_glb("../assets/models/boxes.glb");
auto ids = ::load_scene_to_renderer(renderer, boxes);
while (!display.should_close()) {
try {
const auto [map_min, map_max] = ::bounds_of(level_border);
const auto [view, projection] = ::calculate_camera_matrices(
map_min, map_max, 1920.0f / 1080.0f, 3.0f);
renderer.render(level_border_render_ids, view, projection);
auto all_ids = level_border_render_ids;
all_ids.insert(all_ids.end(), ids.begin(), ids.end());
renderer.render(all_ids, view, projection);
} catch (const vuk::VkException &ex) {
if (ex.what() != std::string("Out of date.")) {
std::rethrow_exception(std::current_exception());