]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix dodgy use of plane.normal[3] as alias to plane.dist using a union.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Feb 2015 08:46:35 +0000 (08:46 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Feb 2015 08:46:35 +0000 (08:46 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12159 d7cf8633-e32d-0410-b094-e92efae38249

collision.h

index f4f476177f03bed1e619f4c8c0752a1d468ecc8c..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;
 
@@ -76,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;