/*
 *******************************************************************
 * 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.
 *
 * Paramters :
 *    behaviorPrototypePtr    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR CGBLCHChatMoveHomogeneous::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLCHChatMoveHomogeneous" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
//---     Inputs declaration
	behaviorPrototype->DeclareInput( "On" );


//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "Done" );
	behaviorPrototype->DeclareOutput( "Error" );

//---     Input Parameters declaration
	behaviorPrototype->DeclareInParameter( "Frame", CKPGUID_2DENTITY );

	behaviorPrototype->DeclareInParameter( "Height", CKPGUID_FLOAT );  //1
	behaviorPrototype->DeclareInParameter( "Width", CKPGUID_FLOAT );  //2
	behaviorPrototype->DeclareInParameter( "X", CKPGUID_FLOAT );  //3
	behaviorPrototype->DeclareInParameter( "Y", CKPGUID_FLOAT );  //4


    //----	Local Parameters Declaration
    
    //----	Settings Declaration

	behaviorPrototype->SetBehaviorCallbackFct( CGBLCHChatMoveHomogeneous::CallBack, CKCB_BEHAVIORATTACH|CKCB_BEHAVIORDETACH|CKCB_BEHAVIORDELETE|CKCB_BEHAVIOREDITED|CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORPRESAVE|CKCB_BEHAVIORPOSTSAVE|CKCB_BEHAVIORRESUME|CKCB_BEHAVIORPAUSE|CKCB_BEHAVIORRESET|CKCB_BEHAVIORRESET|CKCB_BEHAVIORDEACTIVATESCRIPT|CKCB_BEHAVIORACTIVATESCRIPT|CKCB_BEHAVIORREADSTATE, NULL );
    behaviorPrototype->SetFunction( CGBLCHChatMoveHomogeneous::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
/*
 *******************************************************************
 * 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    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR GBLStorageManagerStateTestBB::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLStorageManagerStateTestBB" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
//---     Inputs declaration
	behaviorPrototype->DeclareInput( "In0" );

//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "Out0" );



    //----	Local Parameters Declaration
    
    //----	Settings Declaration

	behaviorPrototype->SetBehaviorCallbackFct( GBLStorageManagerStateTestBB::CallBack, CKCB_BEHAVIORATTACH|CKCB_BEHAVIORDETACH|CKCB_BEHAVIORDELETE|CKCB_BEHAVIOREDITED|CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORPRESAVE|CKCB_BEHAVIORPOSTSAVE|CKCB_BEHAVIORRESUME|CKCB_BEHAVIORPAUSE|CKCB_BEHAVIORRESET|CKCB_BEHAVIORRESET|CKCB_BEHAVIORDEACTIVATESCRIPT|CKCB_BEHAVIORACTIVATESCRIPT|CKCB_BEHAVIORREADSTATE, NULL );
    behaviorPrototype->SetFunction( GBLStorageManagerStateTestBB::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
Example #3
0
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;
}
/*
 *******************************************************************
 * Function: int CreateBehaviourPrototype() 
 *
 * Description : Returns the number of plugins in this DLL
 *		
 * Paramters :
 *    CKBehaviorPrototype w ppProto
 *
 * Returns : CKERROR - Standard virtools return type
 *
 *******************************************************************
 */
CKERROR CGBLLOGetMOStatus::CreateBehaviourPrototype(CKBehaviorPrototype** ppProto)
{
	CKERROR err = CK_OK;

	// Create the CKBehaviorPrototype object
	CKBehaviorPrototype *pProto = CreateCKBehaviorPrototype("GBLLOStartMO");
	if (!pProto)
		return NULL;

	// Set the B-Ins, B-Outs, P-Ins and P-Outs
	if (eParamInputMO != pProto->DeclareInParameter("Set Measured Objective", CKGUID_CGBLMO_PARAMETER))
		assert(NULL);
	if (eParamOutputGetError != pProto->DeclareOutParameter("Get Error", GUID_TGBLERROR))
		assert(NULL);
	if (eParamOutputGetStatus != pProto->DeclareOutParameter("Get Status", CKPGUID_BOOL))
		assert(NULL);
	if (eBehInputStart != pProto->DeclareInput("InS tart"))
		assert(NULL);
	if (eBehOutputDone != pProto->DeclareOutput("Out Done"))
		assert(NULL);
	if (eBehOutputError != pProto->DeclareOutput("Out Error"))
		assert(NULL);
	
	// flags
	pProto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);

	// Set the behaviour function
	pProto->SetFunction(BehaviourFunction);

	// Everything must have gone OK, pass back Proto pointer to Virtools
	*ppProto = pProto;
	return err;
}
//************************************
// Method:    CreatePClothAttachVertexToPositionProto
// FullName:  CreatePClothAttachVertexToPositionProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePClothAttachVertexToPositionProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PClothAttachVertexToPosition");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In");
	proto->DeclareOutput("Out");

	/*! \page PClothAttachVertexToPosition  

	PClothAttachVertexToPosition is categorized in \ref Clothes

	<h3>Description</h3>
	Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
	Attaches a cloth vertex to a position in world space.<br>

	@see pCloth::attachVertexToGlobalPosition()


	<h3>Technical Information</h3>

	\image html PClothAttachVertexToPosition.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>Target cloth reference.
	<BR>
	<BR>

	<BR>
	<BR>
	<SPAN CLASS="pin">Vertex Index: </SPAN>Index of the vertex to attach.
	<BR>
	<BR>

	<SPAN CLASS="pin">Global Position: </SPAN>TThe position in world space.
	<BR>
	<BR>

	*/

	proto->SetBehaviorCallbackFct( PClothAttachVertexToPositionCB );

	proto->DeclareInParameter("Vertex Index",CKPGUID_INT);
	proto->DeclareInParameter("Global Position",CKPGUID_VECTOR);


	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(PClothAttachVertexToPosition);
	*pproto = proto;
	return CK_OK;
}
/*
 *******************************************************************
 * 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    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR CGBLLAERemoveUser::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLLAERemoveUserBB" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
//---     Inputs declaration
	behaviorPrototype->DeclareInput( "RemoveUser" );

//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "UserRemoved" );
	behaviorPrototype->DeclareOutput( "Error" );

//---     Input Parameters declaration
	behaviorPrototype->DeclareInParameter( "LAEID", GUID_GBLLAEID );
	behaviorPrototype->DeclareInParameter( "LAEUserIDList", CKPGUID_DATAARRAY );

//---     Output Parameters declaration
	behaviorPrototype->DeclareOutParameter( "Error", GUID_TGBLERROR );

    //----	Local Parameters Declaration
    
    //----	Settings Declaration

	behaviorPrototype->SetBehaviorCallbackFct( CGBLLAERemoveUser::CallBack, CKCB_BEHAVIORATTACH|CKCB_BEHAVIORDETACH|CKCB_BEHAVIORDELETE|CKCB_BEHAVIOREDITED|CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORPRESAVE|CKCB_BEHAVIORPOSTSAVE|CKCB_BEHAVIORRESUME|CKCB_BEHAVIORPAUSE|CKCB_BEHAVIORRESET|CKCB_BEHAVIORRESET|CKCB_BEHAVIORDEACTIVATESCRIPT|CKCB_BEHAVIORACTIVATESCRIPT|CKCB_BEHAVIORREADSTATE, NULL );
    behaviorPrototype->SetFunction( CGBLLAERemoveUser::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
/*
 *******************************************************************
 * 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    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR GBLPFRemovePlayer::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLPFRemovePlayer" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
//---     Inputs declaration
	behaviorPrototype->DeclareInput( "In" );

//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "OutSuccess" );
	behaviorPrototype->DeclareOutput( "OutError" );

//---     Input Parameters declaration
	behaviorPrototype->DeclareInParameter( "SetPlayer", GUID_USER_ID );
	behaviorPrototype->DeclareInParameter( "SetTeam", GUID_TEAM_ID );

//---     Output Parameters declaration
	behaviorPrototype->DeclareOutParameter( "GetErrorCode", GUID_TGBLERROR );

    //----	Local Parameters Declaration
    
    //----	Settings Declaration

	behaviorPrototype->SetBehaviorCallbackFct( GBLPFRemovePlayer::CallBack, CKCB_BEHAVIORATTACH|CKCB_BEHAVIORDETACH|CKCB_BEHAVIORDELETE|CKCB_BEHAVIOREDITED|CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORPRESAVE|CKCB_BEHAVIORPOSTSAVE|CKCB_BEHAVIORRESUME|CKCB_BEHAVIORPAUSE|CKCB_BEHAVIORRESET|CKCB_BEHAVIORRESET|CKCB_BEHAVIORDEACTIVATESCRIPT|CKCB_BEHAVIORACTIVATESCRIPT|CKCB_BEHAVIORREADSTATE, NULL );
    behaviorPrototype->SetFunction( GBLPFRemovePlayer::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
/*
 *******************************************************************
 * 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    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR GBLPFGetUserIdentity::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLPFGetUserIdentity" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
//---     Inputs declaration
	behaviorPrototype->DeclareInput( "In" );

//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "Out" );


//---     Output Parameters declaration
	behaviorPrototype->DeclareOutParameter( "GetUserId", GUID_USER_ID );
	behaviorPrototype->DeclareOutParameter( "GetUsername", CKPGUID_STRING );
	behaviorPrototype->DeclareOutParameter( "GetVirtoolsUserId", CKPGUID_INT );

    //----	Local Parameters Declaration
    
    //----	Settings Declaration

	behaviorPrototype->SetBehaviorCallbackFct( GBLPFGetUserIdentity::CallBack, CKCB_BEHAVIORATTACH|CKCB_BEHAVIORDETACH|CKCB_BEHAVIORDELETE|CKCB_BEHAVIOREDITED|CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORPRESAVE|CKCB_BEHAVIORPOSTSAVE|CKCB_BEHAVIORRESUME|CKCB_BEHAVIORPAUSE|CKCB_BEHAVIORRESET|CKCB_BEHAVIORRESET|CKCB_BEHAVIORDEACTIVATESCRIPT|CKCB_BEHAVIORACTIVATESCRIPT|CKCB_BEHAVIORREADSTATE, NULL );
    behaviorPrototype->SetFunction( GBLPFGetUserIdentity::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
Example #9
0
//************************************
// Method:    CreateJDestroyProto
// FullName:  CreateJDestroyProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreateJDestroyProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PJDestroy");
	if(!proto) return CKERR_OUTOFMEMORY;

	/*! \page PJDestroy  

	<br>
	PJDestroy is categorized in \ref Joints
	<br>
	<br>See <A HREF="PJDestroy.cmo">PJDestroy.cmo</A>.

	<h3>Description</h3>
	Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
	Deletes a joint, given by references and type.

	<br>

	<h3>Technical Information</h3>

	\image html PJDestroy.png


	<SPAN CLASS="in">In: </SPAN> triggers the process
	<BR>
	<SPAN CLASS="out">Out: </SPAN> is activated when the process is completed.
	<BR>

	<SPAN CLASS="pin">Body B: </SPAN> The second body. Leave blank to create a joint constraint with the world. 
	<BR>

	<SPAN CLASS="pin">Joint Type:</SPAN> The joint type. This helps the building block to identify a joint constraint. As usual there can be only one joint of the type x between two bodies.
	<BR>

	<b>Sleeping:</b> This call wakes the actor(s) if they are sleeping.

	Is utilizing #pRigidBody #pWorld #PhysicManager #pWorld::deleteJoint().<br>
	*/

	proto->DeclareInput("In");
	proto->DeclareOutput("Out");

	proto->SetBehaviorCallbackFct( JDestroyCB );
	
	proto->DeclareInParameter("Body B",CKPGUID_3DENTITY,"ball2");
	proto->DeclareInParameter("Type",VTE_JOINT_TYPE,"");

	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);

	proto->SetFunction(JDestroy);
	*pproto = proto;
	return CK_OK;
}
/*
 *******************************************************************
 * 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    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR CGBLDecodeAndDistribute::CreateProto(CKBehaviorPrototype** pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("GBLFCDecodeAndDistribute");
	if (!proto) 
    {
		return CKERR_OUTOFMEMORY;
	}

//---     Inputs declaration

    /**
	 * Start decoding the received string containing the target  GBLWaitForCommand
	 * block ID and command parameters and send it locally to the target
	 * GBLWaitForCommand BB.
	 */
	proto->DeclareInput("Decode");

//---     Outputs declaration

    /**
	 * The operation was successful, the command has been sent correctly.
	 */
	proto->DeclareOutput("OperationSuccessful");

    /**
	 * Activates when an error occurred during the execution of the BB (the type of
	 * error is given by the GetError parameter output).
	 */
	proto->DeclareOutput("Error");

//---     Input Parameters declaration

    /**
	 * Defines the string in which the command is encoded.
	 */
	proto->DeclareInParameter("CommandString", CKPGUID_STRING);

//---     Output Parameters declaration
    /**
	 * Parameter output that returns the description for an error that occurred.
	 */
	proto->DeclareOutParameter("Error", GUID_TGBLERROR);

//----	Local Parameters Declaration

//----	Settings Declaration
	proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)(CKBEHAVIOR_MESSAGESENDER));
	proto->SetBehaviorCallbackFct(CGBLDecodeAndDistribute::CallBack, NULL, NULL);
	proto->SetFunction(CGBLDecodeAndDistribute::BehaviourFunction);

	*pproto = proto;
	return CK_OK;
}
Example #11
0
CKERROR CreateNeoSetMousePosProto(CKBehaviorPrototype** pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Set Mouse Pos");
	if (!proto) {
		return CKERR_OUTOFMEMORY;
	}

//---     Inputs declaration
	proto->DeclareInput("Set");

//---     Outputs declaration
	proto->DeclareOutput("Done");

//---     Input Parameters declaration
	proto->DeclareInParameter("X", CKPGUID_INT,"100");
	proto->DeclareInParameter("Y", CKPGUID_INT,"100");
	proto->DeclareInParameter("Keep Active", CKPGUID_BOOL, "TRUE");
//	proto->DeclareSetting("Keep Active",CKPGUID_BOOL,"TRUE");
//	proto->DeclareLocalParameter("KeepActive", CKPGUID_BOOL);


//----	Local Parameters Declaration

//----	Settings Declaration

	proto->SetBehaviorCallbackFct(NeoSetMousePosCallBack, NULL);
	proto->SetFunction(NeoSetMousePos);

	*pproto = proto;
	return CK_OK;
}
Example #12
0
CKERROR GBLCOSetID::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{

#if GBL_RUNTIME
    // Not editable from Virtools Dev
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototypeRunTime( "GBLCOSetID" );
#elif GBL_GAMEDEVELOPER
    // Edition depend on the BB.
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLCOSetID" );
#else
    // Editable from Virtools Dev
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLCOSetID" );
#endif

    if ( !behaviorPrototype )
        return CKERR_OUTOFMEMORY;

    //---     Inputs declaration
    behaviorPrototype->DeclareInput( "InSetIdentity" );

    //---     Outputs declaration
    behaviorPrototype->DeclareOutput( "OutIdentitySet" );
    behaviorPrototype->DeclareOutput( "OutError" );

    //---     Parameter Input declaration
    behaviorPrototype->DeclareInParameter("SetLAID", GUID_TGBLLAID);

    //---     Parameter Output declaration
    behaviorPrototype->DeclareOutParameter("GetError", GUID_TGBLERROR);

    behaviorPrototype->SetFunction(GBLCOSetID::BehaviourFunction);

    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
Example #13
0
//************************************
// Method:    CreatePClothDetachFromShapeProto
// FullName:  CreatePClothDetachFromShapeProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePClothDetachFromShapeProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PClothDetachFromShape");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In");
	proto->DeclareOutput("Out");

	/*! \page PClothDetachFromShape  

	PClothDetachFromShape is categorized in \ref Clothes

	<h3>Description</h3>
	Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
	Detaches the cloth from a shape it has been attached to before<br>

	@see pCloth::detachFromShape()

	<h3>Technical Information</h3>

	\image html PClothDetachFromShape.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>Target cloth reference.
	<BR>
	<BR>

	<SPAN CLASS="pin">Shape Reference: </SPAN>Shape to which the cloth should be attached to.

	
	<BR>
	<BR>

	<SPAN CLASS="pin">Attachment Flags: </SPAN>One or two way interaction, tearable or non-tearable
	*/

	proto->SetBehaviorCallbackFct( PClothDetachFromShapeCB );
	proto->DeclareInParameter("Shape Reference",CKPGUID_3DENTITY);


	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(PClothDetachFromShape);
	*pproto = proto;
	return CK_OK;
}
/*
 *******************************************************************
 * 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    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR GBLLDEnableForFac::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLLDEnableForFac" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
    //---     Inputs declaration

    //---     Outputs declaration


    //----	Local Parameters Declaration
    
    //----	Settings Declaration

    behaviorPrototype->SetFunction( GBLLDEnableForFac::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
Example #15
0
/*
*******************************************************************
* Function: 
*
* Description: 
*    
* Parameters: 
*
* Returns: 
*
*******************************************************************
*/
CKERROR CreateNSRemoveUserProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("NSRemoveUser");
	if(!proto) return CKERR_OUTOFMEMORY;



	proto->DeclareInput("In");
	
	proto->DeclareOutput("Removed");
	proto->DeclareOutput("Error");

	proto->DeclareInParameter("Connection ID", CKPGUID_INT, "0");
	proto->DeclareInParameter("User ID", CKPGUID_INT, "0");
	proto->DeclareOutParameter("Error", VTE_NETWORK_ERROR, "Ok");
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetFunction(NSRemoveUser);
	proto->SetBehaviorCallbackFct(NSRemoveUserCB);

	*pproto = proto;
	return CK_OK;

}
/*
 *******************************************************************
 * Function: CKERROR CreateGBLCIGetCIS_IDListProto( 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 CreateGBLCIGetCIS_IDListProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype(GBL_CI_API_ENTRY("GetCIS_IDList"));
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("Start");
	proto->DeclareOutput("Success");
	proto->DeclareOutput("Error");

	proto->DeclareInParameter("Learning Application ID", GUID_TGBLLAID,"0");
	proto->DeclareInParameter("Result Array", CKPGUID_DATAARRAY);
    
	proto->DeclareOutParameter("GetErrorCode", GUID_TGBLERROR);
    
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);

	proto->SetFunction(GBLCIGetCIS_IDList);
	*pproto = proto;
	return CK_OK;
}
Example #17
0
CKERROR CreateCallPythonProto2(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = NULL;
	proto = CreateCKBehaviorPrototype("CallPythonFuncEx");
	if(!proto) return CKERR_OUTOFMEMORY;
	
	proto->DeclareInput("In");
	proto->DeclareOutput("Out");
	proto->DeclareOutput("Error");

	proto->DeclareInParameter("File",CKPGUID_STRING);
	proto->DeclareInParameter("Func",CKPGUID_STRING);
	proto->DeclareInParameter("Reload",CKPGUID_BOOL);


	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)(CKBEHAVIOR_INTERNALLYCREATEDINPUTPARAMS|CKBEHAVIOR_VARIABLEPARAMETERINPUTS|CKBEHAVIOR_INTERNALLYCREATEDOUTPUTPARAMS|CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS|CKBEHAVIOR_VARIABLEOUTPUTS|CKBEHAVIOR_VARIABLEINPUTS));
	proto->SetFunction( CallPythonFunc2 );
	proto->SetBehaviorCallbackFct(CallPythonFuncCB2);
	
	*pproto = proto;
	return CK_OK;
	
}
Example #18
0
/*
 *******************************************************************
 * Function: CKERROR CreateGetCISProto( 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 CreateGetCISProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype(GBL_CI_API_ENTRY("GetCIS"));
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("Start");
	proto->DeclareOutput("Success");
	proto->DeclareOutput("Error");

	proto->DeclareInParameter("CIS ID", CKPGUID_INT,"0");
	proto->DeclareOutParameter("GetErrorCode", GUID_TGBLERROR,"0");

	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);

	proto->SetFunction(GetCIS);
	*pproto = proto;
	return CK_OK;
}
Example #19
0
CKERROR CreateLoadCISProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Load CIS");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("Start");
	proto->DeclareOutput("Success");
	proto->DeclareOutput("Error");

	proto->DeclareInParameter("Learning Application ID", CKPGUID_INT,"0");
	proto->DeclareOutParameter("Error String ", CKPGUID_STRING,"0");
	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);

	proto->SetFunction(LoadCIS);
	*pproto = proto;
	return CK_OK;
}
Example #20
0
CKERROR CreateAddNodalLinkProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = NULL;
	proto = CreateCKBehaviorPrototype("Create Nodal Edge");
	if(!proto) return CKERR_OUTOFMEMORY;
	
	proto->DeclareInput("In");
	proto->DeclareOutput("Out");

	proto->DeclareInParameter("Nodal Path",CKPGUID_GROUP);
	proto->DeclareInParameter("Start Node",CKPGUID_3DENTITY);
	proto->DeclareInParameter("End Node",CKPGUID_3DENTITY);
	proto->DeclareInParameter("Difficult",CKPGUID_FLOAT);


	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetFunction( AddNodalLink );
	
	*pproto = proto;
	return CK_OK;
	
}
Example #21
0
CKERROR GBLCOCreateError::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
	{

#if GBL_RUNTIME	
	// Not editable from Virtools Dev
	CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototypeRunTime( "GBLCOCreateError" );
#elif GBL_GAMEDEVELOPER 
	// Edition depend on the BB.
	CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLCOCreateError" );
#else					
	// Editable from Virtools Dev
	CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLCOCreateError" );
#endif 
	
	if ( !behaviorPrototype ) 
        return CKERR_OUTOFMEMORY;

	//---     Inputs declaration
	behaviorPrototype->DeclareInput( "In" );

	//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "OutHandled" );
	behaviorPrototype->DeclareOutput( "OutUnhandled" );

	//---     Parameter Input declaration
	behaviorPrototype->DeclareInParameter("SetErrorCode", CKPGUID_INT);
	behaviorPrototype->DeclareInParameter("SetErrorDescription", CKPGUID_STRING);
	behaviorPrototype->DeclareInParameter("SetErrorType", GUID_EGBLERRORTYPE);
	
	//---     Parameter Output declaration
	behaviorPrototype->DeclareOutParameter("GetError", GUID_TGBLERROR);

	behaviorPrototype->SetFunction(GBLCOCreateError::BehaviourFunction);

    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
Example #22
0
//************************************
// Method:    CreatePCIgnorePairProto
// FullName:  CreatePCIgnorePairProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePCIgnorePairProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PCIgnorePair");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In0");
	proto->DeclareOutput("Out0");

	
	proto->SetBehaviorCallbackFct( PCIgnorePairCB );
	
	proto->DeclareInParameter("Object A",CKPGUID_3DENTITY);
	proto->DeclareInParameter("Object B",CKPGUID_3DENTITY);
	proto->DeclareInParameter("Ignore",CKPGUID_BOOL,"0");



	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(PCIgnorePair);
	*pproto = proto;
	return CK_OK;
}
Example #23
0
CKERROR CreateGetLastFileNameProto(CKBehaviorPrototype **pproto)
{
    CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("GetLastFileName");
    if(!proto) return CKERR_OUTOFMEMORY;
    proto->DeclareInput("Create Zip File");
    proto->DeclareOutput("Zip File created");


    proto->DeclareOutParameter("FilePath",CKPGUID_STRING);
    proto->DeclareOutParameter("Path",CKPGUID_STRING);


    proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
    proto->SetFunction(GetLastFileName);
    *pproto = proto;
    return CK_OK;
}
Example #24
0
//************************************
// Method:    CreatePClothDestroyProto
// FullName:  CreatePClothDestroyProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePClothDestroyProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PClothDestroy");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In");
	proto->DeclareOutput("Out");

	/*! \page PClothDestroy  

	PClothDestroy is categorized in \ref Clothes

	<h3>Description</h3>
	Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
	Destroys a physical cloth.<br>

	@see pWorld::destroyCloth()

	<h3>Technical Information</h3>

	\image html PClothDestroy.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>Target cloth reference.
	<BR>
	<BR>

	*/

	proto->SetBehaviorCallbackFct( PClothDestroyCB );

	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(PClothDestroy);
	*pproto = proto;
	return CK_OK;
}
Example #25
0
CKERROR CreateSetZoomProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Set Zoom");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In");
	proto->DeclareOutput("Out");
	
	proto->DeclareInParameter("Focal Length (mm)", CKPGUID_FLOAT, "50");
	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetFunction(SetZoom);
  proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	*pproto = proto;
	return CK_OK;

}
Example #26
0
CKERROR CreateHasFFEffectsProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = NULL;
	proto = CreateCKBehaviorPrototype("JHasForceFeedback");
	if(!proto) return CKERR_OUTOFMEMORY;
	
	proto->DeclareInput("In");
	proto->DeclareOutput("yes");
	proto->DeclareOutput("no");
	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetFunction( HasFFEffects );
	proto->SetBehaviorCallbackFct(PlayFFECallBackObject2);
	
	*pproto = proto;
	return CK_OK;
	
}
Example #27
0
/*
 *******************************************************************
 * 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;
}
/*
 *******************************************************************
 * 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.
 *
 * Paramters :
 *    behaviorPrototypePtr    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR CGBLLAESetLoadState::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLLAESetLoadState" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
	//---     Inputs declaration
	behaviorPrototype->DeclareInput( "SetLoadState" );

	behaviorPrototype->DeclareInParameter("LoadState", GUID_EGBLLAELOADSTATE);

	//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "LoadStateSet" );
	behaviorPrototype->DeclareOutput( "Error" );


	behaviorPrototype->DeclareOutParameter("Error", GUID_TGBLERROR);

	//----

	





    //----	Local Parameters Declaration
    
    //----	Settings Declaration

	behaviorPrototype->SetBehaviorCallbackFct( CGBLLAESetLoadState::CallBack, CKCB_BEHAVIORATTACH|CKCB_BEHAVIORDETACH|CKCB_BEHAVIORDELETE|CKCB_BEHAVIOREDITED|CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORPRESAVE|CKCB_BEHAVIORPOSTSAVE|CKCB_BEHAVIORRESUME|CKCB_BEHAVIORPAUSE|CKCB_BEHAVIORRESET|CKCB_BEHAVIORRESET|CKCB_BEHAVIORDEACTIVATESCRIPT|CKCB_BEHAVIORACTIVATESCRIPT|CKCB_BEHAVIORREADSTATE, NULL );
    behaviorPrototype->SetFunction( CGBLLAESetLoadState::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
Example #29
0
CKERROR CreateGetCurrentCameraProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("Get Current Camera");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In");
	proto->DeclareOutput("Out");
	
	proto->DeclareOutParameter("Current Camera",CKPGUID_CAMERA);

	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetFunction(GetCurrentCamera);

	*pproto = proto;
	return CK_OK;
}
Example #30
0
CKERROR CreateSetMousPosProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("SetMousePos");
	if(!proto) return CKERR_OUTOFMEMORY;
	proto->DeclareInput("Create Zip File");

	
	proto->DeclareOutput("Zip File created");

	proto->DeclareInParameter("IsServer",CKPGUID_FLOAT);
	proto->DeclareInParameter("IsServer",CKPGUID_FLOAT);
		
	proto->DeclareOutParameter("UP",CKPGUID_INT);
	
	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetFunction(SetMousPos);
	*pproto = proto;
	return CK_OK;
}