Fixed decails (RecursiveHullCheck bug)
This commit is contained in:
parent
bf614426f3
commit
b3c239b585
2 changed files with 13 additions and 5 deletions
6
r_part.c
6
r_part.c
|
@ -54,7 +54,7 @@ ParticleEffect_t *particleEffects;
|
||||||
vec3_t r_pright, r_pup, r_ppn;
|
vec3_t r_pright, r_pup, r_ppn;
|
||||||
|
|
||||||
// <AWE> missing prototypes
|
// <AWE> missing prototypes
|
||||||
extern qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace);
|
extern qboolean SV_RecursiveHullCheck (model_t *m, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace);
|
||||||
|
|
||||||
|
|
||||||
ParticleEffect_t *ParticleEffectDefinedForName(const char *name);
|
ParticleEffect_t *ParticleEffectDefinedForName(const char *name);
|
||||||
|
@ -1409,10 +1409,12 @@ void R_DrawParticles (void)
|
||||||
|
|
||||||
memset (&trace, 0, sizeof(trace));
|
memset (&trace, 0, sizeof(trace));
|
||||||
trace.fraction = 1;
|
trace.fraction = 1;
|
||||||
SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, p->org, neworg, &trace);
|
SV_RecursiveHullCheck (cl.worldmodel, 0, 0, 1, p->org, neworg, &trace);
|
||||||
|
|
||||||
if (trace.fraction < 1) {
|
if (trace.fraction < 1) {
|
||||||
|
|
||||||
vec3_t tangent;
|
vec3_t tangent;
|
||||||
|
|
||||||
//calc reflection vector
|
//calc reflection vector
|
||||||
d = DotProduct (p->vel, trace.plane.normal);
|
d = DotProduct (p->vel, trace.plane.normal);
|
||||||
VectorMA (p->vel, -2*d, trace.plane.normal, p->vel);
|
VectorMA (p->vel, -2*d, trace.plane.normal, p->vel);
|
||||||
|
|
12
world.c
12
world.c
|
@ -633,14 +633,14 @@ extern vec3_t trace_mins, trace_maxs;
|
||||||
extern vec3_t trace_extents;
|
extern vec3_t trace_extents;
|
||||||
extern int trace_contents;
|
extern int trace_contents;
|
||||||
extern qboolean trace_ispoint; // optimized case
|
extern qboolean trace_ispoint; // optimized case
|
||||||
void CM_RecursiveHullCheck (int num, float p1f, float p2f, vec3_t p1, vec3_t p2);
|
void CM_RecursiveHullCheck (model_t *m, int num, float p1f, float p2f, vec3_t p1, vec3_t p2);
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
SV_RecursiveHullCheck
|
SV_RecursiveHullCheck
|
||||||
|
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace)
|
qboolean SV_RecursiveHullCheck (model_t *m, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace)
|
||||||
{
|
{
|
||||||
VectorCopy (p1, trace_start);
|
VectorCopy (p1, trace_start);
|
||||||
VectorCopy (p2, trace_end);
|
VectorCopy (p2, trace_end);
|
||||||
|
@ -650,8 +650,14 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec
|
||||||
trace_contents = CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_MONSTERCLIP;
|
trace_contents = CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_MONSTERCLIP;
|
||||||
|
|
||||||
trace_trace = *trace;
|
trace_trace = *trace;
|
||||||
CM_RecursiveHullCheck (0, p1f, p2f, p1, p2);
|
|
||||||
|
CM_RecursiveHullCheck (m, 0, p1f, p2f, p1, p2);
|
||||||
*trace = trace_trace;
|
*trace = trace_trace;
|
||||||
|
|
||||||
|
trace->endpos[0] = p1[0] + trace->fraction * (p2[0] - p1[0]);
|
||||||
|
trace->endpos[1] = p1[1] + trace->fraction * (p2[1] - p1[1]);
|
||||||
|
trace->endpos[2] = p1[2] + trace->fraction * (p2[2] - p1[2]);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
/*
|
/*
|
||||||
dclipnode_t *node;
|
dclipnode_t *node;
|
||||||
|
|
Loading…
Reference in a new issue