PRooFPS-dd Dev Doc 1.0
PRooFPS-dd Developer Documentation
Loading...
Searching...
No Matches
proofps_dd::Physics Class Reference

Detailed Description

Definition at line 30 of file Physics.h.

#include <Physics.h>

+ Inheritance diagram for proofps_dd::Physics:

Public Member Functions

CConsole & getConsole () const
 
 Physics (PGE &pge, proofps_dd::Durations &durations, proofps_dd::GUI &gui, std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers, proofps_dd::Maps &maps, proofps_dd::Sounds &sounds, proofps_dd::CameraHandling &camera)
 
 Physics (const Physics &)=delete
 
Physicsoperator= (const Physics &)=delete
 
 Physics (Physics &&)=delete
 
Physics && operator= (Physics &&)=delete
 

Static Public Member Functions

static const char * getLoggerModuleName ()
 
static bool colliding (const PureObject3D &a, const PureObject3D &b)
 
static bool colliding_NoZ (const PureObject3D &a, const PureObject3D &b)
 
static bool colliding2 (float o1px, float o1py, float o1pz, float o1sx, float o1sy, float o1sz, float o2px, float o2py, float o2pz, float o2sx, float o2sy, float o2sz)
 
static bool colliding2_NoZ (float o1px, float o1py, float o1sx, float o1sy, float o2px, float o2py, float o2sx, float o2sy)
 
static bool colliding3 (const PureVector &vecPosMin, const PureVector &vecPosMax, const PureVector &vecObjPos, const PureVector &vecObjSize)
 
static float distance_NoZ (float o1px, float o1py, float o2px, float o2py)
 
static float distance_NoZ (float o1px, float o1py, float o1sx, float o1sy, float o2px, float o2py)
 
static float distance_NoZ_with_distancePerAxis (float o1px, float o1py, float o1sx, float o1sy, float o2px, float o2py, PureVector &vDirPerAxis, PureVector &vDistancePerAxis)
 

Protected Member Functions

void serverSetAllowStrafeMidAir (bool bAllow)
 
void serverSetAllowStrafeMidAirFull (bool bAllow)
 
void serverSetFallDamageMultiplier (int n)
 
void serverSetCollisionModeBvh (bool state)
 
void serverGravity (XHair &xhair, const unsigned int &nPhysicsRate, proofps_dd::GameMode &gameMode)
 
void serverPlayerCollisionWithWalls (const unsigned int &nPhysicsRate, XHair &xhair, proofps_dd::GameMode &gameMode, PureVector &vecCamShakeForce)
 
- Protected Member Functions inherited from proofps_dd::PlayerHandling
bool hasPlayerBootedUp (const pge_network::PgeNetworkConnectionHandle &connHandle) const
 
void handlePlayerDied (Player &player, XHair &xhair, const pge_network::PgeNetworkConnectionHandle &nKillerConnHandleServerSide)
 
void handlePlayerRespawned (Player &player, XHair &xhair)
 
void serverRespawnPlayer (Player &player, const proofps_dd::GameRestartType_KeepPlayers &eRestartType, const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 Respawn is required when either a game is started, restarted, or a dead player needs to be revived.
 
void serverResettlePlayer (Player &player, const proofps_dd::Config &config)
 Resettle is required when a round-based game starts a new round, and we need to reposition alive players back to spawn points.
 
void serverUpdateRespawnTimers (const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles, proofps_dd::GameMode &gameMode, proofps_dd::Durations &durations)
 
void handlePlayerTeamIdChangedOrToggledSpectatorMode (Player &player, const unsigned int &iTeamId, const bool &bToggledSpectatorMode, const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 
void handleExplosionMultiKill (int nPlayersDiedByExplosion)
 
void writePlayerList ()
 
bool handleUserConnected (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const pge_network::MsgUserConnectedServerSelf &msg, PGEcfgProfiles &cfgProfiles, proofps_dd::Config &config, std::function< void(int)> &cbDisplayMapLoadingProgressUpdate)
 
bool handleUserDisconnected (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const pge_network::MsgUserDisconnectedFromServer &msg, proofps_dd::GameMode &gameMode)
 
bool handleUserNameChange (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgUserNameChangeAndBootupDone &msg, proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 
void resetSendClientUpdatesCounter (proofps_dd::Config &config)
 
void serverUpdatePlayersOldValues (proofps_dd::Config &config, PgeObjectPool< proofps_dd::Smoke > &smokes)
 
void serverSendUserUpdates (PGEcfgProfiles &cfgProfiles, proofps_dd::Config &config, proofps_dd::Durations &durations, proofps_dd::GameMode &gameMode)
 
bool handleUserUpdateFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgUserUpdateFromServer &msg, XHair &xhair, const proofps_dd::Config &config, proofps_dd::GameMode &gameMode, PgeObjectPool< proofps_dd::Smoke > &smokes)
 
bool handleDeathNotificationFromServer (pge_network::PgeNetworkConnectionHandle nDeadConnHandleServerSide, const proofps_dd::MsgDeathNotificationFromServer &msg, proofps_dd::GameMode &gameMode)
 
bool handlePlayerEventFromServer (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgPlayerEventFromServer &msg, PureVector &vecCamShakeForce, const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 
bool serverHandleUserInGameMenuCmd (pge_network::PgeNetworkConnectionHandle connHandleServerSide, const proofps_dd::MsgUserInGameMenuCmd &msg, const proofps_dd::Config &config, PGEcfgProfiles &cfgProfiles)
 
void updatePlayersVisuals (const proofps_dd::Config &config, proofps_dd::GameMode &gameMode)
 Invoked in every frame by all instances.
 
CConsole & getConsole () const
 
 PlayerHandling (PGE &pge, proofps_dd::Durations &durations, proofps_dd::GUI &gui, std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > &mapPlayers, proofps_dd::Maps &maps, proofps_dd::Sounds &sounds, proofps_dd::CameraHandling &camera)
 
 PlayerHandling (const PlayerHandling &)=delete
 
PlayerHandlingoperator= (const PlayerHandling &)=delete
 
 PlayerHandling (PlayerHandling &&)=delete
 
PlayerHandling && operator= (PlayerHandling &&)=delete
 
- Protected Member Functions inherited from proofps_dd::Networking
void allowListAppMessages ()
 
 Networking (PGE &pge, proofps_dd::Durations &durations)
 
 Networking (const Networking &)=delete
 
Networkingoperator= (const Networking &)=delete
 
 Networking (Networking &&)=delete
 
Networking && operator= (Networking &&)=delete
 
CConsole & getConsole () const
 
bool isMyConnection (const pge_network::PgeNetworkConnectionHandle &connHandleServerSide) const
 
const pge_network::PgeNetworkConnectionHandle & getMyServerSideConnectionHandle () const
 
bool reinitializeNetworking ()
 
bool isServer () const
 

Private Member Functions

void serverPlayerCollisionWithWalls_common_LoopKernelVertical_actualCollHandler (Player &player, const PureObject3D *obj, const int &iJumppad, const float &fPlayerHalfHeight, const float &fBlockSizeYhalf, XHair &xhair, PureVector &vecCamShakeForce)
 Used by both the legacy and BVH collision paths' LoopKernelVertical functions.
 
bool serverPlayerCollisionWithWalls_legacy_LoopKernelVertical (Player &player, const PureObject3D *obj, const int &iJumppad, const float &fPlayerHalfHeight, const float &fPlayerOPos1XMinusHalf, const float &fPlayerOPos1XPlusHalf, const float &fPlayerPos1YMinusHalf, const float &fPlayerPos1YPlusHalf, const float &fBlockSizeXhalf, const float &fBlockSizeYhalf, XHair &xhair, PureVector &vecCamShakeForce)
 Used in the legacy collision path, handling player's vertical collision i.e.
 
bool serverPlayerCollisionWithWalls_bvh_LoopKernelVertical (Player &player, const PureObject3D *obj, const int &iJumppad, const float &fPlayerHalfHeight, const float &fBlockSizeYhalf, XHair &xhair, PureVector &vecCamShakeForce)
 Used in the BVH collision path, handling player's vertical collision i.e.
 
void serverPlayerCollisionWithWalls_common_verticalCollisionAlreadyHandled (bool bVerticalCollisionOccured, Player &player, const float &fCurrentFallHeight, bool bWillCollideVerticallyWithinLooseJumpAllowDistance)
 
float serverPlayerCollisionWithWalls_legacy_vertical_handleStandup (Player &player, const float &fPlayerOPos1XMinusHalf, const float &fPlayerOPos1XPlusHalf)
 If the player is currently crouching but wants to stand up, it checks it there is enough space for standing up and if so, it makes the player stand up.
 
float serverPlayerCollisionWithWalls_bvh_vertical_handleStandup (Player &player)
 If the player is currently crouching but wants to stand up, it checks it there is enough space for standing up and if so, it makes the player stand up.
 
bool serverPlayerCollisionWithWalls_legacy_vertical_checkForSoonPossibleVerticalCollisionWithinLooseJumpAllowDistance (const float &fPlayerOPos1XMinusHalf, const float &fPlayerOPos1XPlusHalf, const float &fPlayerPosY, const float &fVecPlayerScaledSizeY, const float &fCurrentFallHeight, const float &fThresholdVerticalDistanceForLooseAllowJump)
 
bool serverPlayerCollisionWithWalls_bvh_vertical_checkForSoonPossibleVerticalCollisionWithinLooseJumpAllowDistance (Player &player, const float &fVecPlayerScaledSizeX, const float &fVecPlayerScaledSizeY, const float &fVecPlayerScaledSizeZ, const float &fCurrentFallHeight, const float &fThresholdVerticalDistanceForLooseAllowJump)
 
void serverPlayerCollisionWithWalls_common_strafe (XHair &xhair, const unsigned int &nPhysicsRate, Player &player, PureVector vecOriginalJumpForceBeforeVerticalCollisionHandled)
 
bool serverPlayerCollisionWithWalls_common_horizontal_handleCollisionOccurred (bool isBvh, Player &player, const PureObject3D &wallObj, const PureVector &vecWallObjPos, const float fRealBlockSizeYhalf, const float fPlayerPos1YMinusHalf_2, const float &fPlayerHalfHeight, const PureVector &vecPlayerScaledSize)
 Handle the actual collision between player and a foreground block (wall, ground, etc.).
 
bool serverPlayerCollisionWithWalls_legacy_vertical (const unsigned int &nPhysicsRate, Player &player, const float &fPlayerHalfHeight, const PureVector &vecPlayerScaledSize, XHair &xhair, PureVector &vecCamShakeForce)
 Player's vertical collision handling for the legacy path.
 
bool serverPlayerCollisionWithWalls_legacy_horizontal (Player &player, const float &fPlayerHalfHeight, const PureVector &vecPlayerScaledSize)
 Player's horizontal collision handling for the legacy path.
 
bool serverPlayerCollisionWithWalls_bvh_vertical (const unsigned int &nPhysicsRate, Player &player, const float &fPlayerHalfHeight, const PureVector &vecPlayerScaledSize, XHair &xhair, PureVector &vecCamShakeForce)
 Player's vertical collision handling for the legacy path.
 
bool serverPlayerCollisionWithWalls_bvh_horizontal (Player &player, const float &fPlayerHalfHeight, const PureVector &vecPlayerScaledSize)
 Player's horizontal collision handling for the BVH path.
 
void serverPlayerCollisionWithWalls_common_updatePlayerAfterCollisionHandling (Player &player, bool bHorizontalCollisionOccured)
 
void serverPlayerCollisionWithWalls_legacy (const unsigned int &nPhysicsRate, XHair &xhair, proofps_dd::GameMode &gameMode, PureVector &vecCamShakeForce)
 
void serverPlayerCollisionWithWalls_bvh (const unsigned int &nPhysicsRate, XHair &xhair, proofps_dd::GameMode &gameMode, PureVector &vecCamShakeForce)
 

Private Attributes

PGE & m_pge
 
proofps_dd::Durationsm_durations
 
std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & m_mapPlayers
 
proofps_dd::Mapsm_maps
 
proofps_dd::Soundsm_sounds
 
bool m_bAllowStrafeMidAir
 
bool m_bAllowStrafeMidAirFull
 
int m_nFallDamageMultiplier
 
bool m_bCollisionModeBvh
 

Additional Inherited Members

- Static Protected Member Functions inherited from proofps_dd::PlayerHandling
static const char * getLoggerModuleName ()
 
- Static Protected Member Functions inherited from proofps_dd::Networking
static const char * getLoggerModuleName ()
 
- Protected Attributes inherited from proofps_dd::Networking
pge_network::PgeNetworkConnectionHandle m_nServerSideConnectionHandle
 Server-side connection handle received from server in PgePktUserConnected (server instance also receives this from itself).
 
- Static Protected Attributes inherited from proofps_dd::Networking
static constexpr char * szCVarClServerIp = "cl_server_ip"
 

Constructor & Destructor Documentation

◆ Physics() [1/3]

proofps_dd::Physics::Physics ( PGE & pge,
proofps_dd::Durations & durations,
proofps_dd::GUI & gui,
std::map< pge_network::PgeNetworkConnectionHandle, proofps_dd::Player > & mapPlayers,
proofps_dd::Maps & maps,
proofps_dd::Sounds & sounds,
proofps_dd::CameraHandling & camera )

Definition at line 23 of file Physics.cpp.

◆ Physics() [2/3]

proofps_dd::Physics::Physics ( const Physics & )
delete

◆ Physics() [3/3]

proofps_dd::Physics::Physics ( Physics && )
delete

Member Function Documentation

◆ colliding()

bool proofps_dd::Physics::colliding ( const PureObject3D & a,
const PureObject3D & b )
static

Definition at line 63 of file Physics.cpp.

◆ colliding2()

bool proofps_dd::Physics::colliding2 ( float o1px,
float o1py,
float o1pz,
float o1sx,
float o1sy,
float o1sz,
float o2px,
float o2py,
float o2pz,
float o2sx,
float o2sy,
float o2sz )
static

Definition at line 83 of file Physics.cpp.

◆ colliding2_NoZ()

bool proofps_dd::Physics::colliding2_NoZ ( float o1px,
float o1py,
float o1sx,
float o1sy,
float o2px,
float o2py,
float o2sx,
float o2sy )
static

Definition at line 108 of file Physics.cpp.

◆ colliding3()

bool proofps_dd::Physics::colliding3 ( const PureVector & vecPosMin,
const PureVector & vecPosMax,
const PureVector & vecObjPos,
const PureVector & vecObjSize )
static

Definition at line 211 of file Physics.cpp.

◆ colliding_NoZ()

bool proofps_dd::Physics::colliding_NoZ ( const PureObject3D & a,
const PureObject3D & b )
static

Definition at line 73 of file Physics.cpp.

◆ distance_NoZ() [1/2]

float proofps_dd::Physics::distance_NoZ ( float o1px,
float o1py,
float o1sx,
float o1sy,
float o2px,
float o2py )
static

Definition at line 136 of file Physics.cpp.

◆ distance_NoZ() [2/2]

float proofps_dd::Physics::distance_NoZ ( float o1px,
float o1py,
float o2px,
float o2py )
static

Definition at line 127 of file Physics.cpp.

◆ distance_NoZ_with_distancePerAxis()

float proofps_dd::Physics::distance_NoZ_with_distancePerAxis ( float o1px,
float o1py,
float o1sx,
float o1sy,
float o2px,
float o2py,
PureVector & vDirPerAxis,
PureVector & vDistancePerAxis )
static

Definition at line 168 of file Physics.cpp.

◆ getConsole()

CConsole & proofps_dd::Physics::getConsole ( ) const

Definition at line 52 of file Physics.cpp.

◆ getLoggerModuleName()

const char * proofps_dd::Physics::getLoggerModuleName ( )
static

Definition at line 57 of file Physics.cpp.

◆ operator=() [1/2]

Physics & proofps_dd::Physics::operator= ( const Physics & )
delete

◆ operator=() [2/2]

Physics && proofps_dd::Physics::operator= ( Physics && )
delete

◆ serverGravity()

void proofps_dd::Physics::serverGravity ( XHair & xhair,
const unsigned int & nPhysicsRate,
proofps_dd::GameMode & gameMode )
protected

Definition at line 351 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls()

void proofps_dd::Physics::serverPlayerCollisionWithWalls ( const unsigned int & nPhysicsRate,
XHair & xhair,
proofps_dd::GameMode & gameMode,
PureVector & vecCamShakeForce )
protected

Definition at line 529 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_bvh()

void proofps_dd::Physics::serverPlayerCollisionWithWalls_bvh ( const unsigned int & nPhysicsRate,
XHair & xhair,
proofps_dd::GameMode & gameMode,
PureVector & vecCamShakeForce )
private

Definition at line 1800 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_bvh_horizontal()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_bvh_horizontal ( Player & player,
const float & fPlayerHalfHeight,
const PureVector & vecPlayerScaledSize )
private

Player's horizontal collision handling for the BVH path.

Parameters
playerThe player for which we are checking and handling horizontal collision.
fPlayerHalfHeightThe original half of the height of the player, saved before somersaulting or standup/crouching was handled in this physics loop.
vecPlayerScaledSizeThe original scaled size of the player, saved before somersaulting or standup/crouching was handled in this physics loop. I dont know why I have weird bug if this is NOT the saved but the current scaled size, maybe in the future I will debug it.
Returns
True if horizontal collision occurred, false otherwise. False is also returned if horizontal collision was cancelled out due to successful stepping onto the object.

Definition at line 1659 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_bvh_LoopKernelVertical()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_bvh_LoopKernelVertical ( Player & player,
const PureObject3D * obj,
const int & iJumppad,
const float & fPlayerHalfHeight,
const float & fBlockSizeYhalf,
XHair & xhair,
PureVector & vecCamShakeForce )
private

Used in the BVH collision path, handling player's vertical collision i.e.

when player's previous Y pos does not equal to new Y pos and given player is colliding with the given object. Unlike the similar function in the legacy path, this is actually not a loop kernel because this is not invoked from a loop iterating over the potential colliders, however this function is the rough equivalent of the legacy path's LoopKernelVertical function, so we kept the name similar. The given player is colliding with the given object for sure, so unlike with the legacy path's similar named function, here we don't do any further collision checks.

Parameters
playerThe player object colliding with the given object.
objThe object colliding with the given player.
iJumppadShall be valid jumppad index if the given object represents a jumppad block in the map, -1 otherwise.
Returns
Always true because when this function is invoked, it is known that the given object is colliding with given player.

Definition at line 725 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_bvh_vertical()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_bvh_vertical ( const unsigned int & nPhysicsRate,
Player & player,
const float & fPlayerHalfHeight,
const PureVector & vecPlayerScaledSize,
XHair & xhair,
PureVector & vecCamShakeForce )
private

Player's vertical collision handling for the legacy path.

Parameters
nPhysicsRateThe configured physics rate (e.g. 60 for 60 Hz).
playerThe player for which we are checking and handling vertical collision.
fPlayerHalfHeightThe original half of the height of the player, saved before somersaulting or standup/crouching was handled in this physics loop.
vecPlayerScaledSizeThe original scaled size of the player, saved before somersaulting or standup/crouching was handled in this physics loop. I dont know why I have weird bug if this is NOT the saved but the current scaled size, maybe in the future I will debug it.
Returns
True if vertical collision occurred, false otherwise. True is also returned if the vertical collision was with a jumppad.

Definition at line 1534 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_bvh_vertical_checkForSoonPossibleVerticalCollisionWithinLooseJumpAllowDistance()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_bvh_vertical_checkForSoonPossibleVerticalCollisionWithinLooseJumpAllowDistance ( Player & player,
const float & fVecPlayerScaledSizeX,
const float & fVecPlayerScaledSizeY,
const float & fVecPlayerScaledSizeZ,
const float & fCurrentFallHeight,
const float & fThresholdVerticalDistanceForLooseAllowJump )
private

Definition at line 938 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_bvh_vertical_handleStandup()

float proofps_dd::Physics::serverPlayerCollisionWithWalls_bvh_vertical_handleStandup ( Player & player)
private

If the player is currently crouching but wants to stand up, it checks it there is enough space for standing up and if so, it makes the player stand up.

Shall not be called if the player is somersaulting now.

Returns
The new Y-size of the player (it stays the same if the player cannot stand up, does not want to stand up, already standing, etc.).

Definition at line 865 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_common_horizontal_handleCollisionOccurred()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_common_horizontal_handleCollisionOccurred ( bool isBvh,
Player & player,
const PureObject3D & wallObj,
const PureVector & vecWallObjPos,
const float fRealBlockSizeYhalf,
const float fPlayerPos1YMinusHalf_2,
const float & fPlayerHalfHeight,
const PureVector & vecPlayerScaledSize )
private

Handle the actual collision between player and a foreground block (wall, ground, etc.).

Used by both BVH- and legacy path.

Parameters
isBvhSet to true for BVH implementation, false otherwise.
playerThe player colliding with the given wall object.
wallObjThe wall object the player is colliding with.
vecWallObjPosThe position vector of the wall object.
fRealBlockSizeYhalfThe half of the Y size of the wall object.
fPlayerPos1YMinusHalf_2Player's latest updated Y position minus half player's vertical size.
fPlayerHalfHeightThe original half of the height of the player, saved before somersaulting or standup/crouching was handled in this physics loop.
vecPlayerScaledSizeThe original scaled size of the player, saved before somersaulting or standup/crouching was handled in this physics loop.
Returns
False if collision was cancelled by successful stepping onto the object, true otherwise.

Definition at line 1196 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_common_LoopKernelVertical_actualCollHandler()

void proofps_dd::Physics::serverPlayerCollisionWithWalls_common_LoopKernelVertical_actualCollHandler ( Player & player,
const PureObject3D * obj,
const int & iJumppad,
const float & fPlayerHalfHeight,
const float & fBlockSizeYhalf,
XHair & xhair,
PureVector & vecCamShakeForce )
private

Used by both the legacy and BVH collision paths' LoopKernelVertical functions.

Regardless which path is calling this, the given player is colliding with the given object.

Parameters
playerThe player object colliding with the given object.
objThe object colliding with the given player.
iJumppadShall be valid jumppad index if the given object represents a jumppad block in the map, -1 otherwise.
Returns
True if player collided with given object, false otherwise.

Definition at line 563 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_common_strafe()

void proofps_dd::Physics::serverPlayerCollisionWithWalls_common_strafe ( XHair & xhair,
const unsigned int & nPhysicsRate,
Player & player,
PureVector vecOriginalJumpForceBeforeVerticalCollisionHandled )
private

Definition at line 961 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_common_updatePlayerAfterCollisionHandling()

void proofps_dd::Physics::serverPlayerCollisionWithWalls_common_updatePlayerAfterCollisionHandling ( Player & player,
bool bHorizontalCollisionOccured )
private

Definition at line 1701 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_common_verticalCollisionAlreadyHandled()

void proofps_dd::Physics::serverPlayerCollisionWithWalls_common_verticalCollisionAlreadyHandled ( bool bVerticalCollisionOccured,
Player & player,
const float & fCurrentFallHeight,
bool bWillCollideVerticallyWithinLooseJumpAllowDistance )
private

Definition at line 751 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_legacy()

void proofps_dd::Physics::serverPlayerCollisionWithWalls_legacy ( const unsigned int & nPhysicsRate,
XHair & xhair,
proofps_dd::GameMode & gameMode,
PureVector & vecCamShakeForce )
private

Definition at line 1745 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_legacy_horizontal()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_legacy_horizontal ( Player & player,
const float & fPlayerHalfHeight,
const PureVector & vecPlayerScaledSize )
private

Player's horizontal collision handling for the legacy path.

Parameters
playerThe player for which we are checking and handling horizontal collision.
fPlayerHalfHeightThe original half of the height of the player, saved before somersaulting or standup/crouching was handled in this physics loop.
vecPlayerScaledSizeThe original scaled size of the player, saved before somersaulting or standup/crouching was handled in this physics loop. I dont know why I have weird bug if this is NOT the saved but the current scaled size, maybe in the future I will debug it.
Returns
True if horizontal collision occurred, false otherwise. False is also returned if horizontal collision was cancelled out due to successful stepping onto the object.

Definition at line 1465 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_legacy_LoopKernelVertical()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_legacy_LoopKernelVertical ( proofps_dd::Player & player,
const PureObject3D * obj,
const int & iJumppad,
const float & fPlayerHalfHeight,
const float & fPlayerOPos1XMinusHalf,
const float & fPlayerOPos1XPlusHalf,
const float & fPlayerPos1YMinusHalf,
const float & fPlayerPos1YPlusHalf,
const float & fBlockSizeXhalf,
const float & fBlockSizeYhalf,
XHair & xhair,
PureVector & vecCamShakeForce )
private

Used in the legacy collision path, handling player's vertical collision i.e.

when player's previous Y pos does not equal to new Y pos and given player is colliding with the given object.

Parameters
playerThe player object to check for collision with given object.
objThe object to check for collision with given player.
iJumppadShall be valid jumppad index if the given object represents a jumppad block in the map, -1 otherwise.
Returns
True if player collided with given object, false otherwise.

Definition at line 667 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_legacy_vertical()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_legacy_vertical ( const unsigned int & nPhysicsRate,
Player & player,
const float & fPlayerHalfHeight,
const PureVector & vecPlayerScaledSize,
XHair & xhair,
PureVector & vecCamShakeForce )
private

Player's vertical collision handling for the legacy path.

Parameters
nPhysicsRateThe configured physics rate (e.g. 60 for 60 Hz).
playerThe player for which we are checking and handling vertical collision.
fPlayerHalfHeightThe original half of the height of the player, saved before somersaulting or standup/crouching was handled in this physics loop.
vecPlayerScaledSizeThe original scaled size of the player, saved before somersaulting or standup/crouching was handled in this physics loop. I dont know why I have weird bug if this is NOT the saved but the current scaled size, maybe in the future I will debug it.
Returns
True if vertical collision occurred, false otherwise. True is also returned if the vertical collision was with a jumppad.

Definition at line 1322 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_legacy_vertical_checkForSoonPossibleVerticalCollisionWithinLooseJumpAllowDistance()

bool proofps_dd::Physics::serverPlayerCollisionWithWalls_legacy_vertical_checkForSoonPossibleVerticalCollisionWithinLooseJumpAllowDistance ( const float & fPlayerOPos1XMinusHalf,
const float & fPlayerOPos1XPlusHalf,
const float & fPlayerPosY,
const float & fVecPlayerScaledSizeY,
const float & fCurrentFallHeight,
const float & fThresholdVerticalDistanceForLooseAllowJump )
private

Definition at line 890 of file Physics.cpp.

◆ serverPlayerCollisionWithWalls_legacy_vertical_handleStandup()

float proofps_dd::Physics::serverPlayerCollisionWithWalls_legacy_vertical_handleStandup ( Player & player,
const float & fPlayerOPos1XMinusHalf,
const float & fPlayerOPos1XPlusHalf )
private

If the player is currently crouching but wants to stand up, it checks it there is enough space for standing up and if so, it makes the player stand up.

Shall not be called if the player is somersaulting now.

Returns
The new Y-size of the player (it stays the same if the player cannot stand up, does not want to stand up, already standing, etc.).

Definition at line 810 of file Physics.cpp.

◆ serverSetAllowStrafeMidAir()

void proofps_dd::Physics::serverSetAllowStrafeMidAir ( bool bAllow)
protected

Definition at line 238 of file Physics.cpp.

◆ serverSetAllowStrafeMidAirFull()

void proofps_dd::Physics::serverSetAllowStrafeMidAirFull ( bool bAllow)
protected

Definition at line 243 of file Physics.cpp.

◆ serverSetCollisionModeBvh()

void proofps_dd::Physics::serverSetCollisionModeBvh ( bool state)
protected

Definition at line 253 of file Physics.cpp.

◆ serverSetFallDamageMultiplier()

void proofps_dd::Physics::serverSetFallDamageMultiplier ( int n)
protected

Definition at line 248 of file Physics.cpp.

Member Data Documentation

◆ m_bAllowStrafeMidAir

bool proofps_dd::Physics::m_bAllowStrafeMidAir
private

Definition at line 106 of file Physics.h.

◆ m_bAllowStrafeMidAirFull

bool proofps_dd::Physics::m_bAllowStrafeMidAirFull
private

Definition at line 107 of file Physics.h.

◆ m_bCollisionModeBvh

bool proofps_dd::Physics::m_bCollisionModeBvh
private

Definition at line 109 of file Physics.h.

◆ m_durations

proofps_dd::Durations& proofps_dd::Physics::m_durations
private

Definition at line 102 of file Physics.h.

◆ m_mapPlayers

std::map<pge_network::PgeNetworkConnectionHandle, proofps_dd::Player>& proofps_dd::Physics::m_mapPlayers
private

Definition at line 103 of file Physics.h.

◆ m_maps

proofps_dd::Maps& proofps_dd::Physics::m_maps
private

Definition at line 104 of file Physics.h.

◆ m_nFallDamageMultiplier

int proofps_dd::Physics::m_nFallDamageMultiplier
private

Definition at line 108 of file Physics.h.

◆ m_pge

PGE& proofps_dd::Physics::m_pge
private

Definition at line 101 of file Physics.h.

◆ m_sounds

proofps_dd::Sounds& proofps_dd::Physics::m_sounds
private

Definition at line 105 of file Physics.h.


The documentation for this class was generated from the following files: