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


C++ IActionMapManager::EnableActionMap方法代码示例

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


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

示例1: EnableActionMaps

void CVehicleClient::EnableActionMaps(IVehicleSeat* pSeat, bool enable)
{
	assert(pSeat);

	// illegal to change action maps in demo playback - Lin
	if (!IsDemoPlayback() && pSeat)	
	{
		IActionMapManager* pActionMapMan = g_pGame->GetIGameFramework()->GetIActionMapManager();
		CRY_ASSERT(pActionMapMan);

		pActionMapMan->EnableActionMap("player", !enable);

		EntityId passengerID = pSeat->GetPassenger();
	
		// now the general vehicle controls
		if (IActionMap* pActionMap = pActionMapMan->GetActionMap("vehicle_general"))
		{
			pActionMap->SetActionListener(enable ? passengerID : 0);	
			pActionMapMan->EnableActionMap("vehicle_general", enable);
		}

		// todo: if necessary enable the vehicle-specific action map here

		// specific controls for this vehicle seat
		const char* actionMap = pSeat->GetActionMap();
		if (actionMap && actionMap[0])
		{
			if (IActionMap* pActionMap = pActionMapMan->GetActionMap(actionMap))
			{
				pActionMap->SetActionListener(enable ? passengerID : 0);
				pActionMapMan->EnableActionMap(actionMap, enable);
			}
		}
	}
}
开发者ID:nhnam,项目名称:Seasons,代码行数:35,代码来源:VehicleClient.cpp

示例2: PerformRipOff

//----------------------------------------------------------------------
void CVehicleMountedWeapon::PerformRipOff(CActor* pOwner)
{
	IActionMapManager* pMapManager = gEnv->pGame->GetIGameFramework()->GetIActionMapManager();
	assert(pMapManager);
	pMapManager->EnableActionMap("vehicle_general", false);

	IVehicle *pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(m_vehicleId);
	if(pVehicle)
	{
		SVehicleEventParams params;
		params.entityId = GetEntityId();

		pVehicle->BroadcastVehicleEvent(eVE_WeaponRemoved, params);

		if(pOwner)
		{
			if(gEnv->bMultiplayer)
			{
				const IEntity* pVehicleEnt = pVehicle->GetEntity();
				IEntity* pEntity		  = pOwner->GetEntity(); 
				const Matrix34& vehWMat   = pVehicleEnt->GetWorldTM(); 
				m_previousWSpaceOffsetPosition = pEntity->GetWorldPos();
				m_localRipUserOffset = vehWMat.GetInverted().TransformPoint(m_previousWSpaceOffsetPosition); 
			}

			pOwner->LinkToVehicle(0);
		}

		m_previousVehicleRotation = pVehicle->GetEntity()->GetWorldRotation();
	}

	CHeavyMountedWeapon::PerformRipOff(pOwner);
}
开发者ID:amrhead,项目名称:eaascode,代码行数:34,代码来源:VehicleMountedWeapon.cpp

示例3: OnStep

	EContextEstablishTaskResult OnStep( SContextEstablishState& state )
	{
		IActionMapManager *pActionMapMan = CCryAction::GetCryAction()->GetIActionMapManager();
		pActionMapMan->Enable(false);
		pActionMapMan->EnableActionMap("player", true);
		pActionMapMan->EnableFilter(0, false); // disable all actionfilters
		return eCETR_Ok;
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:8,代码来源:CET_ActionMap.cpp

示例4: OnEnterVehicleSeat

//------------------------------------------------------------------------
void CVehicleClient::OnEnterVehicleSeat(IVehicleSeat* pSeat)
{
	m_bMovementFlagRight=m_bMovementFlagLeft=m_bMovementFlagForward=m_bMovementFlagBack=false;
  m_fLeftRight = m_fForwardBackward = 0.f;

	IVehicle* pVehicle = pSeat->GetVehicle();
	assert(pVehicle);

	IActorSystem* pActorSystem = gEnv->pGame->GetIGameFramework()->GetIActorSystem();
	assert(pActorSystem);

	IActor* pActor = pActorSystem->GetActor(pSeat->GetPassenger());
	bool isThirdPerson = pActor->IsThirdPerson() || m_tp;

	TVehicleViewId viewId = InvalidVehicleViewId;
	TVehicleViewId firstViewId = InvalidVehicleViewId;

	while (viewId = pSeat->GetNextView(viewId))
	{
		if (viewId == firstViewId)
			break;

		if (firstViewId == InvalidVehicleViewId)
			firstViewId = viewId;

		if (IVehicleView* pView = pSeat->GetView(viewId))
		{
			if (pView->IsThirdPerson() == isThirdPerson)
				break;
		}
	}

	if (viewId != InvalidVehicleViewId)
		pSeat->SetView(viewId);

	IActionMapManager* pMapManager = gEnv->pGame->GetIGameFramework()->GetIActionMapManager();
	assert(pMapManager);

	pMapManager->EnableActionMap("landvehicle", false);
	pMapManager->EnableActionMap("seavehicle", false);
	pMapManager->EnableActionMap("helicopter", false);
	pMapManager->EnableActionMap("vtol", false);

    pMapManager->EnableFilter ( "vehicle_no_seat_change_and_exit", true );
}
开发者ID:MrHankey,项目名称:destructionderby,代码行数:46,代码来源:VehicleClient.cpp


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