Nimbin[12]?SDL & Graphics / sdl_runtime_compiler / src/entities/world.hpp

sdl_runtime_compiler git · main

SDL3 game for running and compiling code at runtime

sdl3 c++ compiler dlopen cmake · first commit 2026-04-19 · last commit 2026-07-03 (3 months ago) · synced 3 days ago · upstream: git.ide3.de/hsnr/sdl-runtime-compiler

C++ 72.3% C 26.2%
git clone https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler/archive/sdl_runtime_compiler.tar.gz
src/entities/world.hpp 975 B · 50 lines raw
#pragma once

#include <array>

#include "utils/globals.hpp"
#include "entities/player.hpp"
#include "rendering/floor_surface.hpp"
#include "rendering/gl_renderer.hpp"
#include "wall/wall.hpp"

namespace
Nimbin
{

struct SweepResult
{
    bool hit_x{};
    bool hit_y{};
    bool hit_z{};
    Vec3 pos;
    Vec3 vel;
};


namespace Floor { struct Surface; }

class World
{
    Wall::Surfaces _wall_surfaces;
    cpputils::unique_ptr<Floor::Surface> _floor_surface;
public:
    World();

    void draw(GlRenderer& gl, const Camera& camera, const Light& light) const;

    PlayerCollision
         resolve_Player(const Player& player) const;

    Vec3 get_SpawnPoint() const;

    template <typename T = float>
    inline static T
         get_FloorY()   { return static_cast<T>(-Config::Game::world_box_scale); }

    template <typename T = float>
    inline static T
         get_BoxScale() { return static_cast<T>(Config::Game::world_box_scale); }
};

} // namespace Nimbin