[Solved]The cause of the player float bobbing while flying

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
Laskow
Posts: 82
Joined: Tue Feb 16, 2021 7:35 am
Preferred Pronouns: He/Him
Contact:

[Solved]The cause of the player float bobbing while flying

Post by Laskow »

A question about what the code makes the player float bob himself (not weapon bob or camera bob) forcibly while flying.
Even adding the flag "-FLOATBOB" doesn't work. It seems doesn't affect during noclip2 mode, he's not bobbing.

AFAIA it's hard coded. So I wondered which file handles it, but nothing came up even when I searched the source code.
Does anyone know about it?

[edit] According to this thread, there is no meaning to add "-FLOADBOB" to stop it: viewtopic.php?f=3&t=32719
Last edited by Laskow on Sun Nov 14, 2021 10:12 am, edited 1 time in total.
User avatar
Laskow
Posts: 82
Joined: Tue Feb 16, 2021 7:35 am
Preferred Pronouns: He/Him
Contact:

Re: What is the cause of the player float bobbing while flyi

Post by Laskow »

Okay, I found it out by myself.

This causes the player float bobbing while flying.
https://github.com/coelckers/gzdoom/blo ... .cpp#L2502
Spoiler:
I've deleted (mo->flags & MF_NOGRAVITY) from line 2502 and the player doesn't bob anymore. But the camera was still trembling so I changed player.bob = 0.5 to player.bob = 0 in Player.zs.
(Actually you should make a new PlayerPawn class inherited from the original PlayerPawn and then override it.)
Spoiler:
Finally, the bobbing is stopped!

Nobody has talked about stopping this even modifying the source code so far, so I hope this will help someone who wants to do.
Last edited by Laskow on Sun Nov 14, 2021 11:22 am, edited 2 times in total.
User avatar
Reactor
Posts: 2091
Joined: Thu Feb 03, 2011 6:39 pm
Location: Island's Beauty, Hungary

Re: [Solved]The cause of the player float bobbing while flyi

Post by Reactor »

Sounds useful. And reasonable. It shall be great when we will be makin' the asteroid levels :) Thank you for your efforts!
User avatar
Laskow
Posts: 82
Joined: Tue Feb 16, 2021 7:35 am
Preferred Pronouns: He/Him
Contact:

Re: [Solved]The cause of the player float bobbing while flyi

Post by Laskow »

You bet :)
Post Reply

Return to “General”