本文整理汇总了C++中CKBehaviorPrototype::DeclareLocalParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ CKBehaviorPrototype::DeclareLocalParameter方法的具体用法?C++ CKBehaviorPrototype::DeclareLocalParameter怎么用?C++ CKBehaviorPrototype::DeclareLocalParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKBehaviorPrototype
的用法示例。
在下文中一共展示了CKBehaviorPrototype::DeclareLocalParameter方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateCISIteratorBBProto
/*
*******************************************************************
* Function: CKERROR CreateCISIteratorBBProto( CKBehaviorPrototype** behaviorPrototypePtr )
*
* Description : The prototype creation function will be called the first time
* a behavior must be created to create the CKBehaviorPrototype
* that contains the description of the behavior.
*
* Parameters :
* behaviorPrototypePtr w Pointer to a CKBehaviorPrototype object that
* describes the behavior's internal structure
* and relationships with other objects.
*
* Returns : CKERROR
*
*******************************************************************
*/
CKERROR CreateCISIteratorBBProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype(GBL_CI_API_ENTRY("CISIterator"));
if(!proto) return CKERR_OUTOFMEMORY;
proto->DeclareInput("On/Reset");
proto->DeclareOutput("Exit On/Reset");
proto->DeclareInput("Loop In");
proto->DeclareOutput("Loop Out");
proto->DeclareOutParameter("value", CKPGUID_STRING,"-1");
proto->DeclareOutParameter("default value", CKPGUID_STRING,"-1");
proto->DeclareOutParameter("unique name", CKPGUID_STRING,"");
proto->DeclareOutParameter("description", CKPGUID_STRING,"-1");
proto->DeclareOutParameter("access flags", CIPRTFLAGSGUID,"");
proto->DeclareOutParameter("parameter type", CKPGUID_PARAMETERTYPE,"-1");
proto->DeclareOutParameter("ci db index", CKPGUID_INT,"-1");
proto->DeclareLocalParameter(NULL, CKPGUID_INT); // index
proto->DeclareLocalParameter(NULL, CKPGUID_INT); // cis size
proto->DeclareLocalParameter(NULL, CKPGUID_POINTER); // ciid list
proto->DeclareSetting("Read From Database", CKPGUID_BOOL,"FALSE");
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorCallbackFct(CISIteratorCB);
proto->SetFunction(CISIteratorBB);
*pproto = proto;
return CK_OK;
}
示例2: CreatePMaterialIteratorProto
//************************************
// Method: CreatePMaterialIteratorProto
// FullName: CreatePMaterialIteratorProto
// Access: public
// Returns: CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePMaterialIteratorProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PMaterialIterator");
if(!proto) return CKERR_OUTOFMEMORY;
proto->DeclareInput("In");
proto->DeclareInput("Next");
proto->DeclareOutput("Finish");
proto->DeclareOutput("Loop");
proto->DeclareLocalParameter("current result", CKPGUID_POINTER, "0");
proto->DeclareOutParameter("Index",CKPGUID_INT);
proto->DeclareOutParameter("XML Link",VTE_XML_MATERIAL_TYPE);
proto->DeclareOutParameter("Name",CKPGUID_STRING);
proto->DeclareOutParameter("Dynamic Friction",CKPGUID_FLOAT);
proto->DeclareOutParameter("Static Friction",CKPGUID_FLOAT);
proto->DeclareOutParameter("Restitution",CKPGUID_FLOAT);
proto->DeclareOutParameter("Dynamic Friction V",CKPGUID_FLOAT);
proto->DeclareOutParameter("Static Friction V",CKPGUID_FLOAT);
proto->DeclareOutParameter("Direction of Anisotropy ",CKPGUID_VECTOR);
proto->DeclareOutParameter("Friction Combine Mode",VTE_MATERIAL_COMBINE_MODE);
proto->DeclareOutParameter("Restitution Combine Mode",VTE_MATERIAL_COMBINE_MODE);
proto->DeclareOutParameter("Flags",VTF_MATERIAL_FLAGS);
proto->DeclareOutParameter("Result",VTS_MATERIAL);
proto->SetBehaviorCallbackFct( PMaterialIteratorCB );
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
proto->SetFunction(PMaterialIterator);
*pproto = proto;
return CK_OK;
}
示例3: CreateMidiEventBehaviorProto
CKERROR CreateMidiEventBehaviorProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Midi Event");
if(!proto) return CKERR_OUTOFMEMORY;
proto->DeclareInput("On");
proto->DeclareInput("Off");
proto->DeclareOutput("Activated");
proto->DeclareOutput("Deactivated");
proto->DeclareInParameter("Channel", CKPGUID_INT, "0");
proto->DeclareInParameter("Note 1", CKPGUID_INT, "0");
proto->DeclareLocalParameter(NULL, CKPGUID_BOOL, "FALSE"); // Combination was ok
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetFunction(MidiEvent);
proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)(CKBEHAVIOR_VARIABLEPARAMETERINPUTS));
proto->SetBehaviorCallbackFct( MidiEventCallBack );
*pproto = proto;
return CK_OK;
}
示例4: CreatePacketIteratorProto
CKERROR CreatePacketIteratorProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype(GBL_CI_API_ENTRY("PacketIterator"));
if(!proto) return CKERR_OUTOFMEMORY;
proto->DeclareInput("On/Reset");
proto->DeclareOutput("Exit On/Reset");
proto->DeclareInput("Loop In");
proto->DeclareOutput("Loop Out");
proto->DeclareOutParameter("Target user id", CKPGUID_INT,"-1");
proto->DeclareOutParameter("Data", CKPGUID_STRING,"");
proto->DeclareOutParameter("Header", CKPGUID_STRING,"");
proto->DeclareOutParameter("PacketType", GUID_GBLCI_EPACKET_TYPE,"");
proto->DeclareOutParameter("Time Stamp", CKPGUID_INT,"-1");
proto->DeclareLocalParameter(NULL, CKPGUID_INT); // packet index
if(!GBLDebugBuild)
{
proto->SetFlags(CK_BEHAVIORPROTOTYPE_HIDDEN);
}else
{
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
}
proto->SetFunction(PacketIterator);
*pproto = proto;
return CK_OK;
}
示例5: CreatePrototype
/*
*******************************************************************
* Function: CKERROR CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
*
* Description : The prototype creation function will be called the first time
* a behavior must be created to create the CKBehaviorPrototype
* that contains the description of the behavior.
*
* Parameters :
* behaviorPrototypePtr Pointer to a CKBehaviorPrototype object that
* describes the behavior's internal structure
* and relationships with other objects.
*
* Returns : CKERROR
*
*******************************************************************
*/
CKERROR GBLCOBGWrapper::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
#if GBL_RUNTIME
// Not editable from Virtools Dev
CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototypeRunTime( "GBLCOBGWrapper" );
#elif GBL_GAMEDEVELOPER
// Edition depend on the BB.
CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLCOBGWrapper" );
#else
// Editable from Virtools Dev
CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLCOBGWrapper" );
#endif
if ( !behaviorPrototype )
return CKERR_OUTOFMEMORY;
//---- Local Parameters Declaration
behaviorPrototype->DeclareLocalParameter("BG Script", CKPGUID_BEHAVIOR );
//---- Settings Declaration
behaviorPrototype->DeclareSetting("BG filename", CKPGUID_STRING ,"path undefined.(BGWrapper Settings)");
behaviorPrototype->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
behaviorPrototype->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)(CKBEHAVIOR_INTERNALLYCREATEDINPUTS |
CKBEHAVIOR_INTERNALLYCREATEDINPUTPARAMS |
CKBEHAVIOR_INTERNALLYCREATEDOUTPUTS |
CKBEHAVIOR_INTERNALLYCREATEDOUTPUTPARAMS));
behaviorPrototype->SetBehaviorCallbackFct(BGWrapperCB,
CKCB_BEHAVIORLOAD |
CKCB_BEHAVIORRESET |
CKCB_BEHAVIORSETTINGSEDITED |
CKCB_BEHAVIORDETACH |
CKCB_BEHAVIORDEACTIVATESCRIPT
, NULL);
behaviorPrototype->SetFunction( GBLCOBGWrapper::BehaviourFunction );
*behaviorPrototypePtr = behaviorPrototype;
return CK_OK;
}
示例6: CreateBehaviourPrototype
/*
*******************************************************************
* Function: CreateBehaviourPrototype()
*
* Description : Declares the BB's inputs and outputs
*
* Parameters :
* ppProto, w: Passed in from Virtools
*
* Returns : CKERROR - Standard virtools return type
*
*******************************************************************
*/
CKERROR CGBLListBox::CreateBehaviourPrototype(CKBehaviorPrototype** ppProto)
{
CKERROR err = CK_OK;
// Call base class to create instance of CKBehaviorPrototype and
// also declare the widget base inputs, outputs and flags
CKBehaviorPrototype *pProto = CGBLWidget::CreateBaseBehaviourPrototype("GBLListBox");
if (!pProto)
{
err = CKERR_OUTOFMEMORY;
}
else {
// Beh inputs:
if (eBehInputFocus != pProto->DeclareInput("Focus"))
assert(NULL);
if (eBehInputSelect != pProto->DeclareInput("Select"))
assert(NULL);
// Beh outputs:
if (eBehOutputNewSelection != pProto->DeclareOutput("New Selection"))
assert(NULL);
// Parameter inputs:
if (eParamInputMaterial != pProto->DeclareInParameter("Material", CKPGUID_MATERIAL))
assert(NULL);
if (eParamInputStringListArray != pProto->DeclareInParameter("String List Array", CKPGUID_DATAARRAY))
assert(NULL);
if (eParamInputColumnsArray != pProto->DeclareInParameter("Columns Array", CKPGUID_DATAARRAY))
assert(NULL);
if (eParamInputFocusItem != pProto->DeclareInParameter("Focus Item", CKPGUID_INT))
assert(NULL);
if (eParamInputSelectedItem != pProto->DeclareInParameter("Selected Item", CKPGUID_INT))
assert(NULL);
// Param outputs:
if (eParamOutputSelectedItem != pProto->DeclareOutParameter("Selected Item", CKPGUID_INT))
assert(NULL);
// Local params:
if (eLocalParamFocussedItem != pProto->DeclareLocalParameter("Focussed Item", CKPGUID_INT, "0"))
assert(NULL);
if (eLocalParamSelectionType != pProto->DeclareSetting("Selection Type", CKGUID_GBLLISTBOXSELECTIONTYPE, "1"))
assert(NULL);
if (eLocalParamIsScrollDownButtonPressed != pProto->DeclareLocalParameter("Scroll Down Button Pressed", CKPGUID_BOOL, "0"))
assert(NULL);
if (eLocalParamIsScrollUpButtonPressed != pProto->DeclareLocalParameter("Scroll Up Button Pressed", CKPGUID_BOOL, "0"))
assert(NULL);
if (eLocalParamScrollOffset != pProto->DeclareLocalParameter("Scroll Offset", CKPGUID_INT, "0"))
assert(NULL);
if (eLocalParamScrollMouseDirection != pProto->DeclareLocalParameter("Scroll Mouse Direction", CKPGUID_INT, "0"))
assert(NULL);
if (eLocalParamScrollKeyboardDirection != pProto->DeclareLocalParameter("Scroll Keyboard Direction", CKPGUID_INT, "0"))
assert(NULL);
if (eLocalParamScrollTimeDelta != pProto->DeclareLocalParameter("Scroll Time Delta", CKPGUID_INT, "0"))
assert(NULL);
CKCHAR defaultDelay[256];
::sprintf(defaultDelay, "%d", CGBLWidgetsTheme::GetInitialScrollDelay());
if (eLocalParamScrollDelay != pProto->DeclareLocalParameter("Scroll Delay", CKPGUID_INT, defaultDelay))
assert(NULL);
// Set the behaviour function
pProto->SetFunction(BehaviourFunction);
// Everything must have gone OK, pass back Proto pointer to Virtools
*ppProto = pProto;
}
return err;
}
示例7: CreatePWOverlapSphereProto
CKERROR CreatePWOverlapSphereProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PWOverlapSphere");
if(!proto) return CKERR_OUTOFMEMORY;
/*! \page PWOverlapSphere
PWOverlapSphere is categorized in \ref Collision
<h3>Description</h3>
Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
Performs an overlap test against masked shape groups.Outputs an object only.<br>
See <A HREF="PWOverlaps.cmo">PWOverlaps.cmo</A> for example.
<h3>Technical Information</h3>
\image html PWOverlapSphere.png
<SPAN CLASS="in">In: </SPAN>triggers the process
<BR>
<SPAN CLASS="in">Next: </SPAN>Next Hit.
<BR>
<SPAN CLASS="in">Next: </SPAN>Iterate through next hit.
<BR>
<SPAN CLASS="out">Yes: </SPAN>Hit occured.
<BR>
<SPAN CLASS="out">No: </SPAN>No hits.
<BR>
<SPAN CLASS="out">Finish: </SPAN>Last hit.
<BR>
<SPAN CLASS="out">Next: </SPAN>Loop out.
<BR>
<SPAN CLASS="pin">Target: </SPAN>World Reference. pDefaultWorld!
<BR>
<SPAN CLASS="pin">Radius: </SPAN>The sphere radius.
<BR>
<SPAN CLASS="pin">Center: </SPAN>The spheres center in world space.If shape reference is given, then its transforming this value in its local space.
<BR>
<SPAN CLASS="pin">Shapes Types: </SPAN>Adds static and/or dynamic shapes to the test.
<BR>
<SPAN CLASS="pin">Accurate: </SPAN>True to test the sphere against the actual shapes, false to test against the AABBs only.
<BR>
<SPAN CLASS="pin">Groups: </SPAN>Includes specific groups to the test.
<BR>
<SPAN CLASS="pin">Groups Mask: </SPAN>Alternative mask used to filter shapes. See #pRigidBody::setGroupsMask
<BR>
<br>
<h3>Note</h3><br>
<br>
<br>
Is utilizing #pWorld::overlapSphereShapes()<br>
*/
proto->DeclareInput("In");
proto->DeclareInput("Next");
proto->DeclareOutput("Yes");
proto->DeclareOutput("No");
proto->DeclareOutput("Finish");
proto->DeclareOutput("Next");
proto->DeclareInParameter("Radius",CKPGUID_FLOAT);
proto->DeclareInParameter("Center",CKPGUID_VECTOR);
proto->DeclareInParameter("Shape Reference",CKPGUID_3DENTITY);
proto->DeclareInParameter("Shapes Type",VTF_SHAPES_TYPE);
proto->DeclareInParameter("Accurate",CKPGUID_BOOL);
proto->DeclareInParameter("Groups",CKPGUID_INT);
proto->DeclareInParameter("Filter Mask",VTS_FILTER_GROUPS);
proto->DeclareLocalParameter("result", CKPGUID_GROUP);
proto->DeclareLocalParameter("index", CKPGUID_INT);
proto->DeclareLocalParameter("size", CKPGUID_INT);
proto->DeclareSetting("Groups",CKPGUID_BOOL,"false");
proto->DeclareSetting("Groups Mask",CKPGUID_BOOL,"false");
proto->DeclareOutParameter("Touched Body",CKPGUID_3DENTITY);
//proto->DeclareSetting("Trigger on Enter",CKPGUID_BOOL,"FALSE");
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
//.........这里部分代码省略.........
示例8: CreatePCGroupTriggerEventProto
//************************************
// Method: CreatePCGroupTriggerEventProto
// FullName: CreatePCGroupTriggerEventProto
// Access: public
// Returns: CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePCGroupTriggerEventProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PCGroupTriggerEvent");
if(!proto) return CKERR_OUTOFMEMORY;
/*! \page PCGroupTriggerEvent
PCGroupTriggerEvent is categorized in \ref Collision
<h3>Description</h3>
Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
Triggers outputs if the body enters,stays or leaves another body .<br>
See <A HREF="pBTriggerEvent.cmo">pBTriggerEvent.cmo</A> for example.
<h3>Technical Information</h3>
\image html PCGroupTriggerEvent.png
<SPAN CLASS="in">In: </SPAN>triggers the process
<BR>
<SPAN CLASS="out">No Event: </SPAN>Nothing touched.
<BR>
<SPAN CLASS="out">Entering: </SPAN>Body entered.
<BR>
<SPAN CLASS="out">Leaving: </SPAN>Body leaved.
<BR>
<SPAN CLASS="out">Stay: </SPAN>Inside body .
<BR>
<SPAN CLASS="pin">Target Group: </SPAN>The group which the bb outputs triggers for.
<BR>
<SPAN CLASS="pout">Touched Object: </SPAN>The touched body.
<BR>
<h3>Warning</h3>
The body must be dynamic.
<br>
<br>
<h3>Note</h3><br>
<br>
<br>
Is utilizing #pRigidBody #pWorld #PhysicManager #pRigidBody::addForce().<br>
*/
//proto->DeclareInParameter("Extra Filter",VTF_TRIGGER,"0");
//proto->DeclareInParameter("Remove Event",CKPGUID_BOOL,"0");
proto->DeclareInput("In");
proto->DeclareInput("Next");
proto->DeclareOutput("No Event");
proto->DeclareOutput("Entering");
proto->DeclareOutput("Stay");
proto->DeclareOutput("Leaving");
proto->DeclareOutput("Has More");
proto->DeclareOutParameter("Trigger Object",CKPGUID_3DENTITY,0);
proto->DeclareOutParameter("Touched Object",CKPGUID_3DENTITY,0);
proto->DeclareOutParameter("Trigger Event",VTF_TRIGGER,0);
proto->DeclareLocalParameter("currentIndex", CKPGUID_INT);
//proto->DeclareSetting("Trigger on Enter",CKPGUID_BOOL,"FALSE");
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
proto->SetFunction(PCGroupTriggerEvent);
*pproto = proto;
return CK_OK;
}
示例9: CreateBehaviourPrototype
//.........这里部分代码省略.........
*/
proto->DeclareOutput("Error");
//--- Input Parameters declaration
/**
* Unique identifier of WaitForCommand building block.
*/
proto->DeclareInParameter("CommandID", CKPGUID_INT);
/**
* Parameter (argument) value returned as a string. For example from the parameter
* input dialog.
*/
proto->DeclareInParameter("ParameterString", CKPGUID_STRING);
/**
* Set an array of target users IDs for SendNetworkMessage building block.
*/
proto->DeclareInParameter("Dests", CKPGUID_DATAARRAY);
//--- Output Parameters declaration
/**
* Additional parameter input is required for chosen command with a specified type
* given as a string.
*/
proto->DeclareOutParameter("ArgumentType", CKPGUID_STRING);
/**
* Additional parameter input is required for chosen command with a specified name
* given as a string.
*/
proto->DeclareOutParameter("ArgumentName", CKPGUID_STRING);
/**
* Get an array of target users IDs for SendNetworkMessage building block.
*/
proto->DeclareOutParameter("Dests", CKPGUID_DATAARRAY);
/**
* Returns a string containing encoded command
*/
proto->DeclareOutParameter("CommandString", CKPGUID_STRING);
/**
* Type of recipient specified by the command (a team, a player or global)
*/
proto->DeclareOutParameter("Target", GUID_EGBLTARGET);
/**
* Output parameter that returns the designer specified list of acceptable
* values for the argument that GBLBuildCommand BB requested for (by activating
* GetNextArgument b-out).
*/
proto->DeclareOutParameter("DesignerSpecifiedList", CKPGUID_DATAARRAY);
/**
* Parameter output that returns the description for an error that occurred.
*/
proto->DeclareOutParameter("Error", GUID_TGBLERROR);
/**
* Current state of this BB
*/
gblBuildCommandStateLocalPos = proto->DeclareLocalParameter("gblBuildCommandState", CKPGUID_INT, "0");
/**
* Position of iterator for target's outputs
*/
currentParameterPositionLocalPos = proto->DeclareLocalParameter("currentParameterPosition", CKPGUID_INT, "0");
/**
* Target BB
*/
targetBBLocalPos = proto->DeclareLocalParameter("targetBB", CKPGUID_BEHAVIOR, "0");
/**
* Command string
*/
commandStringLocalPos = proto->DeclareLocalParameter("commandString", CKPGUID_STRING);
//---- Local Parameters Declaration
//---- Settings Declaration
proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)(CKBEHAVIOR_MESSAGESENDER));
proto->SetBehaviorCallbackFct(CallbackFunction, NULL, NULL);
proto->SetFunction(BehaviourFunction);
*pproto = proto;
return CK_OK;
}