本文整理汇总了C++中GetPortBool函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPortBool函数的具体用法?C++ GetPortBool怎么用?C++ GetPortBool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPortBool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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 );
}
}
};
};
示例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;
}
}
示例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);
}
}
示例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 ;
}
}
}
}
示例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++;
}
}
}
示例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 );
}
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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