summaryrefslogtreecommitdiff
path: root/src/linalg.h
diff options
context:
space:
mode:
authorAnthony LaTorre <telatorre@gmail.com>2011-05-13 01:03:42 -0400
committerAnthony LaTorre <telatorre@gmail.com>2011-05-13 01:03:42 -0400
commit519acb39bdb1df9869bb17bcc710108ac8c02983 (patch)
treebc4fd6f165df09feb7fdc0b166d38df144ebc9a2 /src/linalg.h
parent6996620497d0e6382df8e1cb0d07f6746ac3b0f3 (diff)
downloadchroma-519acb39bdb1df9869bb17bcc710108ac8c02983.tar.gz
chroma-519acb39bdb1df9869bb17bcc710108ac8c02983.tar.bz2
chroma-519acb39bdb1df9869bb17bcc710108ac8c02983.zip
added a bounding volume hierarchy
Diffstat (limited to 'src/linalg.h')
-rw-r--r--src/linalg.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/linalg.h b/src/linalg.h
index 593aa9d..fe6b1b2 100644
--- a/src/linalg.h
+++ b/src/linalg.h
@@ -113,4 +113,9 @@ __device__ __host__ float norm(const float3 &a)
return sqrtf(dot(a,a));
}
+__device__ __host__ float3 normalize(const float3 &a)
+{
+ return a/norm(a);
+}
+
#endif