[WIP] ViewPos

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: GZDoom Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:
Image

Legacy Status:
Image Image

QZDoom Status:
Image

[WIP] ViewPos

Postby Major Cooke » Fri Sep 04, 2020 7:59 am

Pull Request

Adds Vector3 ViewPos to actors. Changing this will offset the view of the camera. This takes into account pitch and roll by default when offsetting, and is operating via the actor's primary angles, NOT view angles - those are applied after.

X: +Forward | -Back
Y: +Left | -Right
X: +Up | -Down

ViewPos can be manipulated by the following flags:
  • VIEWPOSNOANGLES: Does not take yaw/pitch/roll into account for offsetting and simply adds onto the position, leaving the rotating to the modder.
  • ABSVIEWPOS: Overrides the above flag. ViewPos becomes absolute position for the camera. Interpolation for portals is disabled in this mode, so it'll be down to the modder to use the interpolation functions (Vec#Offset(Z)) to get proper portal displacements.
Notes:
  • Do not perform portal handling for anything other than when the ABSVIEWPOS flag is present. Portal handling is already done for everything else.
  • Portal handling is done via a trace and keeps the camera in map geometry, for those who want to disable the angle relativity.
  • You cannot see your body as you are technically still in first person view. This is intentional. The idea behind this is to prevent the body from rendering without work-arounds.
  • ViewPos is not taken into account in chase mode.
Known Issues:
  • The view point can see the player's body when passing through a line portal.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Return to Code Submissions

Who is online

Users browsing this forum: No registered users and 0 guests