From 014077c89bb3c50718d56430f387109ad43508b6 Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 13 Jan 2025 20:56:13 +1100 Subject: basic picking and debug rendering --- model.hpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'model.hpp') diff --git a/model.hpp b/model.hpp index 204b73c..190b2b6 100644 --- a/model.hpp +++ b/model.hpp @@ -5,6 +5,8 @@ #include "maths.hpp" #include "video.hpp" +#include + 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 pick( + const Camera& cam, + int w, + int h, + int mx, + int my + ); }; #endif -- cgit v1.2.3-54-g00ecf