projects
/
fishladder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
console viewer
[fishladder.git]
/
vg
/
vg_m.h
diff --git
a/vg/vg_m.h
b/vg/vg_m.h
index 0c4ba358593af4927a59f6e6335906a5cf0e653c..690683710d816a9bec4ec8444b29d54b58b9e007 100644
(file)
--- a/
vg/vg_m.h
+++ b/
vg/vg_m.h
@@
-17,6
+17,10
@@
static inline float vg_maxf( float a, float b )
return a > b? a: b;
}
return a > b? a: b;
}
+#define VG_MIN( A, B ) ((A)<(B)?(A):(B))
+#define VG_MAX( A, B ) ((A)>(B)?(A):(B))
+
+// Hopefully deprecate this!!
static inline int vg_min( int a, int b )
{
return a < b? a: b;
static inline int vg_min( int a, int b )
{
return a < b? a: b;
@@
-73,6
+77,12
@@
static inline void v2_muls( v2f a, float s, v2f d )
d[0] = a[0]*s; d[1] = a[1]*s;
}
d[0] = a[0]*s; d[1] = a[1]*s;
}
+static inline void v2_divs( v2f a, float s, v2f d )
+{
+ d[0] = a[0]/s; d[1] = a[1]/s;
+}
+
+
static inline void v2_mul( v2f a, v2f b, v2f d )
{
d[0] = a[0]*b[0]; d[1] = a[1]*b[1];
static inline void v2_mul( v2f a, v2f b, v2f d )
{
d[0] = a[0]*b[0]; d[1] = a[1]*b[1];
@@
-83,6
+93,11
@@
static inline void v2_div( v2f a, v2f b, v2f d )
d[0] = a[0]/b[0]; d[1] = a[1]/b[1];
}
d[0] = a[0]/b[0]; d[1] = a[1]/b[1];
}
+static inline void v2_muladds( v2f a, v2f b, float s, v2f d )
+{
+ d[0] = a[0]+b[0]*s; d[1] = a[1]+b[1]*s;
+}
+
// Vector 3
// ==================================================================================================================
// Vector 3
// ==================================================================================================================