projects
/
csRadar.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
command line, multisampling, optimisations
[csRadar.git]
/
csrMath.h
diff --git
a/csrMath.h
b/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]);
}
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
// ==================================================================================================================
// 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];
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 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.000
00
1f;
v3f v0v1;
v3f v0v2;
v3f v0v1;
v3f v0v2;