Beispiel #1
0
//---------------------------------
void CScreenEffects::CamShake(Vec3 rotateShake, Vec3 shiftShake, float freq, float shakeTime, float randomness, int shakeID)
{
	if (g_pGameCVars && g_pGameCVars->g_detachCamera==0)
	{
		IViewSystem *pViewSystem = g_pGame->GetIGameFramework()->GetIViewSystem();
		if (pViewSystem)
		{
			IView *pView = pViewSystem->GetActiveView();
			if (pView)
			{
				const bool bClientActorView = pViewSystem->IsClientActorViewActive();;
				if (gEnv->pFlashUI)
				{
					gEnv->pFlashUI->SetHudElementsVisible(bClientActorView);
				}

				if (bClientActorView && shakeID == eCS_GID_Player)
				{
					CCCPOINT(Camera_DoShake);
					pView->SetViewShake(Ang3(rotateShake), shiftShake, shakeTime, freq, randomness, shakeID, false);
				}
			}
		}
	}
}
Beispiel #2
0
bool CGameEffect::OnCameraChange(const SCameraParams& cameraParams)
{
	IViewSystem *pViewSystem = g_pGame->GetIGameFramework()->GetIViewSystem();
	if (pViewSystem)
	{
		const bool bClientActorView = pViewSystem->IsClientActorViewActive();
		SetFlag(GAME_EFFECT_ACTIVE, bClientActorView);
		if (!bClientActorView)
			ResetRenderParameters();
	}

	return true;
}