#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;
// (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)
{
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;
extern cvar_t collision_extendtracelinelength;
extern cvar_t collision_extendtraceboxlength;
extern cvar_t collision_extendmovelength;
-extern cvar_t collision_prefernudgedfraction;
#endif