Allow camera actor to determine FOV

Moderator: GZDoom Developers

Post Reply
User avatar
AFADoomer
Posts: 1325
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Allow camera actor to determine FOV

Post by AFADoomer »

Would it be possible to allow per-camera configuration of FOV?

I am pretty sure that this call to R_SetFOV is the only thing that forces non-player actor-based cameras to use an FOV of 90. Would it be too intrusive to add a "double CameraFOV" variable to the Actor class, with a default value of 90., then have the R_SetFOV call use that value instead of hard-coding it to 90.f?

Doing this would at least allow the FOV to be changed via ZScript - Maybe extending ACS's ChangeCamera to take FOV as a fourth parameter could be done as well?

This would eliminate the need for a hacky render-camera-to-texture-then-plaster-that-across-the-entire-screen implementations that I'm currently working around, since that's currently the only way to get a camera with a specific FOV.

As always, I could be oversimplifying the issue... :-)
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Allow camera actor to determine FOV

Post by Nash »

Pull request: https://github.com/coelckers/gzdoom/pull/358

Demo WAD attached
Attachments
camerafovtest.pk3
(1.35 KiB) Downloaded 50 times
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Allow camera actor to determine FOV

Post by Rachael »

I will test this when I get some time. In the meantime, I'll move it to code submissions. I don't see any problem with the code with a cursory review.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Allow camera actor to determine FOV

Post by Graf Zahl »

I cannot check right now if this is complete but it seems to be fine.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Allow camera actor to determine FOV

Post by Nash »

Added a fallback FOV in case the camera is null... thanks _mental_ :D
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Allow camera actor to determine FOV

Post by Nash »

Shortened the code as advised.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Allow camera actor to determine FOV

Post by Rachael »

I went ahead and merged it - mostly because if I was to do this feature this is really close to how I would've done it.

I tested it with both the local player's FOV and with the example provided.
User avatar
AFADoomer
Posts: 1325
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Allow camera actor to determine FOV

Post by AFADoomer »

Awesome! Thanks to everyone involved!
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”