diff options
author | quou <quou@disroot.org> | 2025-01-13 20:56:13 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-01-13 20:56:13 +1100 |
commit | 014077c89bb3c50718d56430f387109ad43508b6 (patch) | |
tree | 02fa1ab03218fc22de4d875b7d8d593cbc19d67c /model.hpp | |
parent | 4d5cdc97a044a39fabbfb980b2e48a817a6e485f (diff) |
basic picking and debug rendering
Diffstat (limited to 'model.hpp')
-rw-r--r-- | model.hpp | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -5,6 +5,8 @@ #include "maths.hpp" #include "video.hpp" +#include <tuple> + struct Material : public Asset { float metalness, roughness, ao; v3f albedo; @@ -93,9 +95,11 @@ struct Model_Instance { Buffer_Id mat; m4f transform; Model* m; + AABB* bounds; - void init(Device* dev, Model* model); - void destroy(Device* dev); + void init(Device* dev, Heap* h, Model* model); + void destroy(Device* dev, Heap* h); + void update(); void update_cbuffers(Device* dev, const Camera& cam); void render( Device* dev, @@ -104,9 +108,11 @@ struct Model_Instance { Texture_Id env_cubemap, Sampler_Id sampler ); + int pick(const v3f& o, const v3f& d); }; struct Model_Scene { + Heap* h; Model_Instance* instances; int count, max; Sampler_Id sampler; @@ -124,6 +130,13 @@ struct Model_Scene { Texture_Id env_cubemap, Sampler_Id sampler ); + std::pair<Model_Instance*, int> pick( + const Camera& cam, + int w, + int h, + int mx, + int my + ); }; #endif |