summaryrefslogtreecommitdiff
path: root/model.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'model.hpp')
-rw-r--r--model.hpp17
1 files changed, 15 insertions, 2 deletions
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 <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