summaryrefslogtreecommitdiff
path: root/sphere.cuh
diff options
context:
space:
mode:
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