mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-27 22:42:57 +00:00
- let Trace() be a bit smarter about checking 3D slopes. If one matches right up with the floor or ceiling at the line where the trace enters a sector, check a second point to see whether we deal with something inside valid sector bounds or not.
This commit is contained in:
parent
3aee8a3eee
commit
b443ac8f71
1 changed files with 22 additions and 0 deletions
|
@ -494,6 +494,17 @@ bool FTraceInfo::LineCheck(intercept_t *in, double dist, DVector3 hit)
|
||||||
// clip to the part of the sector we are in
|
// clip to the part of the sector we are in
|
||||||
if (hit.Z > ff_top)
|
if (hit.Z > ff_top)
|
||||||
{
|
{
|
||||||
|
// 3D floor height is the same as the floor height. We need to test a second spot to see if it is above or below
|
||||||
|
if (fabs(bf - ff_top) < EQUAL_EPSILON)
|
||||||
|
{
|
||||||
|
double cf = entersector->floorplane.ZatPoint(entersector->centerspot);
|
||||||
|
double ffc = rover->top.plane->ZatPoint(entersector->centerspot);
|
||||||
|
if (ffc > cf)
|
||||||
|
{
|
||||||
|
bf = ff_top - EQUAL_EPSILON;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// above
|
// above
|
||||||
if (bf < ff_top)
|
if (bf < ff_top)
|
||||||
{
|
{
|
||||||
|
@ -505,6 +516,17 @@ bool FTraceInfo::LineCheck(intercept_t *in, double dist, DVector3 hit)
|
||||||
}
|
}
|
||||||
else if (hit.Z < ff_bottom)
|
else if (hit.Z < ff_bottom)
|
||||||
{
|
{
|
||||||
|
// 3D floor height is the same as the ceiling height. We need to test a second spot to see if it is above or below
|
||||||
|
if (fabs(bc - ff_bottom) < EQUAL_EPSILON)
|
||||||
|
{
|
||||||
|
double cc = entersector->ceilingplane.ZatPoint(entersector->centerspot);
|
||||||
|
double fcc = rover->bottom.plane->ZatPoint(entersector->centerspot);
|
||||||
|
if (fcc < cc)
|
||||||
|
{
|
||||||
|
bc = ff_bottom + EQUAL_EPSILON;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//below
|
//below
|
||||||
if (bc > ff_bottom)
|
if (bc > ff_bottom)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue