summaryrefslogtreecommitdiff
path: root/src/entity.cuh
diff options
context:
space:
mode:
authorbrett weiland <brettsweiland@gmail.com>2024-06-01 01:36:18 -0500
committerbrett weiland <brettsweiland@gmail.com>2024-06-01 01:36:18 -0500
commitb0dd97ee6bf8d5daa587da40ad941efac68152df (patch)
treef162d32767e0b0f84bed284f6e8ab2c5309ff248 /src/entity.cuh
parent093200a449ea38952de52012e324036c106e294b (diff)
got raycasting laid out
Diffstat (limited to 'src/entity.cuh')
-rw-r--r--src/entity.cuh30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/entity.cuh b/src/entity.cuh
new file mode 100644
index 0000000..b086644
--- /dev/null
+++ b/src/entity.cuh
@@ -0,0 +1,30 @@
+#ifndef ENTITY_H
+#define ENTITY_H
+#include "common.cuh"
+
+//we could make a template to allow double percision, but start with float
+//idk how nessesary it is yet so I'll go ahead.
+//I know I needed it for zoomin far into the mandelbrot ig, so it's not
+//out of the question
+class Entity {
+ public:
+ __device__ Entity() : pos_(make_vect3(0)), rot_(make_vect3(0)), scale_(make_vect3(0)) {};
+ __device__ Entity(const vect3 pos, const vect3 rot, const vect3 scale) : pos_(pos), rot_(rot), scale_(scale) {};
+ __device__ Entity(const float3 pos) : pos_(pos), rot_(make_vect3(0)), scale_(make_vect3(0)) {};
+
+
+ vect3 get_pos() const { return pos_; }
+ vect3 get_rot() const { return rot_; }
+ vect3 get_scale() const { return scale_; }
+
+ __device__ void set_pos(const vect3 pos) { pos_ = pos; }
+ __device__ void set_rot(const vect3 rot) { rot_ = rot; }
+ __device__ void set_scale(const vect3 scale) { scale_ = scale; }
+
+ protected:
+ vect3 pos_;
+ vect3 rot_;
+ vect3 scale_;
+
+};
+#endif