Squashed commit of the following:
commit 6ecd831eb45a8258995c02664450c3ca8cfe5b48 Merge: a4fb1f61cafbd7f7a2Author: Marisa Kirisame <marisa@sayachan.org> Date: Sun Jul 28 22:02:19 2019 +0200 Merge branch 'master' of github.com:coelckers/gzdoom into f3dfloor_export commit a4fb1f61c0532d3a6051d4c1fca4ac72ec33e060 Author: Marisa Kirisame <marisa@sayachan.org> Date: Fri Jul 12 15:43:25 2019 +0200 Renamed EFFloorType enum in ZScript to the more descriptive EF3DFloorFlags commit 9ad1c3b5625d53c06229be2a94d44fa0f36f41fd Author: Marisa Kirisame <marisa@sayachan.org> Date: Sun Jul 7 20:25:31 2019 +0200 Add bounds checks to Get3DFloor/GetAttached commit dd2a7956a887b92ed24ce5e79f10b1a445664d6c Author: Marisa Kirisame <marisa@sayachan.org> Date: Sun Jul 7 17:13:44 2019 +0200 Correct handling of 3d floor plane texture getting. commit 9b748287892c8fdee9ac67019bf1f66bc4b69eab Author: Marisa Kirisame <marisa@sayachan.org> Date: Sun Jul 7 16:14:45 2019 +0200 Implemented requested changes to F3DFloor exports. * Getters for ffloors/attached arrays. * Getter for 3D floor top/bottom texture. commit 6a1482bb0637a70890629e4c13e8759c7a3673f3 Author: Marisa Kirisame <marisa@sayachan.org> Date: Sat Jul 6 13:42:52 2019 +0200 Renamed exported extsector pointer in Sector struct to something more descriptive. commit 7c6783d43b898cbd7a01fb2191fd401ed8e8c300 Merge: ff64e04b28d36f0a0cAuthor: Marisa Kirisame <marisa@sayachan.org> Date: Mon Apr 29 12:40:44 2019 +0200 Merge branch 'master' into f3dfloor_export commit ff64e04b251f23325d2f72bc25c59f34b4cab6fa Merge: a909473925b6bae409Author: Marisa Kirisame <marisa@sayachan.org> Date: Sun Apr 21 16:56:18 2019 +0200 Merge branch 'master' into f3dfloor_export commit a90947392a27eb1c2dac7005614592ec2f410274 Author: Marisa Kirisame <marisa@sayachan.org> Date: Mon Feb 4 17:47:25 2019 +0100 Export F3DFloor structure and related data. Small changes to Trace code to better use this struct.
This commit is contained in:
parent
0535961a7a
commit
bcef440511
4 changed files with 165 additions and 5 deletions
|
|
@ -901,6 +901,41 @@ bool FTraceInfo::TraceTraverse (int ptflags)
|
|||
Results->Distance = MaxDist;
|
||||
Results->Fraction = 1.;
|
||||
}
|
||||
|
||||
// [MK] set 3d floor on plane hits (if any)
|
||||
// modders will need this to get accurate plane normals on slopes
|
||||
if (Results->HitType == TRACE_HitFloor)
|
||||
{
|
||||
double secbottom = Results->Sector->floorplane.ZatPoint(Results->HitPos);
|
||||
for (auto rover : Results->Sector->e->XFloor.ffloors)
|
||||
{
|
||||
if (!(rover->flags&FF_EXISTS))
|
||||
continue;
|
||||
double ff_top = rover->top.plane->ZatPoint(Results->HitPos);
|
||||
if (fabs(ff_top-secbottom) < EQUAL_EPSILON)
|
||||
continue;
|
||||
if (fabs(ff_top-Results->HitPos.Z) > EQUAL_EPSILON)
|
||||
continue;
|
||||
Results->ffloor = rover;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (Results->HitType == TRACE_HitCeiling)
|
||||
{
|
||||
double sectop = Results->Sector->ceilingplane.ZatPoint(Results->HitPos);
|
||||
for (auto rover : Results->Sector->e->XFloor.ffloors)
|
||||
{
|
||||
if (!(rover->flags&FF_EXISTS))
|
||||
continue;
|
||||
double ff_bottom = rover->bottom.plane->ZatPoint(Results->HitPos);
|
||||
if (fabs(ff_bottom-sectop) < EQUAL_EPSILON)
|
||||
continue;
|
||||
if (fabs(ff_bottom-Results->HitPos.Z) > EQUAL_EPSILON)
|
||||
continue;
|
||||
Results->ffloor = rover;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Results->HitType != TRACE_HitNone;
|
||||
}
|
||||
|
||||
|
|
@ -1008,6 +1043,7 @@ DEFINE_FIELD_X(TraceResults, FTraceResults, Side)
|
|||
DEFINE_FIELD_X(TraceResults, FTraceResults, Tier)
|
||||
DEFINE_FIELD_X(TraceResults, FTraceResults, unlinked)
|
||||
DEFINE_FIELD_X(TraceResults, FTraceResults, HitType)
|
||||
DEFINE_FIELD_X(TraceResults, FTraceResults, ffloor)
|
||||
DEFINE_FIELD_X(TraceResults, FTraceResults, CrossedWater)
|
||||
DEFINE_FIELD_X(TraceResults, FTraceResults, CrossedWaterPos)
|
||||
DEFINE_FIELD_X(TraceResults, FTraceResults, Crossed3DWater)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue