summaryrefslogtreecommitdiff
path: root/sphere.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 /sphere.cuh
parent7e9e2150619c05f9e8a74432e596b11f373518b9 (diff)
boutta switch away from templates
Diffstat (limited to 'sphere.cuh')
-rw-r--r--sphere.cuh17
1 files changed, 17 insertions, 0 deletions
diff --git a/sphere.cuh b/sphere.cuh
new file mode 100644
index 0000000..33c77f2
--- /dev/null
+++ b/sphere.cuh
@@ -0,0 +1,17 @@
+#ifndef SPHERE_H
+#define SPHERE_H
+#include "render_object.cuh"
+template<class T> class sphere : public render_object<T> {
+ using render_object<T>::render_object;
+ using T3 = typename vect_t3<T>::vect_t;
+ public:
+ __device__ T distance_estimator(T3 point) const;
+ private:
+ T r_ = 1;
+};
+
+template <class T> __device__ T sphere<T>::distance_estimator(T3 point) const {
+ return length(point) - r_;
+}
+
+#endif