Page 1 of 1

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

PostPosted: Sun Nov 14, 2021 1:43 am
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

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

PostPosted: Sun Nov 14, 2021 10:10 am
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.

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

PostPosted: Sun Nov 14, 2021 10:47 am
by Reactor
Sounds useful. And reasonable. It shall be great when we will be makin' the asteroid levels :) Thank you for your efforts!

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

PostPosted: Sun Nov 14, 2021 11:12 am
by Laskow
You bet :)