]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mathlib.h
r_nearclip cvar
[xonotic/darkplaces.git] / mathlib.h
index d5f6ee070da70d43541add0c8e6ad3528989e79e..b40e6f33739271ea23938b779b841c63f917da33 100644 (file)
--- a/mathlib.h
+++ b/mathlib.h
@@ -88,7 +88,11 @@ extern vec3_t vec3_origin;
 #define VectorReflect(a,r,b,c) do{double d;d = DotProduct((a), (b)) * -(1.0 + (r));VectorMA((a), (d), (b), (c));}while(0)
 #define BoxesOverlap(a,b,c,d) ((a)[0] <= (d)[0] && (b)[0] >= (c)[0] && (a)[1] <= (d)[1] && (b)[1] >= (c)[1] && (a)[2] <= (d)[2] && (b)[2] >= (c)[2])
 
-#define TriangleNormal(a,b,c,n) ((n)[0] = ((a)[1] - (b)[1]) * ((c)[2] - (b)[2]) - ((a)[2] - (b)[2]) * ((c)[1] - (b)[1]), (n)[1] = ((a)[2] - (b)[2]) * ((c)[0] - (b)[0]) - ((a)[0] - (b)[0]) * ((c)[2] - (b)[2]), (n)[2] = ((a)[0] - (b)[0]) * ((c)[1] - (b)[1]) - ((a)[1] - (b)[1]) * ((c)[0] - (b)[0]))
+#define TriangleNormal(a,b,c,n) ( \
+       (n)[0] = ((a)[1] - (b)[1]) * ((c)[2] - (b)[2]) - ((a)[2] - (b)[2]) * ((c)[1] - (b)[1]), \
+       (n)[1] = ((a)[2] - (b)[2]) * ((c)[0] - (b)[0]) - ((a)[0] - (b)[0]) * ((c)[2] - (b)[2]), \
+       (n)[2] = ((a)[0] - (b)[0]) * ((c)[1] - (b)[1]) - ((a)[1] - (b)[1]) * ((c)[0] - (b)[0]) \
+       )
 
 // fast PointInfrontOfTriangle
 // subtracts v1 from v0 and v2, combined into a crossproduct, combined with a
@@ -176,8 +180,8 @@ float VectorNormalizeLength2 (vec3_t v, vec3_t dest);               // returns vector length
 #define NUMVERTEXNORMALS       162
 extern float m_bytenormals[NUMVERTEXNORMALS][3];
 
-qbyte NormalToByte(const vec3_t n);
-void ByteToNormal(qbyte num, vec3_t n);
+unsigned char NormalToByte(const vec3_t n);
+void ByteToNormal(unsigned char num, vec3_t n);
 
 void R_ConcatRotations (const float in1[3*3], const float in2[3*3], float out[3*3]);
 void R_ConcatTransforms (const float in1[3*4], const float in2[3*4], float out[3*4]);
@@ -204,13 +208,13 @@ void BoxPlaneCornerDistances_Separate(const vec3_t emins, const vec3_t emaxs, co
 #define PlaneDiff(point,plane) (((plane)->type < 3 ? (point)[(plane)->type] : DotProduct((point), (plane)->normal)) - (plane)->dist)
 
 // LordHavoc: minimal plane structure
-typedef struct
+typedef struct tinyplane_s
 {
        float normal[3], dist;
 }
 tinyplane_t;
 
-typedef struct
+typedef struct tinydoubleplane_s
 {
        double normal[3], dist;
 }