command line, multisampling, optimisations
[csRadar.git] / csrMath.h
index fae268daf0e2bf3e09784cec494018698b1aba5a..31891f8cd682758faa0c897a6eb758f4f5584c2a 100644 (file)
--- a/csrMath.h
+++ b/csrMath.h
@@ -63,9 +63,29 @@ void v2_maxv( v2f a, v2f b, v2f dest )
        dest[1] = csr_maxf(a[1], b[1]);
 }
 
+void v2_sub( v2f a, v2f b, v2f d )
+{
+       d[0] = a[0]-b[0]; d[1] = a[1]-b[1];
+}
+
+float v2_cross( v2f a, v2f b )
+{
+       return a[0] * b[1] - a[1] * b[0];
+}
+
+void v2_add( v2f a, v2f b, v2f d )
+{
+       d[0] = a[0]+b[0]; d[1] = a[1]+b[1];
+}
+
 // Vector 3
 // ==================================================================================================================
 
+void v3_zero( v3f a )
+{
+       a[0] = 0.f; a[1] = 0.f; a[2] = 0.f;
+}
+
 void v3_copy( v3f a, v3f b )
 {
        b[0] = a[0]; b[1] = a[1]; b[2] = a[2];
@@ -491,7 +511,7 @@ int csr_slabs( v3f box[2], v3f o, v3f id )
 
 float csr_ray_tri( v3f o, v3f d, v3f v0, v3f v1, v3f v2, float *u, float *v )
 {
-       float const k_cullEpsilon = 0.0001f;
+       float const k_cullEpsilon = 0.000001f;
 
        v3f v0v1;
        v3f v0v2;