]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mathlib.h
added VectorBlend and Matrix4x4_Blend
[xonotic/darkplaces.git] / mathlib.h
index 3080d2ec2e8222feb58c38b807deab8df225adf2..c4d82865532b6bdffbccdbb9845c8fa452664b15 100644 (file)
--- a/mathlib.h
+++ b/mathlib.h
@@ -87,7 +87,8 @@ extern vec3_t vec3_origin;
                VectorScale(_v, _y, _v);\
        }\
 }
-#define VectorRandom(v) {do{(v)[0] = lhrandom(-1, 1);(v)[1] = lhrandom(-1, 1);(v)[2] = lhrandom(-1, 1);}while(DotProduct(v, v) > 1);}
+#define VectorRandom(v) do{(v)[0] = lhrandom(-1, 1);(v)[1] = lhrandom(-1, 1);(v)[2] = lhrandom(-1, 1);}while(DotProduct(v, v) > 1)
+#define VectorBlend(b1, b2, blend, c) do{float iblend = 1 - (blend);VectorMAM(iblend, b1, blend, b2, c);}while(0)
 
 /*
 // LordHavoc: quaternion math, untested, don't know if these are correct,