First person camera position Created 6 years ago2018-03-10 05:25:16 UTC by Yu2673 Yu2673

Created 6 years ago2018-03-10 05:25:16 UTC by Yu2673 Yu2673

Posted 6 years ago2018-03-10 05:25:16 UTC Post #338988
I'm curious if there a way to change players eye-camera position to make it slightly higher. Is it hard coded or there is simply a console command?
Posted 6 years ago2018-03-10 10:44:58 UTC Post #338989
That's defined here:
Server only code:
https://github.com/ValveSoftware/halflife/blob/master/dlls/player.cpp#L2911

Shared physics code:
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/pm_shared/pm_shared.c#L1952
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/pm_shared/pm_shared.c#L2021

Standing to ducking transition code: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/pm_shared/pm_shared.c#L2045

When the player is dead it's changed to be on the ground:
Server only code: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/player.cpp#L1409
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/player.cpp#L1456

Shared physics code: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/pm_shared/pm_shared.c#L2892

The constant is defined here for server code: https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/dlls/util.h#L420

Physics code:
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/pm_shared/pm_shared.c#L86
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/pm_shared/pm_shared.c#L79
https://github.com/ValveSoftware/halflife/blob/5d761709a31ce1e71488f2668321de05f791b405/pm_shared/pm_shared.c#L80

Note that the server only constant is used by other code as well, so don't change the constant itself, just define a new one.

As usual it's defined twice, you can rework it if you want.
Posted 6 years ago2018-03-11 03:45:19 UTC Post #338994
Thanks!
You must be logged in to post a response.