projects
/
vg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
birds
[vg.git]
/
vg_m.h
diff --git
a/vg_m.h
b/vg_m.h
index 3c78466b68ca046f23890a14aaf033bf36f3be55..ee8b1074ce93bad2bdc96682544225198bd350e0 100644
(file)
--- a/
vg_m.h
+++ b/
vg_m.h
@@
-269,6
+269,11
@@
static inline void v3_add( v3f a, v3f b, v3f d )
d[0] = a[0]+b[0]; d[1] = a[1]+b[1]; d[2] = a[2]+b[2];
}
d[0] = a[0]+b[0]; d[1] = a[1]+b[1]; d[2] = a[2]+b[2];
}
+static inline void v3i_add( v3i a, v3i b, v3i d )
+{
+ d[0] = a[0]+b[0]; d[1] = a[1]+b[1]; d[2] = a[2]+b[2];
+}
+
static inline void v4_add( v4f a, v4f b, v4f d )
{
d[0] = a[0]+b[0];
static inline void v4_add( v4f a, v4f b, v4f d )
{
d[0] = a[0]+b[0];
@@
-282,6
+287,11
@@
static inline void v3_sub( v3f a, v3f b, v3f d )
d[0] = a[0]-b[0]; d[1] = a[1]-b[1]; d[2] = a[2]-b[2];
}
d[0] = a[0]-b[0]; d[1] = a[1]-b[1]; d[2] = a[2]-b[2];
}
+static inline void v3i_sub( v3i a, v3i b, v3i d )
+{
+ d[0] = a[0]-b[0]; d[1] = a[1]-b[1]; d[2] = a[2]-b[2];
+}
+
static inline void v3_mul( v3f a, v3f b, v3f d )
{
d[0] = a[0]*b[0]; d[1] = a[1]*b[1]; d[2] = a[2]*b[2];
static inline void v3_mul( v3f a, v3f b, v3f d )
{
d[0] = a[0]*b[0]; d[1] = a[1]*b[1]; d[2] = a[2]*b[2];
@@
-2036,6
+2046,7
@@
static int spherecast_triangle( v3f tri[3],
static inline float vg_randf(void)
{
static inline float vg_randf(void)
{
+ /* TODO: replace with our own rand */
return (float)rand()/(float)(RAND_MAX);
}
return (float)rand()/(float)(RAND_MAX);
}