summaryrefslogtreecommitdiff
path: root/tangle/LLBM/sdf.h
diff options
context:
space:
mode:
Diffstat (limited to 'tangle/LLBM/sdf.h')
-rw-r--r--tangle/LLBM/sdf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tangle/LLBM/sdf.h b/tangle/LLBM/sdf.h
index 656c109..52db8cf 100644
--- a/tangle/LLBM/sdf.h
+++ b/tangle/LLBM/sdf.h
@@ -63,6 +63,15 @@ __device__ __host__ float sintersect(float a, float b, float k) {
return lerp(b, a, h) + k*h*(1.f-h);
}
+__device__ __host__ float3 twisted(float3 p, float k) {
+ float c = cos(k*p.y);
+ float s = sin(k*p.y);
+ float3 q = make_float3(0,0,p.y);
+ q.x = p.x*c + p.z*-s;
+ q.y = p.x*s + p.z* c;
+ return q;
+}
+
}
template <typename SDF>