]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - collision.h
Fix a mdfour.c oops, sorry. Forgot the argument.
[xonotic/darkplaces.git] / collision.h
index afc12bc0a2c9bb05f44f996f9658b398d89799de..70fbd48551bd90cd69a3e54bd1c0fb7dd1d0d677 100644 (file)
@@ -2,10 +2,14 @@
 #ifndef COLLISION_H
 #define COLLISION_H
 
-typedef struct plane_s
+typedef union plane_s
 {
-       vec3_t  normal;
-       float   dist;
+       struct
+       {
+               vec3_t  normal;
+               vec_t   dist;
+       };
+       vec4_t dist_and_normal;
 }
 plane_t;
 
@@ -27,12 +31,9 @@ typedef struct trace_s
        // (set only by Q1BSP tracing)
        int inwater;
        // fraction of the total distance that was traveled before impact
+       // in case of impact this is actually nudged a bit off the surface
        // (1.0 = did not hit anything)
        double fraction;
-       // like fraction but is not nudged away from the surface (better for
-       // comparisons between two trace structs, as only one nudge for the final
-       // result is ever needed)
-       double realfraction;
        // final position of the trace (simply a point between start and end)
        double endpos[3];
        // surface normal at impact (not really correct for edge collisions)
@@ -79,8 +80,15 @@ typedef struct colplanef_s
 {
        const struct texture_s *texture;
        int q3surfaceflags;
-       vec3_t normal;
-       vec_t dist;
+       union
+       {
+               struct
+               {
+                       vec3_t normal;
+                       vec_t dist;
+               };
+               vec4_t normal_and_dist;
+       };
 }
 colplanef_t;
 
@@ -182,6 +190,5 @@ extern cvar_t collision_impactnudge;
 extern cvar_t collision_extendtracelinelength;
 extern cvar_t collision_extendtraceboxlength;
 extern cvar_t collision_extendmovelength;
-extern cvar_t collision_prefernudgedfraction;
 
 #endif