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

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

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

Postby Laskow » Sun Nov 14, 2021 1:43 am

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
 
Joined: 16 Feb 2021

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

Postby Laskow » Sun Nov 14, 2021 10:10 am

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
Laskow
 
Joined: 16 Feb 2021

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

Postby Reactor » Sun Nov 14, 2021 10:47 am

Sounds useful. And reasonable. It shall be great when we will be makin' the asteroid levels :) Thank you for your efforts!
User avatar
Reactor
The militarist
 
Joined: 03 Feb 2011
Location: Island's Beauty, Hungary

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

Postby Laskow » Sun Nov 14, 2021 11:12 am

You bet :)
User avatar
Laskow
 
Joined: 16 Feb 2021


Return to General

Who is online

Users browsing this forum: Deon and 6 guests