Removed all attempts to stop the sprite from appearing in portals. This may likely require a fundamental breakdown of the system itself in order to address the problem.

This commit is contained in:
Major Cooke 2021-12-06 02:13:40 -06:00 committed by Rachael Alexanderson
commit 046799db68
4 changed files with 2 additions and 69 deletions

View file

@ -669,22 +669,11 @@ public:
DVector3 Offset;
int Flags;
// Engine only.
// Used to do a backwards trace to disable rendering over portals.
bool isUsed;
DVector3 PlrPos,
CamPos;
double Distance;
sector_t *CamSec;
// Functions
FViewPosition()
{
Offset = PlrPos = CamPos = { 0,0,0 };
isUsed = false;
Distance = 0.0;
CamSec = nullptr;
Offset = { 0,0,0 };
Flags = 0;
}
void Set(DVector3 &off, int f = -1)
@ -699,16 +688,6 @@ public:
{
return Offset.isZero();
}
void ResetTraceInfo()
{
isUsed = false;
PlrPos = CamPos = {0,0,0};
Distance = 0.;
CamSec = nullptr;
}
bool TraceBack(AActor *Owner);
};
const double MinVel = EQUAL_EPSILON;

View file

@ -5441,43 +5441,8 @@ void P_AdjustViewPos(AActor *t1, DVector3 orig, DVector3 &campos, sector_t *&Cam
{
campos = trace.HitPos - trace.HitVector * 1 / 256.;
}
// DVector3 cpos = campos;
CameraSector = trace.Sector;
unlinked = trace.unlinked;
// Save the info for the renderers. Needed to disable sprites across portals.
VP->Distance = distance;
VP->isUsed = true;
}
struct EViewPosFinder
{
AActor *Owner;
};
static ETraceStatus TraceToOwner(FTraceResults &res, void *userdata)
{
// Try to guarantee hitting the owner if possible.
if (res.HitType != TRACE_HitActor)
return TRACE_Skip;
EViewPosFinder *data = (EViewPosFinder *)userdata;
ETraceStatus ret = (res.Actor == data->Owner) ? TRACE_Stop : TRACE_Skip;
return ret;
}
bool FViewPosition::TraceBack(AActor *Owner)
{
if (!isUsed || !Owner)
return false;
DVector3 vvec = (CamPos - PlrPos).Unit() * -1.0;
FTraceResults res;
EViewPosFinder TrcBack = {Owner};
bool ret = Trace(CamPos, CamSec, vvec, Distance, 0, 0, nullptr, res, TRACE_ReportPortals, TraceToOwner, &TrcBack);
return ret;
}
//==========================================================================