示例#1
0
void CHeadBobMgr::Update()
{
	CMoveMgr* pMoveMgr = g_pGameClientShell->GetMoveMgr();
	if (!pMoveMgr) return;

	// We check CanDoFootstep instead of on ground since CanDoFootstep
	// handles stairs much better...

	if (pMoveMgr->CanDoFootstep() && g_pGameClientShell->IsFirstPerson())
	{
		UpdateHeadBob();
		UpdateHeadCant();
	}
}
示例#2
0
void CHeadBobMgr::Update()
{
	// Don't allow head bobbing or canting to update when paused...

	if( g_pGameClientShell->IsGamePaused() )
		return;

	CMoveMgr* pMoveMgr = g_pPlayerMgr->GetMoveMgr();
	if (!pMoveMgr) return;

	// We check CanDoFootstep instead of on ground since CanDoFootstep
	// handles stairs much better...

	if ( (!g_pPlayerMgr->IsSpectatorMode() && g_pPlayerMgr->IsFirstPerson() && pMoveMgr->CanDoFootstep() &&
		 g_pPlayerMgr->IsPlayerMovementAllowed() && pMoveMgr->GetAllowMovement()) ||
		 pMoveMgr->GetVehicleMgr()->IsVehiclePhysics() )
	{
		UpdateHeadBob();
		UpdateHeadCant();
	}
}