本文整理汇总了C++中CKBehaviorPrototype::DeclareSetting方法的典型用法代码示例。如果您正苦于以下问题:C++ CKBehaviorPrototype::DeclareSetting方法的具体用法?C++ CKBehaviorPrototype::DeclareSetting怎么用?C++ CKBehaviorPrototype::DeclareSetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKBehaviorPrototype
的用法示例。
在下文中一共展示了CKBehaviorPrototype::DeclareSetting方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateGetCIValueProto
/*
*******************************************************************
* Function: CKERROR CreateGetCIValueProto( 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 CreateGetCIValueProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype(GBL_CI_API_ENTRY("GetCI"));
if(!proto) return CKERR_OUTOFMEMORY;
proto->DeclareInput("Start");
proto->DeclareOutput("Success");
proto->DeclareInParameter("Configurable Information", CIPARAMETERGUID);
proto->DeclareOutParameter("Configurable Information Value", CKPGUID_STRING);
proto->DeclareSetting("Get CI by unique name",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Get value as string",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Output custom values",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Output on change",CKPGUID_BOOL,"FALSE");
proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)( CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS ));
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorCallbackFct(GetCIValueCB);
proto->SetFunction(GetCIValue);
*pproto = proto;
return CK_OK;
}
示例2: CreateRetrieveCIProto
CKERROR CreateRetrieveCIProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype(GBL_CI_API_ENTRY("RetrieveCI"));
if(!proto) return CKERR_OUTOFMEMORY;
proto->DeclareInput("Start");
proto->DeclareOutput("Success");
proto->DeclareOutput("Error");
proto->DeclareInParameter("Configurable Information ID", CKPGUID_INT);
proto->DeclareOutParameter("Configurable Information Value", CKPGUID_STRING);
proto->DeclareOutParameter("GetErrorCode", GUID_TGBLERROR);
proto->DeclareSetting("Get value as string",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Output custom values",CKPGUID_BOOL,"FALSE");
proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)( CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS ));
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorCallbackFct(RetrieveCICB);
proto->SetFunction(RetrieveCI);
*pproto = proto;
return CK_OK;
}
示例3: 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;
}
示例4: CreateKeyboardCameraOrbitProto
CKERROR CreateKeyboardCameraOrbitProto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Keyboard Camera Orbit");
if(!proto) return CKERR_OUTOFMEMORY;
// General Description
CKERROR error = FillGeneralCameraOrbitProto(proto);
if (error != CK_OK)
return (error);
// Additionnal Settings for the Keyboard
proto->DeclareSetting("Key Rotate Left", CKPGUID_KEY,"Left Arrow");
proto->DeclareSetting("Key Rotate Right", CKPGUID_KEY,"Right Arrow");
proto->DeclareSetting("Key Rotate Up", CKPGUID_KEY,"Up Arrow");
proto->DeclareSetting("Key Rotate Down", CKPGUID_KEY,"Down Arrow");
proto->DeclareSetting("Key Zoom In", CKPGUID_KEY,"PREVIOUS");
proto->DeclareSetting("Key Zoom Out", CKPGUID_KEY,"NEXT");
// Set the execution functions
proto->SetFunction(KeyboardCameraOrbit);
proto->SetBehaviorCallbackFct(GeneralCameraOrbitCallback,CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORCREATE);
// return OK
*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: CreatePBPhysicalizeProto
//.........这里部分代码省略.........
<BR>
<SPAN CLASS="out">Out: </SPAN>is activated when the process is completed.
<BR>
<BR>
<SPAN CLASS="pin">Target: </SPAN>The 3D Entity associated to the rigid body.
<BR>
<SPAN CLASS="pin">Flags: </SPAN>Flags to determine common properties for the desired body. See #BodyFlags.
<BR>
<SPAN CLASS="pin">Hulltype: </SPAN>The desired shape type. See #HullType.
<br>
<SPAN CLASS="framedOrange">You can add or remove sub shapes on the fly by pRigidBody::addSubShape() or #PBAddShape.<br>
The intial shape can NOT changed after the bodies registration.</SPAN>
<BR>
<SPAN CLASS="pin">Density: </SPAN>Density of the initial shape. This will be only used if <br>
"Hierarchy" =false and <br>
"New Density" !=0.0f or "Total Mass" != 0.0f. #pRigidBody::updateMassFromShapes() can update the mass dynamically.
<br>
<br>
<SPAN CLASS="pin">Skin Width: </SPAN>Specifies by how much shapes can interpenetrate. See #pRigidBody::setSkinWidth().
<br>
<br>
<SPAN CLASS="pin">Mass Offset: </SPAN>Moves the mass center in the local bodies space.
<br>
<br>
<SPAN CLASS="pin">Pivot Offset: </SPAN>Position of the initial shape in the bodies space.
<br>
<br>
<SPAN CLASS="pin">Target World: </SPAN>Multiple worlds are provided. If not specified, it belongs to an automatically created default world(pDefaultWorld).This parameter must be enabled through the settings of this building block.
<br>
<br>
<SPAN CLASS="pin">Hierarchy: </SPAN>If enabled, this function will parse the entities hierarchy and attaches children as additional collisions shapes. Those children must have the physic attribute attached whereby the sub shape flag must be
enabled(#BodyFlags). Sub shapes can be attached by #addSubShape() or #PBAddShape afterwards.
<br>
<br>
<SPAN CLASS="pin">New Density: </SPAN>Density scale factor of the shapes belonging to the body.If you supply a non-zero total mass,
the bodies mass and inertia will first be computed as above and then scaled to fit this total mass. See #pRigidBody::updateMassFromShapes().
<br>
<br>
<SPAN CLASS="pin">Total Mass: </SPAN>Total mass if it has sub shapes.If you supply a non-zero density,
the bodies mass and inertia will first be computed as above and then scaled by this factor.See #pRigidBody::updateMassFromShapes().
<br>
<br>
<SPAN CLASS="pin">Material: </SPAN>The material of this body. This parameter must be enabled through the settings of this building block.By default it is using the worlds material. The material of a body can be specified explicity by attaching
a physic material attribute on the entity or its mesh or the meshs material. This is the lookup order : <br>
- building block input parameter <br>
- entity mesh <br>
- entities mesh material
<br>
<br>
<br>
<SPAN CLASS="setting">Use Default World: </SPAN>Enables input for the world reference.
<BR>
<SPAN CLASS="setting">Use Worlds Material: </SPAN>Enables input for a physic material.
<BR>
<SPAN CLASS="setting">Add Attributes: </SPAN>Attaches the physic attribute to the entity.
<BR>
<BR>
<h3>Warning</h3>
<h3>Note</h3><br>
<br>
<br>
Is utilizing #pRigidBody #pWorld #PhysicManager #pFactory::createBody().<br>
<h3>VSL</h3><br>
<SPAN CLASS="NiceCode">
\include PBPhysicalize.cpp
</SPAN>
*/
proto->DeclareInParameter("Flags",VTF_BODY_FLAGS,"Moving Object,Updates in Virtools,Auto Disable,World Gravity,Enabled,Collision");
proto->DeclareInParameter("Hull type",VTE_COLLIDER_TYPE,"Sphere");
proto->DeclareInParameter("Density",CKPGUID_FLOAT,"1.0f");
proto->DeclareInParameter("Skin Width",CKPGUID_FLOAT,"-1.0f");
proto->DeclareInParameter("Mass Offset",CKPGUID_VECTOR,"0.0f,0.0f,0.0f");
proto->DeclareInParameter("Pivot Offset",CKPGUID_VECTOR,"0.0f,0.0f,0.0f");
proto->DeclareInParameter("Target World Reference",CKPGUID_3DENTITY,"pDefaultWorld");
proto->DeclareInParameter("Hierarchy",CKPGUID_BOOL,"FALSE");
proto->DeclareInParameter("New Density",CKPGUID_FLOAT,"0.0f");
proto->DeclareInParameter("Total Mass",CKPGUID_FLOAT,"0.0f");
proto->DeclareInParameter("Material",VTS_MATERIAL);
proto->DeclareSetting("Use Default World",CKPGUID_BOOL,"TRUE");
proto->DeclareSetting("Use Worlds Material",CKPGUID_BOOL,"TRUE");
proto->DeclareSetting("Add Attributes",CKPGUID_BOOL,"TRUE");
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
proto->SetBehaviorCallbackFct( PBPhysicalizeCB );
proto->SetFunction(PBPhysicalize);
*pproto = proto;
return CK_OK;
}
示例8: CreatePJRevoluteProto
//.........这里部分代码省略.........
<hr>
<SPAN CLASS="pin">Motor: </SPAN>Motor parameters. See pJointRevolute::setMotor().
<BR>
<BR>
<hr>
<SPAN CLASS="setting">Spring: </SPAN>Enables parameter input for spring settings.
<BR>
<SPAN CLASS="setting">High Limit: </SPAN>Enables parameter inputs for angular limits.
<BR>
<SPAN CLASS="setting">Motor: </SPAN>Enables parameter input for motor settings.
<BR>
<h4>Revolute Joint Limits</h4>
A revolute joint allows limits to be placed on how far it rotates around the joint axis. For example, a hinge on a door cannot rotate through 360 degrees; rather, it can rotate between 20 degrees and 180 degrees.
The angle of rotation is measured using the joints normal (axis orthogonal to the joints axis). This is the angle reported by NxRevoluteJoint::getAngle(). The limits are specified as a high and low limit, which must satisfy the condition -Pi < low < high <Pi degrees.
Below are valid revolute joint limits in which the joint is able to move between low and high:
\image html revoluteJointLimits.png
<br>
Note : The white region represents the allowable rotation for the joint.
<h4>Limitations of Revolute Joint Limits</h4>
As shown below, it is not possible to specify certain limit configurations without rotating the joint axes, due to the restrictions on the values of low and high:
\image html revoluteLimitLimitation.png
To achieve this configuration, it is necessary to rotate the joint counter-clockwise so that low is below the 180 degree line.
NOTE: If the angular region that is prohibited by the twist limit (as in the above figures) is very small, only a few degrees or so, then the joint may "push through" the limit and out on the other side if the relative angular velocity is large enough in relation to the time step. Care must be taken to make sure the limit is "thick" enough for the typical angular velocities it will be subjected to.
<BR>
<h3>Warning</h3>
The body must be dynamic.
<br>
<br>
<h3>VSL : Creation </h3><br>
<SPAN CLASS="NiceCode">
\include PJRevolute.vsl
</SPAN>
<br>
<h3>VSL : Limit Modification </h3><br>
<SPAN CLASS="NiceCode">
\include PJRevoluteSetLimits.vsl
</SPAN>
<br>
<h3>VSL : Motor Modification </h3><br>
<SPAN CLASS="NiceCode">
\include PJRevoluteSetMotor.vsl
</SPAN>
<br>
<br>
<br>
Is utilizing #pRigidBody #pWorld #PhysicManager #pFactory::createJointRevolute().<br>
*/
proto->DeclareInput("In");
proto->DeclareOutput("Out");
proto->SetBehaviorCallbackFct( PJRevoluteCB );
proto->DeclareInParameter("Body B",CKPGUID_3DENTITY,"ball2");
proto->DeclareInParameter("Anchor",CKPGUID_VECTOR,"0.0f");
proto->DeclareInParameter("Anchor Reference",CKPGUID_3DENTITY,"0.0f");
proto->DeclareInParameter("Axis",CKPGUID_VECTOR,"0.0f");
proto->DeclareInParameter("Axis Up Reference",CKPGUID_3DENTITY);
proto->DeclareInParameter("Collision",CKPGUID_BOOL);
proto->DeclareInParameter("Projection Mode",VTE_JOINT_PROJECTION_MODE,"0");
proto->DeclareInParameter("Projection Distance",CKPGUID_FLOAT,"0");
proto->DeclareInParameter("Projection Angle",CKPGUID_FLOAT,"0.025");
proto->DeclareInParameter("Spring",VTS_JOINT_SPRING);
proto->DeclareInParameter("High Limit",VTS_JLIMIT);
proto->DeclareInParameter("Low Limit",VTS_JLIMIT);
proto->DeclareInParameter("Motor",VTS_JOINT_MOTOR);
proto->DeclareSetting("Spring",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Limit",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Motor",CKPGUID_BOOL,"FALSE");
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
proto->SetFunction(PJRevolute);
*pproto = proto;
return CK_OK;
}
示例9: 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);
//.........这里部分代码省略.........
示例10: CreatePBGet2Proto
//************************************
// Method: CreatePBGet2Proto
// FullName: CreatePBGet2Proto
// Access: public
// Returns: CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePBGet2Proto(CKBehaviorPrototype **pproto)
{
CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PBGetEx-Obsolete");
if(!proto) return CKERR_OUTOFMEMORY;
proto->DeclareInput("In");
proto->DeclareOutput("Out");
/*
PBGetEx
PBGet2 is categorized in \ref Body
<h3>Description</h3>
Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
Retrieves various physical informations.<br>
<h3>Technical Information</h3>
\image html PBGet2.png
<SPAN CLASS="in">In: </SPAN>triggers the process
<BR>
<SPAN CLASS="out">Out: </SPAN>is activated when the process is completed.
<BR>
<BR>
<SPAN CLASS="pin">Target: </SPAN>The 3D Entity associated to the rigid body.
<BR>
<BR>
<SPAN CLASS="pout">Collisions Group: </SPAN>Which collision group this body is part of.See pRigidBody::getCollisionsGroup().
<BR>
<SPAN CLASS="pout">Kinematic Object: </SPAN>The kinematic state. See pRigidBody::isKinematic().
<BR>
<SPAN CLASS="pout">Gravity: </SPAN>The gravity state.See pRigidBody::isAffectedByGravity().
<BR>
<SPAN CLASS="pout">Collision: </SPAN>Determines whether the body reacts to collisions.See pRigidBody::isCollisionEnabled().
<BR>
<BR>
<SPAN CLASS="setting">Collisions Group: </SPAN>Enables output for collisions group.
<BR>
<SPAN CLASS="setting">Kinematic Object: </SPAN>Enables output for kinematic object.
<BR>
<SPAN CLASS="setting">Gravity: </SPAN>Enables output for gravity.
<BR>
<SPAN CLASS="setting">Collision: </SPAN>Enables output for collision.
<BR>
<BR>
<BR>
<BR>
<h3>Warning</h3>
The body must be dynamic.
<br>
<br>
<h3>Note</h3>
Is utilizing #pRigidBody #pWorld #PhysicManager.<br>
<h3>VSL</h3><br>
<SPAN CLASS="NiceCode">
\include PBGetEx.cpp
</SPAN>
*/
proto->DeclareSetting("Collisions Group",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Kinematic",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Gravity",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Collision",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Mass Offset",CKPGUID_BOOL,"FALSE");
proto->DeclareSetting("Pivot Offset",CKPGUID_BOOL,"FALSE");
proto->SetBehaviorCallbackFct( PBGet2CB );
proto->DeclareOutParameter("Collisions Group",CKPGUID_INT,"0");
proto->DeclareOutParameter("Kinematic Object",CKPGUID_BOOL,"FALSE");
proto->DeclareOutParameter("Gravity",CKPGUID_BOOL,"FALSE");
proto->DeclareOutParameter("Collision",CKPGUID_BOOL,"FALSE");
proto->DeclareOutParameter("Mass Offset",CKPGUID_VECTOR,"0.0f");
proto->DeclareOutParameter("Pivot Offset",CKPGUID_VECTOR,"0.0f");
proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
proto->SetFunction(PBGet2);
*pproto = proto;
return CK_OK;
}