コード例 #1
0
ファイル: HeadBobMgr.cpp プロジェクト: Arc0re/lithtech
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
ファイル: HeadBobMgr.cpp プロジェクト: rickyharis39/nolf2
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();
	}
}