• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetPortBool函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetPortBool函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPortBool函数的具体用法?C++ GetPortBool怎么用?C++ GetPortBool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: ProcessEvent

 virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
 {
     switch (event)
     {
     case eFE_Update:
     {
         bool bPaused = GetPortBool(pActInfo,IN_PAUSED);
         if (!bPaused)
         {
             float fSeconds = gEnv->pTimer->GetFrameStartTime().GetSeconds();
             ActivateOutput( pActInfo,OUT_SECONDS,fSeconds );
             ActivateOutput( pActInfo,OUT_TICK,0 );
         }
     }
     break;
     case eFE_Initialize:
     {
         bool bPaused = GetPortBool(pActInfo,IN_PAUSED);
         pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, !bPaused );
         break;
     }
     case eFE_Activate:
         if (IsPortActive(pActInfo,IN_PAUSED))
         {
             bool bPaused = GetPortBool(pActInfo,IN_PAUSED);
             pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, !bPaused );
         }
         break;
     }
 }
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:30,代码来源:FlowTimeNode.cpp


示例2: GetPortFloat

void CFlowNode_ScreenFader::ProcessActivateEvent(SActivationInfo* activationInformation)
{
	if (InputEntityIsLocalPlayer(activationInformation) == false)
		return;

	if (IsPortActive(activationInformation, eInputPorts_FadeIn))
	{
		const float fadeInTime = GetPortFloat(activationInformation, eInputPorts_FadeInTime);
		const Vec3 fadeColor = GetPortVec3(activationInformation, eInputPorts_FadeColor);
		const string texture = GetPortString(activationInformation, eInputPorts_Texture);
		const bool useCurrentColor = GetPortBool(activationInformation, eInputPorts_UseCurrentColor);
		ColorF color;
		color.Set(fadeColor.x, fadeColor.y, fadeColor.z);
		m_environment.GetGame().FadeInScreen(texture, color, fadeInTime, useCurrentColor);
	}
	else if (IsPortActive(activationInformation, eInputPorts_FadeOut))
	{
		const float fadeOutTime = GetPortFloat(activationInformation, eInputPorts_FadeOutTime);
		const Vec3 fadeColor = GetPortVec3(activationInformation, eInputPorts_FadeColor);
		const string texture = GetPortString(activationInformation, eInputPorts_Texture);
		const bool useCurrentColor = GetPortBool(activationInformation, eInputPorts_UseCurrentColor);
		ColorF color;
		color.Set(fadeColor.x, fadeColor.y, fadeColor.z);
		m_environment.GetGame().FadeOutScreen(texture, color, fadeOutTime, useCurrentColor);	
	}

}
开发者ID:aronarts,项目名称:FireNET,代码行数:27,代码来源:ScreenFaderNode.cpp


示例3: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			{
				m_bResult = 2;
				break;
			}

		case eFE_Activate:
			{
				bool a = GetPortBool(pActInfo,INP_A);
				bool b = GetPortBool(pActInfo,INP_B);
				int result = Execute(a,b)? 1 : 0;
				bool activateOutputs = GetPortBool( pActInfo, INP_Always ) || m_bResult!=result;
				m_bResult = result;
				if (activateOutputs)
				{
					ActivateOutput( pActInfo,0,result );
					if(result)
						ActivateOutput( pActInfo,1,true );
					else
						ActivateOutput( pActInfo,2,true );
				}
			}
		};
	};
开发者ID:aronarts,项目名称:FireNET,代码行数:28,代码来源:FlowLogicNodes.cpp


示例4: switch

void CFlashUIActionNode::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
	switch (event)
	{
	case eFE_Initialize:
		m_bWasStarted = false;
		m_startStack.clear();
		m_endStack.clear();
		m_selfEndStack.clear();
		m_startStack.init(pActInfo->pGraph);
		m_endStack.init(pActInfo->pGraph);
		m_selfEndStack.init(pActInfo->pGraph);
		UpdateAction(GetPortString(pActInfo, eI_UIAction).c_str(), GetPortBool(pActInfo, eI_Strict));
		pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
		break;
	case eFE_Activate:
		UpdateAction(GetPortString(pActInfo, eI_UIAction).c_str(), GetPortBool(pActInfo, eI_Strict));

		if (gEnv->pFlashUI && m_pAction)
		{
			if (IsPortActive(pActInfo, eI_StartAction))
			{
				SUIArguments args(GetPortString(pActInfo, eI_Args).c_str(), true);
				gEnv->pFlashUI->GetUIActionManager()->StartAction(m_pAction, args);
				ActivateOutput(pActInfo, eO_UIOnStart, true);
				m_bWasStarted = true;
			}
		}
		break;
	case eFE_Update:
		FlushNextAction(pActInfo);
		break;
	}
}
开发者ID:aronarts,项目名称:FireNET,代码行数:34,代码来源:FlashUIActionNodes.cpp


示例5: ReadCurrentInputParams

	//----------------------------------------------------------------------
	void ReadCurrentInputParams( SActivationInfo* pActInfo, SInputParams &inputParams )
	{
		int presetIndex = GetPortInt( pActInfo, EIP_Preset );
		if (presetIndex > 0 && presetIndex <= NUM_PRESETS)
		{
			inputParams       = m_Presets[presetIndex - 1];
			inputParams.angle = Ang3(DEG2RAD(m_Presets[presetIndex - 1].angle));
		}
		else
		{
			inputParams.groundOnly      = GetPortBool(pActInfo, EIP_GroundOnly);
			inputParams.isSmooth        = GetPortBool(pActInfo, EIP_Smooth);
			inputParams.restriction     = eRestriction( GetPortInt(pActInfo, EIP_Restriction));
			inputParams.view            = eViewType( GetPortInt(pActInfo, EIP_ViewType));
			inputParams.angle           = Ang3(DEG2RAD(GetPortVec3(pActInfo, EIP_Angle)));
			inputParams.shift           = GetPortVec3(pActInfo, EIP_Shift);
			inputParams.frequency       = GetPortFloat(pActInfo, EIP_Frequency);
			inputParams.randomness      = GetPortFloat(pActInfo, EIP_Randomness);
			inputParams.distance        = GetPortFloat(pActInfo, EIP_Distance);
			inputParams.rangeMin        = GetPortFloat(pActInfo, EIP_RangeMin);
			inputParams.rangeMax        = GetPortFloat(pActInfo, EIP_RangeMax);
			inputParams.sustainDuration = GetPortFloat(pActInfo, EIP_SustainDuration);
			inputParams.fadeInDuration  = GetPortFloat(pActInfo, EIP_FadeInDuration);
			inputParams.fadeOutDuration = GetPortFloat(pActInfo, EIP_FadeOutDuration);
		}
	}
开发者ID:joewan,项目名称:pycmake,代码行数:27,代码来源:FlowCameraNodes.cpp


示例6: ProcessEvent

        virtual void ProcessEvent( EFlowEvent event, SActivationInfo* pActInfo )
        {

            if ( event == eFE_Initialize )
            {
                m_actInfo = *pActInfo;
                active = GetPortBool( pActInfo, 0 );
                pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, true );
            }

            if ( event == eFE_Activate )
            {
                active = GetPortBool( pActInfo, 0 );
            }

            if ( event == eFE_Update  && active )
            {

                int w_id = GetPortInt( pActInfo, 1 );

                if ( w_id < 0 || w_id >= CryVR_WiimoteManagerPlugin::found )
                {
                    return ;
                }


                int i = 0;
                wiimote** manettes =  CryVR_WiimoteManagerPlugin::GetWiimotes();

                //Optimisation v0.1
                wiimote_move = false;
                nunchuk_move = false;


                while ( wiiuse_poll( manettes, CryVR_WiimoteManagerPlugin::found ) && i < GetPortInt( pActInfo, 2 ) )
                {
                    if ( CryVR_WiimoteManagerPlugin::GetWiimotes( w_id )->event == WIIUSE_EVENT )
                    {
                        i++;
                        handle_event( CryVR_WiimoteManagerPlugin::GetWiimotes( w_id ) );
                    }

                    else if ( CryVR_WiimoteManagerPlugin::GetWiimotes( w_id )->event == WIIUSE_NUNCHUK_INSERTED || CryVR_WiimoteManagerPlugin::GetWiimotes( w_id )->event == WIIUSE_NUNCHUK_REMOVED )
                    {
                        CryVR_WiimoteManagerPlugin::Status( w_id );
                    }

                    //Recherche d'optimisation.
                    if ( nunchuk_move && wiimote_move && GetPortBool( pActInfo, 3 ) )
                    {

                        return ;
                    }

                }
            }
        }
开发者ID:lefevren,项目名称:Plugin_WiiDevices,代码行数:57,代码来源:CryVR_WiimoteControler.cpp


示例7: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		m_actInfo = *pActInfo;
		switch(event)
		{
			case eFE_Initialize:
			{
				m_bOutputScreenCoords = GetPortBool(pActInfo, EIP_Screen);
				m_bOutputWorldCoords = GetPortBool(pActInfo, EIP_World);
				m_bOutputDeltaCoords = GetPortBool(pActInfo, EIP_DeltaScreen);
				
				break;
			}
			case eFE_Activate:
				{
					if(IsPortActive(pActInfo, EIP_Enable))
					{
						if (gEnv->pHardwareMouse)
							gEnv->pHardwareMouse->AddListener(this);

						if (GetISystem() && GetISystem()->GetIInput())
							GetISystem()->GetIInput()->AddEventListener(this);

						m_bOutputScreenCoords = GetPortBool(pActInfo, EIP_Screen);
						m_bOutputWorldCoords = GetPortBool(pActInfo, EIP_World);
						m_bOutputDeltaCoords = GetPortBool(pActInfo, EIP_DeltaScreen);
						
						m_enabled = true;
					}

					if(IsPortActive(pActInfo, EIP_Disable))
					{
						if (gEnv->pHardwareMouse)
							gEnv->pHardwareMouse->RemoveListener(this);

						if (GetISystem() && GetISystem()->GetIInput())
							GetISystem()->GetIInput()->RemoveEventListener(this);

						m_enabled = false;
					}

					if(IsPortActive(pActInfo, EIP_World))
					{
						m_bOutputWorldCoords = GetPortBool(pActInfo, EIP_World);
					}

					if(IsPortActive(pActInfo, EIP_Screen))
					{
						m_bOutputScreenCoords = GetPortBool(pActInfo, EIP_Screen);
					}

					if(IsPortActive(pActInfo, EIP_DeltaScreen))
					{
						m_bOutputDeltaCoords = GetPortBool(pActInfo, EIP_DeltaScreen);
					}

				break;
			}
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:60,代码来源:FlowMouseInfo.cpp


示例8: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{

		if(event==eFE_Initialize) {
			m_actInfo = *pActInfo;
			return ;
		}

		if(event==eFE_Activate){
			CryLogAlways(" *** GuitarHero Controler beta version *** ");
			active = GetPortBool(pActInfo, 0);
			
			pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID,true);
			return ;
		}

		if(event== eFE_Update) 
			{
				gh3_move = false;
				int i = 0;
				int w_id = GetPortInt(pActInfo, 1);
				if(!active || w_id < 0 || w_id >= CryVR_WiimoteManager::found) return ;

				
				
				if(CryVR_WiimoteManager::GetMotionSensing(w_id) && CryVR_WiimoteManager::GetWiimotes(w_id)->exp.type == 0){
					was_motion_sensing_active = true;
					CryLogAlways(" *** GuitarHero Controler force Motion Sensing off during connection *** ");
					CryVR_WiimoteManager::SetMotionSensing(w_id,false);
				}

				if(CryVR_WiimoteManager::GetWiimotes(w_id)->exp.type == EXP_CLASSIC && was_motion_sensing_active){
					CryLogAlways(" *** GuitarHero set Motion Sensing previous state *** ");
					//CryVR_WiimoteManager::SetMotionSensing(w_id,true);
					was_motion_sensing_active = false;
					CryVR_WiimoteManager::Status(CryVR_WiimoteManager::GetWiimotes(w_id));
				}
				
				
				/* fait planter la balance board ! */

				while (wiiuse_poll(CryVR_WiimoteManager::GetWiimotes(), CryVR_WiimoteManager::found) && i<GetPortInt(pActInfo, 2)) 
					{	
						if(CryVR_WiimoteManager::GetWiimotes(w_id)->event == WIIUSE_EVENT) {
							handle_event(CryVR_WiimoteManager::GetWiimotes(w_id));
						}

						//Recherche d'optimisation.
						if (GetPortBool(pActInfo, 3)) {
							return ; 
						}
						i++;
					}
			}
	}
开发者ID:amyvmiwei,项目名称:CryVR,代码行数:55,代码来源:CryVR_WiimoteGuitarHeroControler.cpp


示例9: UpdateUIElement

void CFlashUIConstraintsNode::ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )
{
    if ( event == eFE_Initialize )
    {
        UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
    }
    else if ( event == eFE_Activate )
    {
        if ( IsPortActive( pActInfo, eI_UIElement ) )
        {
            UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
        }

        const int instanceId = GetPortInt( pActInfo, eI_InstanceID );
        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            IUIElement::SUIConstraints constraints;
            SPerInstanceCall1< IUIElement::SUIConstraints& > caller;
            if ( !caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIConstraintsNode::GetConstraints), constraints, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" can't get Constraints for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetPortString(pActInfo, eI_UIElement).c_str() ,instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ) );
            }
            ActivateOutput( pActInfo, eO_PosType, (int) constraints.eType );
            ActivateOutput( pActInfo, eO_Left, constraints.iLeft );
            ActivateOutput( pActInfo, eO_Top, constraints.iTop );
            ActivateOutput( pActInfo, eO_Width, constraints.iWidth );
            ActivateOutput( pActInfo, eO_Height, constraints.iHeight );
            ActivateOutput( pActInfo, eO_Scale, constraints.bScale );
            ActivateOutput( pActInfo, eO_HAlign, (int) constraints.eHAlign );
            ActivateOutput( pActInfo, eO_VAlign, (int) constraints.eVAlign );
            ActivateOutput( pActInfo, eO_Maximize, constraints.bMax );
            ActivateOutput( pActInfo, eO_OnGet, true );
        }

        if ( IsPortActive( pActInfo, eI_Set ) )
        {
            IUIElement::SUIConstraints constraints;
            constraints.eType = (IUIElement::SUIConstraints::EPositionType) GetPortInt( pActInfo, eI_PosType );
            constraints.iLeft = GetPortInt( pActInfo, eI_Left );
            constraints.iTop = GetPortInt( pActInfo, eI_Top );
            constraints.iWidth = GetPortInt( pActInfo, eI_Width );
            constraints.iHeight = GetPortInt( pActInfo, eI_Height );
            constraints.eHAlign = (IUIElement::SUIConstraints::EPositionAlign) GetPortInt( pActInfo, eI_HAlign );
            constraints.eVAlign = (IUIElement::SUIConstraints::EPositionAlign) GetPortInt( pActInfo, eI_VAlign );
            constraints.bScale = GetPortBool( pActInfo, eI_Scale );
            constraints.bMax = GetPortBool( pActInfo, eI_Maximize );

            SPerInstanceCall1< const IUIElement::SUIConstraints& > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIConstraintsNode::SetConstraints), constraints);

            ActivateOutput( pActInfo, eO_OnSet, true );
        }
    }
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:54,代码来源:FlashUIDisplayNodes.cpp


示例10: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		switch (event)
		{
			case eFE_Activate:
			{
				if (IsPortActive(pActInfo, EIP_Start))
				{
					m_List.clear();
					m_ListIter = m_List.end();
					m_Iter = 0;
					m_Count = 0;

					OnIterStart(pActInfo);
					m_ListIter = m_List.begin();

					if (m_Count <= 0)
					{
						// None found
						ActivateOutput(pActInfo, EOP_Done, 0);
					}
					else
					{
						const bool bImmediate = GetPortBool(pActInfo, EIP_Immediate);
						const bool bFirstResult = SendNext(pActInfo);
						if (bImmediate && bFirstResult)
						{
							pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
						}
					}
				}
				else if (IsPortActive(pActInfo, EIP_Next))
				{
					const bool bImmediate = GetPortBool(pActInfo, EIP_Immediate);
					if (!bImmediate)
					{
						SendNext(pActInfo);
					}
				}
			}
			break;

			case eFE_Update:
			{
				if (!SendNext(pActInfo))
				{
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
				}

			}
			break;
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:53,代码来源:FlowEntityIterator.cpp


示例11: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
	{
		CCamera camera(gEnv->pSystem->GetViewCamera());
		Vec3    pos(camera.GetPosition());
		Vec3    dir(camera.GetViewdir());
		float   roll(camera.GetAngles().z); // GetAngles() returns YPR angles - roll is in z component

		switch (event)
		{
		case eFE_Initialize:
			pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, GetPortBool(pActInfo, 3));
			break;
		case eFE_Activate:
		{
			if (InputEntityIsLocalPlayer( pActInfo ))
			{
				if (IsPortActive(pActInfo, 0))
					pos = GetPortVec3(pActInfo, 0);
				if (IsPortActive(pActInfo, 1))
					dir = GetPortVec3(pActInfo, 1);
				if (IsPortActive(pActInfo, 2))
					roll = GetPortFloat(pActInfo, 2);

				if (IsPortActive(pActInfo, 3))
				{
					pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, GetPortBool(pActInfo, 3));
				}

				if (dir.len2() > 0.0f)
				{
					dir.Normalize();
					camera.SetMatrix(CCamera::CreateOrientationYPR(CCamera::CreateAnglesYPR(dir, roll)));
					camera.SetPosition(pos);
					gEnv->pSystem->SetViewCamera(camera);
				}
			}
		}
		break;
		case eFE_Update:
		{
			if (InputEntityIsLocalPlayer( pActInfo ))
			{
				ActivateOutput(pActInfo, 0, pos);
				ActivateOutput(pActInfo, 1, dir);
				ActivateOutput(pActInfo, 2, roll);
			}
		}
		break;
		}
	}
开发者ID:joewan,项目名称:pycmake,代码行数:50,代码来源:FlowCameraNodes.cpp


示例12: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, true );
			m_Activated = false;
			break;

		case eFE_Update:
			{
				bool bReset = GetPortBool(pActInfo, IN_RESET);
				bool bCondition = GetPortBool(pActInfo, IN_CONDITION);

				if(bReset)
				{
					ActivateOutput(pActInfo, OUT_SLEEPING, !bCondition);
				} else
				{
					if(bCondition != m_Activated)
					{
						IEntity * pEntity = pActInfo->pEntity;

						if (pEntity)
						{
							IPhysicalEntity * pPhysEntity = pEntity->GetPhysics();

							if (pPhysEntity)
							{
								pe_status_awake psa;

								bool isSleeping = pPhysEntity->GetStatus( &psa ) ? false : true;

								ActivateOutput(pActInfo, OUT_SLEEPING, isSleeping);

								if(isSleeping)
									ActivateOutput(pActInfo, OUT_ONSLEEP, true);
								else
									ActivateOutput(pActInfo, OUT_ONAWAKE, true);
							}
						}

						m_Activated = bCondition;
					}
				}
			}
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:48,代码来源:FlowPhysicsNodes.cpp


示例13: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
			case eFE_Initialize:
			{
				UpdateListenerStatus( pActInfo );
				m_actInfo = *pActInfo;
				m_lastColourPortTriggered = NOPORT;
				break;
			}

			case eFE_Activate:
			{
				if (IsPortActive(pActInfo, INP_ENABLED))
				{
					UpdateListenerStatus( pActInfo );
					bool enabled = GetPortBool( pActInfo, INP_ENABLED );
					if (enabled)
						UpdateOutputs( g_pGame->GetGameAISystem()->GetAIAwarenessToPlayerHelper().GetIntAwareness() );
				}
				break;
			}
		}
	}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:25,代码来源:AINodes.cpp


示例14: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		switch (event)
		{
		case eFE_Activate:
			{
				IEntity* pEntity = pActInfo->pEntity;
				if(!pEntity)
					return;

				m_delayResult = GetPortBool(pActInfo, EIP_DelayResult);

				if(IsPortActive(pActInfo, EIP_Enable))
				{
					m_actInfo = *pActInfo;
					m_entityId = pEntity->GetId();
					SetEnabled(true);
				}
				else if(IsPortActive(pActInfo, EIP_Disable))
				{
					SetEnabled(false);
				}
				break;
			}
		}
	}
开发者ID:Xydrel,项目名称:Infected,代码行数:26,代码来源:TacticalScanNode.cpp


示例15: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Activate:
			if (IsPortActive(pActInfo,eIP_Get))
			{
				ITimeOfDay* pTOD = gEnv->p3DEngine->GetTimeOfDay();
				if (pTOD)
				{
					ActivateOutput(pActInfo, eOP_Latitude, pTOD->GetSunLatitude());
					ActivateOutput(pActInfo, eOP_Longitude, pTOD->GetSunLongitude());
				}
			}
			if (IsPortActive(pActInfo, eIP_Set))
			{
				ITimeOfDay* pTOD = gEnv->p3DEngine->GetTimeOfDay();
				if (pTOD)
				{
					float latitude = GetPortFloat(pActInfo, eIP_Latitude);
					float longitude = GetPortFloat(pActInfo, eIP_Longitude);

					pTOD->SetSunPos( longitude, latitude );
					bool forceUpdate = GetPortBool( pActInfo, eIP_ForceUpdate );
					pTOD->Update(true, forceUpdate);
					
					ActivateOutput(pActInfo, eOP_Latitude, latitude);
					ActivateOutput(pActInfo, eOP_Longitude, longitude);
				}
			}
			break;
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:33,代码来源:FlowEnvironmentNodes.cpp


示例16: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		

		int butt= 0;

		switch (event)
		{
		case eFE_Initialize:
			{
				vrpn_analog = (vrpn_ANALOGCB *) malloc(sizeof(vrpn_ANALOGCB)*2);
				vrpn_analog_remote = new vrpn_Analog_Remote(GetPortString(pActInfo, 1));
				vrpn_analog_remote->register_change_handler(vrpn_analog,handle_analog_wii);
			
				vrpn_buttons = (vrpn_BUTTONCB *) malloc(sizeof(vrpn_BUTTONCB)*2);
				vrpn_buttons_remote = new vrpn_Button_Remote(GetPortString(pActInfo, 1));
				vrpn_buttons_remote->register_change_handler(vrpn_buttons,handle_button_change_wii);
			}
			break;
		case eFE_Activate:
			{
				if ( IsPortActive( pActInfo, ACTIVE ) ){
					active = GetPortBool( pActInfo, ACTIVE);
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID,true);
				}
				
			}
			break;
		
		case eFE_Update:
			{	
				if (!active) return ;

				if (vrpn_analog_remote){
					vrpn_analog_remote->mainloop();
					float angleJoystick = (float)vrpn_analog->channel[19];
					float intensityJoystick = (float)vrpn_analog->channel[20];

					if (intensityJoystick != 0) {
						ActivateOutput(pActInfo, WII_NUN_INTENSITY,intensityJoystick);
						ActivateOutput(pActInfo, WII_NUN_ANGLE,angleJoystick);
					}

					float gravity_x = (float)vrpn_analog->channel[1];
					float gravity_y = (float)vrpn_analog->channel[2];
					float gravity_z = (float)vrpn_analog->channel[3];

					ActivateOutput(pActInfo, WII_WIIMOTE_GRAVITY_X,gravity_x);
					ActivateOutput(pActInfo, WII_WIIMOTE_GRAVITY_Y,gravity_y);
					ActivateOutput(pActInfo, WII_WIIMOTE_GRAVITY_Z,gravity_z);
					
				}	

				if(vrpn_buttons_remote){
					vrpn_buttons_remote->mainloop();
					ActivateOutput(pActInfo,(int)vrpn_buttons->button, (int)vrpn_buttons->state);
				}
			}
		}
	}
开发者ID:amyvmiwei,项目名称:CryVR,代码行数:60,代码来源:FlowVRPNWiimote.cpp


示例17: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		if (event == eFE_Activate || event == eFE_Initialize)
		{
			if (IsPortActive(pActInfo, INP_ACTIVE))
			{
				bool active = GetPortBool(pActInfo, 0);
				if (active)
					m_pGF->GetIItemSystem()->RegisterListener(this);
				else
					m_pGF->GetIItemSystem()->UnregisterListener(this);
			}
			if (IsPortActive(pActInfo, INP_CHECK))
			{
				IActor* pActor = GetInputActor( pActInfo );
				if (pActor)
				{
					IInventory* pInventory = pActor->GetInventory();
					if (pInventory)
					{
						IEntity* pEntityItem = gEnv->pEntitySystem->GetEntity( pInventory->GetCurrentItem() );
						TriggerOutputs( pActInfo, pEntityItem );
					}
				}
			}
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:27,代码来源:FlowInventoryNodes.cpp


示例18: data

Assignment CombatMoveAssignmentFlowNode::SpecifyAssignment( SActivationInfo* pActInfo )
{
	SmartScriptTable data(gEnv->pScriptSystem);
	data->SetValue("position", GetPortVec3(pActInfo, InputPort_Position));
	data->SetValue("useCover", GetPortBool(pActInfo, InputPort_UseCover));
	return Assignment(Assignment::CombatMove, data);
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:7,代码来源:AIAssignmentNodes.cpp


示例19: IsBoolPortActive

bool CGameFlowBaseNode::IsBoolPortActive( SActivationInfo *pActInfo,int nPort ) const
{
	if (IsPortActive(pActInfo,nPort) && GetPortBool(pActInfo,nPort))
		return true;
	else
		return false;
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:7,代码来源:GameFlowBaseNode.cpp


示例20: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{	
		switch (event)
		{
		case eFE_Initialize:
			{
				oef = new OneEuroFilter ();
			
			}
			break;
		case eFE_Activate:
			{
				if ( IsPortActive( pActInfo, ACTIVE ) ){
					active = GetPortBool( pActInfo, ACTIVE);
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID,true);
				}
			}
			break;
		
		case eFE_Update:
			{
				if(!active) return;

				oef->increaseTimeStamp(1.0/oef->getFrequence());
				float valeur =  GetPortFloat(pActInfo, IN_Value);
				float filtered = (float)oef->filter(valeur) ;
				ActivateOutput(pActInfo, OUT_Value,filtered);
			}
		}
	}
开发者ID:amyvmiwei,项目名称:CryVR,代码行数:30,代码来源:FlowOneEuroFilter.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetPortInt函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPort函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap