mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 19:20:46 +00:00
m32 aim: fixes a bug with polymer overwalls
git-svn-id: https://svn.eduke32.com/eduke32@1483 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0da3edba58
commit
03d92eb1d1
1 changed files with 25 additions and 9 deletions
|
@ -1970,22 +1970,38 @@ void polymer_alt_editorselect(void)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
{
|
{
|
||||||
_prplane *wp = &w->wall;
|
|
||||||
int8_t what;
|
int8_t what;
|
||||||
|
|
||||||
GLfloat *pl = wp->plane;
|
GLfloat *pl = NULL;
|
||||||
GLdouble a=pl[0], b=pl[1], c=pl[2], d=pl[3];
|
GLfloat nnormsq, nnorm, npl[3];
|
||||||
GLdouble nnormsq = a*a + b*b + c*c;
|
|
||||||
GLdouble nnorm = sqrt(nnormsq);
|
|
||||||
GLfloat t, svcoeff, dist;
|
GLfloat t, svcoeff, dist;
|
||||||
|
|
||||||
GLfloat npl[3] = {a/nnorm, b/nnorm, c/nnorm};
|
j = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (j==0 && (w->underover&1))
|
||||||
|
pl = w->wall.plane;
|
||||||
|
else if (j==1 && (w->underover&2))
|
||||||
|
pl = w->over.plane;
|
||||||
|
else if (j==2 && ((wal->cstat&16) || (wal->cstat&32)))
|
||||||
|
pl = w->mask.plane;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
while (j<3 && (!pl || dot3f(pl,pl)==0.0));
|
||||||
|
|
||||||
|
if (!pl || (nnormsq = dot3f(pl,pl))==0.0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
nnorm = sqrt(nnormsq);
|
||||||
|
npl[0]=pl[0]/nnorm;
|
||||||
|
npl[1]=pl[1]/nnorm;
|
||||||
|
npl[2]=pl[2]/nnorm;
|
||||||
|
|
||||||
t = dot3f(pl,scrv);
|
t = dot3f(pl,scrv);
|
||||||
if (t==0)
|
if (t==0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
svcoeff = -(dot3f(pl,scr)+d)/t;
|
svcoeff = -(dot3f(pl,scr)+pl[3])/t;
|
||||||
if (svcoeff < 0)
|
if (svcoeff < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -2004,10 +2020,10 @@ void polymer_alt_editorselect(void)
|
||||||
tp[1] = scry + svcoeff*scrv[1];
|
tp[1] = scry + svcoeff*scrv[1];
|
||||||
tp[2] = scrz + svcoeff*scrv[2];
|
tp[2] = scrz + svcoeff*scrv[2];
|
||||||
|
|
||||||
pp=wp;
|
pp=&w->wall;
|
||||||
if (what==0)
|
if (what==0)
|
||||||
{
|
{
|
||||||
if (wal->nextsector>=0 && !(w->underover&1))
|
if (!(w->underover&1))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (what==1)
|
else if (what==1)
|
||||||
|
|
Loading…
Reference in a new issue