summaryrefslogtreecommitdiff
path: root/scene.cuh
diff options
context:
space:
mode:
authorBrett Weiland <brettsweiland@gmail.com>2024-05-27 20:56:59 -0500
committerBrett Weiland <brettsweiland@gmail.com>2024-05-27 20:56:59 -0500
commit093200a449ea38952de52012e324036c106e294b (patch)
tree6030076eb894ca100d6aa0d6550ab56955e7fb2f /scene.cuh
parent7e9e2150619c05f9e8a74432e596b11f373518b9 (diff)
boutta switch away from templates
Diffstat (limited to 'scene.cuh')
-rw-r--r--scene.cuh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scene.cuh b/scene.cuh
new file mode 100644
index 0000000..31bb99f
--- /dev/null
+++ b/scene.cuh
@@ -0,0 +1,32 @@
+#ifndef SCENE_H
+#define SCENE_H
+
+#include "common.cuh"
+#include "sphere.cuh"
+#include "render_object.cuh"
+#include "include/helper_math.h"
+
+template <class T> class camera;
+
+//when we get animations with multiple scenes, we'll make this a virtual function
+//with array of DE objects and cam
+template <class T>
+class scene {
+ using T3 = typename vect_t3<T>::vect_t;
+ public:
+ //__device__ void render(uint8_t *image) { cam.render(); };
+ __device__ render_object<T> **get_objs() { return objs; }
+ __device__ render_object<T> **get_image() { return image; }
+ private:
+ camera<T> cam = camera<T>();
+ sphere<T> sp1 = sphere<T>(vect_create<T3>(0,0.4,-5));
+ sphere<T> sp2 = sphere<T>(vect_create<T3>(0,-0.4,-5));
+ protected:
+ //idk why I need to specify the size... why can't the compiler figure that out?
+ render_object<T> *objs[3] = {&sp1, &sp2, NULL};
+ uint8_t *image;
+};
+
+#include "camera.cuh"
+
+#endif