当前位置: 首页>>代码示例>>C++>>正文


C++ CActor::Cameras方法代码示例

本文整理汇总了C++中CActor::Cameras方法的典型用法代码示例。如果您正苦于以下问题:C++ CActor::Cameras方法的具体用法?C++ CActor::Cameras怎么用?C++ CActor::Cameras使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CActor的用法示例。


在下文中一共展示了CActor::Cameras方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnZoomIn

void CWeaponMagazined::OnZoomIn()
{
	inherited::OnZoomIn();

	if (GetState() == eIdle)
		PlayAnimIdle();

	CActor* pActor = smart_cast<CActor*>(H_Parent());
	if (pActor)
	{
																					
		HUD_SOUND::StopSound(sndSightsUp);													//daemonion - iron sight audio - sights being raised
		HUD_SOUND::StopSound(sndSightsDown);												//									
		bool b_hud_mode = (Level().CurrentEntity() == H_Parent());							//
		HUD_SOUND::PlaySound(sndSightsUp, H_Parent()->Position(), H_Parent(), b_hud_mode);	//--END	

		CEffectorZoomInertion* S = smart_cast<CEffectorZoomInertion*>	(pActor->Cameras().GetCamEffector(eCEZoom));
		if (!S)
		{
			S = (CEffectorZoomInertion*)pActor->Cameras().AddCamEffector(xr_new<CEffectorZoomInertion>());
			S->Init(this);
		};
		S->SetRndSeed(pActor->GetZoomRndSeed());
		R_ASSERT(S);
	}
}
开发者ID:Karlan88,项目名称:xray,代码行数:26,代码来源:WeaponMagazined.cpp

示例2:

void CWeaponMagazined::OnZoomIn			()
{
	inherited::OnZoomIn();

	if(GetState() == eIdle)
		PlayAnimIdle();


	CActor* pActor = smart_cast<CActor*>(H_Parent());
	if(pActor)
	{
		CEffectorZoomInertion* S = smart_cast<CEffectorZoomInertion*>	(pActor->Cameras().GetCamEffector(eCEZoom));
		if (!S)	
		{
			S = (CEffectorZoomInertion*)pActor->Cameras().AddCamEffector(xr_new<CEffectorZoomInertion> ());
			S->Init(this);
		};
		S->SetRndSeed(pActor->GetZoomRndSeed());
		R_ASSERT				(S);
	}
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:21,代码来源:WeaponMagazined.cpp

示例3: UpdateNightVisionMode

void CCustomDetector::UpdateNightVisionMode()
{
//	CObject* tmp = Level().CurrentViewEntity();	
	bool bNightVision = false;
	if (GameID() == GAME_SINGLE)
	{
		bNightVision = Actor()->Cameras().GetPPEffector(EEffectorPPType(effNightvision))!=NULL;
	}
	else
	{
		if (Level().CurrentViewEntity() && 
			Level().CurrentViewEntity()->CLS_ID == CLSID_OBJECT_ACTOR)
		{
			CActor* pActor = smart_cast<CActor*>(Level().CurrentViewEntity());
			if (pActor)
				bNightVision = pActor->Cameras().GetPPEffector(EEffectorPPType(effNightvision))!=NULL;
		}
	}

	bool bOn =	bNightVision && 
				m_pCurrentActor &&
				m_pCurrentActor==Level().CurrentViewEntity()&& 
				IsWorking() && 
				m_nightvision_particle.size();

	ZONE_INFO_MAP_IT it;
	for(it = m_ZoneInfoMap.begin(); m_ZoneInfoMap.end() != it; ++it) 
	{
		CCustomZone *pZone = it->first;
		ZONE_INFO& zone_info = it->second;

		if(bOn){
			Fvector zero_vector;
			zero_vector.set(0.f,0.f,0.f);

			if(!zone_info.pParticle)
				zone_info.pParticle = CParticlesObject::Create(*m_nightvision_particle,FALSE);
			
			zone_info.pParticle->UpdateParent(pZone->XFORM(),zero_vector);
			if(!zone_info.pParticle->IsPlaying())
				zone_info.pParticle->Play();
		}else{
			if(zone_info.pParticle){
				zone_info.pParticle->Stop			();
				CParticlesObject::Destroy(zone_info.pParticle);
			}
		}
	}
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:49,代码来源:CustomDetector.cpp

示例4: OnZoomOut

void CWeaponMagazined::OnZoomOut()
{
	if (!m_bZoomMode) return;

	inherited::OnZoomOut();

	if (GetState() == eIdle)
		PlayAnimIdle();

	CActor* pActor = smart_cast<CActor*>(H_Parent());
																						
	HUD_SOUND::StopSound(sndSightsUp);													//daemonion - iron sight audio - sights being lowered
	HUD_SOUND::StopSound(sndSightsDown);												//									
	bool b_hud_mode = (Level().CurrentEntity() == H_Parent());							//
	HUD_SOUND::PlaySound(sndSightsDown, H_Parent()->Position(), H_Parent(), b_hud_mode);//--END

	if(pActor)
		pActor->Cameras().RemoveCamEffector(eCEZoom);
}
开发者ID:Karlan88,项目名称:xray,代码行数:19,代码来源:WeaponMagazined.cpp


注:本文中的CActor::Cameras方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。