diff --git a/src/common/filesystem/source/file_zip.cpp b/src/common/filesystem/source/file_zip.cpp index 8351b714648..9f10d00a730 100644 --- a/src/common/filesystem/source/file_zip.cpp +++ b/src/common/filesystem/source/file_zip.cpp @@ -35,7 +35,6 @@ #include #include -#include #include "w_zip.h" #include "ancientzip.h" #include "resourcefile.h" diff --git a/src/common/rendering/hwrenderer/data/hw_vrmodes.cpp b/src/common/rendering/hwrenderer/data/hw_vrmodes.cpp index 4534829aba0..c51ce2ee901 100644 --- a/src/common/rendering/hwrenderer/data/hw_vrmodes.cpp +++ b/src/common/rendering/hwrenderer/data/hw_vrmodes.cpp @@ -146,27 +146,11 @@ float VREyeInfo::getShift() const return vr_swap_eyes ? -res : res; } -VSMatrix VREyeInfo::GetProjection(float fov, float aspectRatio, float fovRatio, bool iso_ortho) const +VSMatrix VREyeInfo::GetProjection(float fov, float aspectRatio, float fovRatio) const { VSMatrix result; - if (iso_ortho) // Orthographic projection for isometric viewpoint - { - double zNear = -1.0; // screen->GetZNear(); - double zFar = screen->GetZFar(); - - double fH = tan(DEG2RAD(fov) / 2) / fovRatio; - double fW = fH * aspectRatio * mScaleFactor; - double left = -fW; - double right = fW; - double bottom = -fH; - double top = fH; - - VSMatrix fmat(1); - fmat.ortho((float)left, (float)right, (float)bottom, (float)top, (float)zNear, (float)zFar); - return fmat; - } - else if (mShiftFactor == 0) + if (mShiftFactor == 0) { float fovy = (float)(2 * RAD2DEG(atan(tan(DEG2RAD(fov) / 2) / fovRatio))); result.perspective(fovy, aspectRatio, screen->GetZNear(), screen->GetZFar()); diff --git a/src/common/rendering/hwrenderer/data/hw_vrmodes.h b/src/common/rendering/hwrenderer/data/hw_vrmodes.h index 98928152018..26c9fd211ee 100644 --- a/src/common/rendering/hwrenderer/data/hw_vrmodes.h +++ b/src/common/rendering/hwrenderer/data/hw_vrmodes.h @@ -27,7 +27,7 @@ struct VREyeInfo float mShiftFactor; float mScaleFactor; - VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio, bool iso_ortho) const; + VSMatrix GetProjection(float fov, float aspectRatio, float fovRatio) const; DVector3 GetViewShift(float yaw) const; private: float getShift() const; diff --git a/src/playsim/actor.h b/src/playsim/actor.h index 6f58a995d11..901d45deb52 100644 --- a/src/playsim/actor.h +++ b/src/playsim/actor.h @@ -692,9 +692,6 @@ enum EViewPosFlags // [MC] Flags for SetViewPos. { VPSF_ABSOLUTEOFFSET = 1 << 1, // Don't include angles. VPSF_ABSOLUTEPOS = 1 << 2, // Use absolute position. - VPSF_ALLOWOUTOFBOUNDS = 1 << 3, // Allow viewpoint to go out of bounds (hardware renderer only). - VPSF_ORTHOGRAPHIC = 1 << 4, // Use orthographic projection. - VPSF_ISOMETRICSPRITES = 1 << 5, // Displace sprites towards camera and don't billboard (drawn from isometric perspective). }; enum EAnimOverrideFlags diff --git a/src/rendering/hwrenderer/hw_entrypoint.cpp b/src/rendering/hwrenderer/hw_entrypoint.cpp index 24c49777833..e80d7ef669a 100644 --- a/src/rendering/hwrenderer/hw_entrypoint.cpp +++ b/src/rendering/hwrenderer/hw_entrypoint.cpp @@ -163,11 +163,7 @@ sector_t* RenderViewpoint(FRenderViewpoint& mainvp, AActor* camera, IntRect* bou di->Viewpoint.FieldOfView = DAngle::fromDeg(fov); // Set the real FOV for the current scene (it's not necessarily the same as the global setting in r_viewpoint) // Stereo mode specific perspective projection - float inv_iso_dist = 1.0f; - bool iso_ortho = (camera->ViewPos != NULL) && (camera->ViewPos->Flags & VPSF_ORTHOGRAPHIC); - if (iso_ortho && (camera->ViewPos->Offset.XY().Length() > 0)) inv_iso_dist = 3.0f/camera->ViewPos->Offset.XY().Length(); - di->VPUniforms.mProjectionMatrix = eye.GetProjection(fov, ratio, fovratio * inv_iso_dist, iso_ortho); - + di->VPUniforms.mProjectionMatrix = eye.GetProjection(fov, ratio, fovratio); // Stereo mode specific viewpoint adjustment vp.Pos += eye.GetViewShift(vp.HWAngles.Yaw.Degrees()); di->SetupView(RenderState, vp.Pos.X, vp.Pos.Y, vp.Pos.Z, false, false); diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index d82b0972c3e..09db1101d1b 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -1,4 +1,4 @@ -// +// //--------------------------------------------------------------------------- // // Copyright(C) 2002-2016 Christoph Oelckers @@ -94,7 +94,7 @@ CUSTOM_CVAR(Int, gl_fuzztype, 0, CVAR_ARCHIVE) //========================================================================== // -// +// // //========================================================================== @@ -103,7 +103,7 @@ void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent) bool additivefog = false; bool foglayer = false; int rel = fullbright ? 0 : getExtraLight(); - auto &vp = di->Viewpoint; + auto &vp = di->Viewpoint; if (translucent) { @@ -336,7 +336,7 @@ void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent) //========================================================================== // -// +// // //========================================================================== @@ -391,7 +391,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp) return true; } - + // [BB] Billboard stuff const bool drawWithXYBillboard = ((particle && gl_billboard_particles && !(particle->flags & SPF_NO_XY_BILLBOARD)) || (!(actor && actor->renderflags & RF_FORCEYBILLBOARD) //&& di->mViewActor != nullptr @@ -453,7 +453,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp) float rollDegrees = doRoll ? Angles.Roll.Degrees() : 0; float angleRad = (FAngle::fromDeg(270.) - HWAngles.Yaw).Radians(); - // [fgsfds] Rotate the sprite about the sight vector (roll) + // [fgsfds] Rotate the sprite about the sight vector (roll) if (isWallSprite) { float yawvecX = Angles.Yaw.Cos(); @@ -489,13 +489,13 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp) } else // traditional "Y" billboard mode { - if (doRoll || !offset.isZero() || ((di->Viewpoint.camera->ViewPos != NULL) && (di->Viewpoint.camera->ViewPos->Flags & VPSF_ISOMETRICSPRITES))) + if (doRoll || !offset.isZero()) { mat.MakeIdentity(); if (!offset.isZero()) HandleSpriteOffsets(&mat, &HWAngles, &offset, false); - + if (doRoll) { // Compute center of sprite @@ -507,21 +507,11 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp) mat.Translate(-center.X, -center.Z, -center.Y); } - if ((di->Viewpoint.camera->ViewPos != NULL) && (di->Viewpoint.camera->ViewPos->Flags & VPSF_ISOMETRICSPRITES)) - { - float angleRad = (FAngle::fromDeg(270.) - HWAngles.Yaw).Radians(); - mat.Translate(center.X, center.Z, center.Y); - mat.Translate(0.0, z2 - center.Z, 0.0); - mat.Rotate(-sin(angleRad), 0, cos(angleRad), -HWAngles.Pitch.Degrees()); - mat.Translate(0.0, center.Z - z2, 0.0); - mat.Translate(-center.X, -center.Z, -center.Y); - } - v[0] = mat * FVector3(x1, z1, y1); v[1] = mat * FVector3(x2, z1, y2); v[2] = mat * FVector3(x1, z2, y1); v[3] = mat * FVector3(x2, z2, y2); - + } else { @@ -530,14 +520,14 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp) v[2] = FVector3(x1, z2, y1); v[3] = FVector3(x2, z2, y2); } - + } return false; } //========================================================================== // -// +// // //========================================================================== @@ -562,7 +552,7 @@ inline void HWSprite::PutSprite(HWDrawInfo *di, bool translucent) //========================================================================== // -// +// // //========================================================================== @@ -587,7 +577,7 @@ void HWSprite::CreateVertices(HWDrawInfo *di) //========================================================================== // -// +// // //========================================================================== @@ -626,7 +616,7 @@ void HWSprite::SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool transluc } z1=copySprite.z2=lightbottom; - vt=copySprite.vb=copySprite.vt+ + vt=copySprite.vb=copySprite.vt+ (lightbottom-copySprite.z1)*(copySprite.vb-copySprite.vt)/(z2-copySprite.z1); copySprite.PutSprite(di, translucent); put=true; @@ -636,7 +626,7 @@ void HWSprite::SplitSprite(HWDrawInfo *di, sector_t * frontsector, bool transluc //========================================================================== // -// +// // //========================================================================== @@ -721,7 +711,7 @@ void HWSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingp z1 -= difft; } } - if (diffb <= (0 - (float)gl_sclipthreshold)) // such a large displacement can't be correct! + if (diffb <= (0 - (float)gl_sclipthreshold)) // such a large displacement can't be correct! { // for living monsters standing on the floor allow a little more. if (!(thing->flags3&MF3_ISMONSTER) || (thing->flags&MF_NOGRAVITY) || (thing->flags&MF_CORPSE) || diffb < (-1.8*(float)gl_sclipthreshold)) @@ -736,7 +726,7 @@ void HWSprite::PerformSpriteClipAdjustment(AActor *thing, const DVector2 &thingp //========================================================================== // -// +// // //========================================================================== @@ -815,7 +805,7 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t if (thruportal == 1) vieworigin += di->Level->Displacements.getOffset(viewmaster->Sector->PortalGroup, sector->PortalGroup); if (fabs(vieworigin.X - vp.ActorPos.X) < 2 && fabs(vieworigin.Y - vp.ActorPos.Y) < 2) return; - // Necessary in order to prevent sprite pop-ins with viewpos and models. + // Necessary in order to prevent sprite pop-ins with viewpos and models. auto* sec = viewmaster->Sector; if (sec && !sec->PortalBlocksMovement(sector_t::ceiling)) { @@ -910,7 +900,6 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t { bool mirror = false; DAngle ang = (thingpos - vp.Pos).Angle(); - if((di->Viewpoint.camera->ViewPos != NULL) && (di->Viewpoint.camera->ViewPos->Flags & VPSF_ISOMETRICSPRITES)) ang = vp.Angles.Yaw; FTextureID patch; // [ZZ] add direct picnum override if (isPicnumOverride) @@ -1030,20 +1019,6 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t x2 = x - viewvecY*rightfac; y1 = y + viewvecX*leftfac; y2 = y + viewvecX*rightfac; - if((di->Viewpoint.camera->ViewPos != NULL) && (di->Viewpoint.camera->ViewPos->Flags & VPSF_ISOMETRICSPRITES)) // If sprites are drawn from an isometric perspective - { - float signX = 1.0; - float signY = 1.0; - if(viewvecX < 0) signX = -1.0; - if(viewvecY < 0) signY = -1.0; - if(viewvecX == 0) signX = 0.0; - if(viewvecY == 0) signY = 0.0; - - x1 -= signX * thing->radius; - x2 -= signX * thing->radius; - y1 -= signY * thing->radius; - y2 -= signY * thing->radius; - } break; } case RF_FLATSPRITE: @@ -1084,7 +1059,6 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t } depth = (float)((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin); - if(((di->Viewpoint.camera->ViewPos != NULL) && (di->Viewpoint.camera->ViewPos->Flags & VPSF_ISOMETRICSPRITES))) depth = depth * vp.PitchCos - vp.PitchSin * z2; // Helps with stacking actors with small xy offsets if (isSpriteShadow) depth += 1.f/65536.f; // always sort shadows behind the sprite. // light calculation @@ -1312,7 +1286,7 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t //========================================================================== // -// +// // //========================================================================== @@ -1338,7 +1312,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s this->particle = particle; fullbright = particle->flags & SPF_FULLBRIGHT; - if (di->isFullbrightScene()) + if (di->isFullbrightScene()) { Colormap.Clear(); } @@ -1397,7 +1371,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s { bool has_texture = particle->texture.isValid(); bool custom_animated_texture = (particle->flags & SPF_LOCAL_ANIM) && particle->animData.ok; - + int particle_style = has_texture ? 2 : gl_particles_style; // Treat custom texture the same as smooth particles // [BB] Load the texture for round or smooth particles @@ -1456,7 +1430,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s float rvf = (particle->RollVel) * timefrac; Angles.Roll = TAngle::fromDeg(particle->Roll + rvf); } - + float factor; if (particle_style == 1) factor = 1.3f / 7.f; else if (particle_style == 2) factor = 2.5f / 7.f; @@ -1474,7 +1448,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s z2=z+scalefac; depth = (float)((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin); - + // [BB] Translucent particles have to be rendered without the alpha test. if (particle_style != 2 && trans>=1.0f-FLT_EPSILON) hw_styleflags = STYLEHW_Solid; else hw_styleflags = STYLEHW_NoAlphaTest; @@ -1490,7 +1464,7 @@ void HWSprite::ProcessParticle(HWDrawInfo *di, particle_t *particle, sector_t *s } // [MC] VisualThinkers are to be rendered akin to actor sprites. The reason this whole system -// is hitching a ride on particle_t is because of the large number of checks with +// is hitching a ride on particle_t is because of the large number of checks with // HWSprite elsewhere in the draw lists. void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t* sector) { @@ -1501,7 +1475,7 @@ void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t if (paused || spr->isFrozen()) timefrac = 0.; - + bool custom_anim = ((spr->PT.flags & SPF_LOCAL_ANIM) && spr->PT.animData.ok); texture = TexMan.GetGameTexture( @@ -1533,7 +1507,7 @@ void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t auto r = spi.GetSpriteRect(); r.Scale(spr->Scale.X, spr->Scale.Y); - if (spr->bXFlip) + if (spr->bXFlip) { std::swap(ul,ur); r.left = -r.width - r.left; // mirror the sprite's x-offset @@ -1560,7 +1534,7 @@ void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t //========================================================================== // -// +// // //========================================================================== diff --git a/src/rendering/r_utility.cpp b/src/rendering/r_utility.cpp index e4851906b17..4daf7af7cc2 100644 --- a/src/rendering/r_utility.cpp +++ b/src/rendering/r_utility.cpp @@ -66,7 +66,6 @@ #include "i_system.h" #include "v_draw.h" #include "i_interface.h" -#include "d_main.h" // EXTERNAL DATA DECLARATIONS ---------------------------------------------- @@ -154,8 +153,6 @@ FRenderViewpoint::FRenderViewpoint() Sin = 0.0; TanCos = 0.0; TanSin = 0.0; - PitchCos = 0.0; - PitchSin = 0.0; camera = nullptr; sector = nullptr; FieldOfView = DAngle::fromDeg(90.); // Angles in the SCREENWIDTH wide window @@ -603,7 +600,7 @@ void R_InterpolateView (FRenderViewpoint &viewpoint, player_t *player, double Fr else break; } } - if (moved && !viewpoint.showviewer) viewpoint.noviewer = true; + if (moved) viewpoint.noviewer = true; } //========================================================================== @@ -633,9 +630,6 @@ void FRenderViewpoint::SetViewAngle (const FViewWindow &viewwindow) TanSin = viewwindow.FocalTangent * Sin; TanCos = viewwindow.FocalTangent * Cos; - PitchSin = Angles.Pitch.Sin(); - PitchCos = Angles.Pitch.Cos(); - DVector2 v = Angles.Yaw.ToVector(); ViewVector.X = v.X; ViewVector.Y = v.Y; @@ -865,7 +859,6 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor { iview->otic = nowtic; iview->Old = iview->New; - viewpoint.noviewer = false; } //============================================================================================== // Handles offsetting the camera with ChaseCam and/or viewpos. @@ -888,7 +881,7 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor P_AimCamera(viewpoint.camera, campos, camangle, viewpoint.sector, unlinked); // fixme: This needs to translate the angle, too. iview->New.Pos = campos; iview->New.Angles.Yaw = camangle; - viewpoint.noviewer = false; + viewpoint.showviewer = true; // Interpolating this is a very complicated thing because nothing keeps track of the aim camera's movement, so whenever we detect a portal transition // it's probably best to just reset the interpolation for this move. @@ -955,11 +948,7 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor // Interpolation still happens with everything else though and seems to work fine. DefaultDraw = false; viewpoint.NoPortalPath = true; - // Allow VPSF_ALLOWOUTOFBOUNDS camera viewpoints to go out of bounds when using HW renderer - if (!(VP->Flags & VPSF_ALLOWOUTOFBOUNDS) || !V_IsHardwareRenderer()) - { - P_AdjustViewPos(mo, orig, next, viewpoint.sector, unlinked, VP, &viewpoint); - } + P_AdjustViewPos(mo, orig, next, viewpoint.sector, unlinked, VP, &viewpoint); if (viewpoint.sector->PortalGroup != oldsector->PortalGroup || (unlinked && ((iview->New.Pos.XY() - iview->Old.Pos.XY()).LengthSquared()) > 256 * 256)) { @@ -1006,10 +995,7 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor viewpoint.SetViewAngle (viewwindow); // Keep the view within the sector's floor and ceiling - // But allow VPSF_ALLOWOUTOFBOUNDS camera viewpoints to go out of bounds when using hardware renderer - bool disembodied = false; - if (viewpoint.camera->ViewPos != NULL) disembodied = viewpoint.camera->ViewPos->Flags & VPSF_ALLOWOUTOFBOUNDS; - if (viewpoint.sector->PortalBlocksMovement(sector_t::ceiling) && (!disembodied || !V_IsHardwareRenderer())) + if (viewpoint.sector->PortalBlocksMovement(sector_t::ceiling)) { double theZ = viewpoint.sector->ceilingplane.ZatPoint(viewpoint.Pos) - 4; if (viewpoint.Pos.Z > theZ) @@ -1018,7 +1004,7 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor } } - if (viewpoint.sector->PortalBlocksMovement(sector_t::floor) && (!disembodied || !V_IsHardwareRenderer())) + if (viewpoint.sector->PortalBlocksMovement(sector_t::floor)) { double theZ = viewpoint.sector->floorplane.ZatPoint(viewpoint.Pos) + 4; if (viewpoint.Pos.Z < theZ) diff --git a/src/rendering/r_utility.h b/src/rendering/r_utility.h index c5f87eef534..7ba6e738cf5 100644 --- a/src/rendering/r_utility.h +++ b/src/rendering/r_utility.h @@ -33,8 +33,6 @@ struct FRenderViewpoint double Sin; // sin(Angles.Yaw) double TanCos; // FocalTangent * cos(Angles.Yaw) double TanSin; // FocalTangent * sin(Angles.Yaw) - double PitchCos; // cos(Angles.Pitch) - double PitchSin; // sin(Angles.Pitch) AActor *camera; // camera actor sector_t *sector; // [RH] keep track of sector viewing from diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index 3dc8b974d99..450d4552a78 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -1693,7 +1693,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset) PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); ACTION_RETURN_BOOL(self->IsFreelookAllowed()); } - + //========================================================================== // // ZScript counterpart to ACS ChangeSky, uses TextureIDs diff --git a/wadsrc/static/zscript/actors/shared/camera.zs b/wadsrc/static/zscript/actors/shared/camera.zs index 0e35a5efbd7..d7826c05179 100644 --- a/wadsrc/static/zscript/actors/shared/camera.zs +++ b/wadsrc/static/zscript/actors/shared/camera.zs @@ -128,89 +128,3 @@ class AimingCamera : SecurityCamera } } - -class SpectatorCamera : Actor -{ - - bool chasingtracer; - double lagdistance; // camera gives chase (lazy follow) if tracer gets > lagdistance away from camera.pos - int chasemode; // 0: chase until tracer centered, 1: same but only when tracer is moving, 2: stop chase if tracer within lagdistance - property lagdistance : lagdistance; - property chasingtracer : chasingtracer; - property chasemode : chasemode; - - default - { - +NOBLOCKMAP - +NOGRAVITY - +NOSECTOR - +NOINTERACTION - RenderStyle "None"; - CameraHeight 0; - SpectatorCamera.chasingtracer false; - SpectatorCamera.lagdistance 0.0; - SpectatorCamera.chasemode 0; - } - - void Init(double dist, double yaw, double inpitch, int inflags) - { - if(((inflags > 0) && (inflags & VPSF_ORTHOGRAPHIC)) || ((inflags < 0) && (ViewPos.Flags & VPSF_ORTHOGRAPHIC))) dist *= 3.0; - - double zshift = 0.0; - if(tracer != NULL) - { - if(player != NULL) zshift = -0.5*tracer.height; - else zshift = 0.5*tracer.height; - } - else if (player != NULL && player.mo != NULL) zshift = -0.5*player.mo.height; - - SetViewPos((-dist*Cos(yaw), -dist*Sin(yaw), dist*Tan(inpitch)+zshift), inflags); - LookAtSelf(inpitch); - } - - void LookAtSelf(double inpitch) - { - if(ViewPos.Offset != (0., 0., 0.)) - { - Vector3 negviewpos = (-1.0) * ViewPos.Offset; - angle = negviewpos.Angle(); - pitch = inpitch; - } - } - - override void Tick() - { - if(tracer != NULL) - { - Vector3 distvec = tracer.pos - pos; - double dist = distvec.length(); - if((dist <= 4 && chasingtracer) || lagdistance <= 0.0) // Keep tracer centered on screen - { - SetOrigin(tracer.pos, true); - chasingtracer = false; - } - else // Lazy follow tracer - { - if(dist >= 2*lagdistance) - { - SetOrigin(tracer.pos, true); - chasingtracer = false; - } - else if(dist > lagdistance && !chasingtracer) chasingtracer = true; - - if(chasingtracer) - { - speed = tracer.vel.xy.length()/dist; - if((speed == 0.0) && (chasemode == 0)) speed = tracer.speed/dist; - SetOrigin(pos + 2*distvec*speed, true); - if(chasemode > 1) chasingtracer = false; - } - } - } - else if(player != NULL && player.mo != NULL) - { - cameraFOV = player.FOV; - SetOrigin(player.mo.pos, true); - } - } -} diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index 3eab8cf2eba..71b0fb99df7 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -420,9 +420,6 @@ enum EViewPosFlags { VPSF_ABSOLUTEOFFSET = 1 << 1, // Don't include angles. VPSF_ABSOLUTEPOS = 1 << 2, // Use absolute position. - VPSF_ALLOWOUTOFBOUNDS = 1 << 3, // Allow viewpoint to go out of bounds (hardware renderer only). - VPSF_ORTHOGRAPHIC = 1 << 4, // Use orthographic projection. - VPSF_ISOMETRICSPRITES = 1 << 5, // Displace sprites towards camera and don't billboard (drawn from isometric perspective). }; // Flags for A_TakeInventory and A_TakeFromTarget