Пример #1
0
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;
}
Пример #2
0
//************************************
// Method:    CreateJD6SetParametersProto
// FullName:  CreateJD6SetParametersProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreateJD6SetParametersProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PJD6SetParameters");
	if(!proto) return CKERR_OUTOFMEMORY;

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

	
	
	proto->SetBehaviorCallbackFct( JD6SetParametersCB );
	
	
	proto->DeclareInParameter("Body B",CKPGUID_3DENTITY,"ball2");
	proto->DeclareInParameter("Drive Linear Velocity",CKPGUID_VECTOR);
	proto->DeclareInParameter("Drive Angular Velocity",CKPGUID_VECTOR);
	proto->DeclareInParameter("Drive Position",CKPGUID_VECTOR);
	proto->DeclareInParameter("Drive Orientation",CKPGUID_QUATERNION);
	
	proto->DeclareInParameter("Ratio",CKPGUID_FLOAT,"0");
	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(JD6SetParameters);
	*pproto = proto;
	return CK_OK;
}
Пример #3
0
CKERROR CreateDOOwnerChangedProto(CKBehaviorPrototype **pproto)
{
    CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("DOOwnerChanged");
    if(!proto) return CKERR_OUTOFMEMORY;



    proto->DeclareInput("On");
    proto->DeclareInput("Off");

    proto->DeclareOutput("Exit On");
    proto->DeclareOutput("Exit Off");
    proto->DeclareOutput("New Owner");
    proto->DeclareOutput("Object Released");
    proto->DeclareOutput("Error");



    proto->DeclareInParameter("Connection ID", CKPGUID_INT, "0");
    proto->DeclareInParameter("Object", CKPGUID_BEOBJECT, "test");

    proto->DeclareOutParameter("Owner ID", CKPGUID_ID, "-1");
    proto->DeclareOutParameter("Error", VTE_NETWORK_ERROR, "Ok");


    proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
    proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)( CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS  ));
    proto->SetFunction(DOOwnerChanged);
    proto->SetBehaviorCallbackFct(DOOwnerChangedCB);

    *pproto = proto;
    return CK_OK;

}
Пример #4
0
//************************************
// 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;
}
Пример #5
0
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;
}
Пример #6
0
/*
 *******************************************************************
 * 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;
}
Пример #7
0
CKERROR CreateLogEntryProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("pLogEvent");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In");
	proto->DeclareInput("Off");
	proto->DeclareOutput("Message");

	proto->DeclareOutput("Error");
	proto->DeclareOutput("Warning");
	proto->DeclareOutput("Info");
	proto->DeclareOutput("Trace");
	proto->DeclareOutput("Debug");


	
	proto->DeclareOutParameter("Entry",CKPGUID_STRING);
	
	proto->DeclareOutParameter("Type",CKPGUID_INT);
	proto->DeclareOutParameter("Component",CKPGUID_STRING);


	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)( CKBEHAVIOR_VARIABLEPARAMETERINPUTS  ));
	proto->SetFunction(LogEntry);
	proto->SetBehaviorCallbackFct(LogEntryCB);


	*pproto = proto;


	return CK_OK;

}
Пример #8
0
//************************************
// 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;
}
Пример #9
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;
}
Пример #10
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;
}
Пример #12
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;
}
Пример #13
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;

}
Пример #14
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;
}
Пример #15
0
//************************************
// Method:    CreatePVGetProto
// FullName:  CreatePVGetProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePVGetProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PVGet");
	if(!proto) return CKERR_OUTOFMEMORY;

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

	proto->SetBehaviorCallbackFct( PVGetCB );


	BB_EVALUATE_SETTINGS(gOPMap);

	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(PVGet);
	*pproto = proto;
	return CK_OK;
}
Пример #16
0
CKERROR CreateDOUserValueModifiedProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("DOUserValueModified");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In");
	proto->DeclareInput("Off");
	proto->DeclareInput("Next Value");



	proto->DeclareOutput("Exit In");
	proto->DeclareOutput("Exit Off");
	proto->DeclareOutput("New Value");
	proto->DeclareOutput("Error");


	
	proto->DeclareInParameter("Connection ID", CKPGUID_INT, "0");
	proto->DeclareInParameter("Object", CKPGUID_BEOBJECT, "test");
	
	proto->DeclareOutParameter("Time", CKPGUID_TIME, "0");
	proto->DeclareOutParameter("Value", CKPGUID_STRING, "No Error");
	proto->DeclareOutParameter("Error", VTE_NETWORK_ERROR, "Ok");

	proto->DeclareSetting("Class", CKPGUID_STRING, "My3DClass");
	proto->DeclareSetting("Parameter Name", CKPGUID_STRING, "test");

	
	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)( CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS  ));
	proto->SetFunction(DOUserValueModified);
	proto->SetBehaviorCallbackFct(DOUserValueModifiedCB);

	*pproto = proto;
	return CK_OK;

}
Пример #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;
	
}
Пример #18
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;
}
Пример #19
0
//************************************
// Method:    CreatePBSetTriggerMaskProto
// FullName:  CreatePBSetTriggerMaskProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePBSetTriggerMaskProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PCSetTriggerMask");
	if(!proto) return CKERR_OUTOFMEMORY;

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

	/*! \page PCSetTriggerMask  

	PCSetTriggerMask is categorized in \ref Collision

	<h3>Description</h3>
	Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
	Modifies the trigger mask of a bodies or a sub shape of it.<br>
	See <A HREF="pBTriggerEvent.cmo">pBTriggerEvent.cmo</A> for example.


	<h3>Technical Information</h3>

	\image html PBSetTriggerMask.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 shape reference. Can be a sub shape or the initial mesh.
	<BR>
	<BR>
	<SPAN CLASS="pin">On Enter: </SPAN>Enables triggering if the body starts entering another shape.
	<BR>
	<SPAN CLASS="pin">On Stay: </SPAN>Enables triggering if the body stays in another shape.
	<BR>
	<SPAN CLASS="pin">On Leave: </SPAN>Enables triggering if the body leaves another shape.
	<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 PCSetTriggerMask.cpp
	</SPAN>
	*/

	proto->SetBehaviorCallbackFct( PBSetTriggerMaskCB );
	proto->DeclareInParameter("On Enter",CKPGUID_BOOL,"true");
	proto->DeclareInParameter("On Stay",CKPGUID_BOOL,"true");
	proto->DeclareInParameter("On Leave",CKPGUID_BOOL,"true");


	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(PBSetTriggerMask);
	*pproto = proto;
	return CK_OK;
}
Пример #20
0
/*
 *******************************************************************
 * Function: CKERROR CreateBehaviourPrototype( 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 CGBLBuildCommand::CreateBehaviourPrototype(CKBehaviorPrototype** pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("GBLFCBuildCommand");
	if (!proto) 
    {
		return CKERR_OUTOFMEMORY;
	}

//---     Inputs declaration

	/**
	* Starts building the command. Find required WaitForCommand BB, determine its
	* target (EGBLFCTarget) and attributes.
	*/
	proto->DeclareInput("BuildCommand");

	/**
	* This input is activated if the Build Command BB operation is to be cancelled.
	* For example the Facilitator pressed 'Cancel' button stating that he doesn't
	* want to invoke the command anymore. The allocated data has to be released and
	* 'Cancelled' output activated.
	*/
	proto->DeclareInput("CancelOperation");

	/**
	* The next parameter value has been passed in to the Build Command BB. For
	* example the Facilitator specified a value for prompted parameter and pressed
	* 'OK' button.
	*/
	proto->DeclareInput("ReadNextParameterValue");

//---     Outputs declaration

	/**
	* This output indicates that the build command has been cancelled. For example
	* the Facilitator pressed 'Cancel' button stating that he doesn't want to invoke
	* the command anymore. The allocated data had been released.
	*/
	proto->DeclareOutput("Cancelled");

	/**
	* Indicate that a list of targets for the command is needed to be specified as an
	* array of Virtools user ID's and fed into SetDests parameter input of this
	* building block with ReadNextParameterValue input activated. The GBLTarget (that
	* specifies if the recipient is global, a team or a player) is specified as
	* GetGBLTarget parameter output.
	*/
	proto->DeclareOutput("ListRecipients");

	/**
	* Additional parameter input is required for chosen command. For example a dialog
	* prompting for facilitator input could be displayed for the type and name
	* specified in parameter outputs.
	*/
	proto->DeclareOutput("GetNextParameterValue");

	/**
	* If the value specified (by facilitator) is invalid (for example string instead
	* of integer), the input parameter  has to be obtained again (possibly with
	* additional warning).
	*/
	proto->DeclareOutput("InvalidValue");

	/**
	* States that the message target was a global element and it had been delivered
	* to local object (For it to have a global effect the object needs to be a
	* virtools distributed object or an alternative means of network synchronization
	* implemented by the designer).
	*/
	proto->DeclareOutput("HandleUntargetedCommand");

	/**
	* States that the message target is a network element and  is specified as an
	* array in parameter output. The command itself is encoded to a string and also
	* available as parameter output.
	*/
	proto->DeclareOutput("HandleTargetedCommand");

	/**
	* States that and error occured. The build operation is cancelled
	*/
	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;
}
Пример #21
0
//************************************
// Method:    CreatePBSetHardProto
// FullName:  CreatePBSetHardProto
// Access:    public
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePBSetHardProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PBSetHard");
	if(!proto) return CKERR_OUTOFMEMORY;

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

	
	/*! \page PBSetHard  

	PBSet is categorized in \ref Body

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

	<h3>Technical Information</h3>

	\image html PBSetHard.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 with the rigid body or its sub shape. 
	<BR>
	<BR>
	<SPAN CLASS="pin">Linear Velocity: </SPAN>The linear velocity.See pRigidBody::setLinearVelocity().
	<BR>
	<SPAN CLASS="pin">Angular Velocity: </SPAN>The angular velocity.See pRigidBody::setAngularVelocity().
	<BR>
	<SPAN CLASS="pin">Agular Momentum: </SPAN>The angular momentum.See pRigidBody::getAngularMomentum().
	<BR>
	<SPAN CLASS="pin">Linear Momentum: </SPAN>The linear momentum.See pRigidBody::getLinearMomentum(). 
	<BR>
	<SPAN CLASS="pin">Position: </SPAN>The position.See pRigidBody::setPosition(). 
	<BR>
	<SPAN CLASS="pin">Orientation: </SPAN>The new rotation.See pRigidBody::setRotation(). 
	<BR>


	<h3>Warning</h3>
	The body must be dynamic.
	<br>
	<br>

	<h3>Note</h3>
	Is utilizing #pRigidBody #pWorld #PhysicManager .
	<br>
	<br>
	<SPAN CLASS="framedWhite">
	The known building block <A HREF="Documentation.chm::/behaviors/3D%20Transformations/Set%20Position.html">"Set Position"</A> has new settings avaiable.
	Enable there "Update Physics" in order to transfer the new position on the body automatically!
	</SPAN>

	<h3>VSL</h3><br>
	<SPAN CLASS="NiceCode">
	\include PBSet.cpp
	</SPAN>

	*/

	proto->SetBehaviorCallbackFct( PBSetHardCB );

	BB_EVALUATE_SETTINGS(gPIMAP)

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

	proto->SetFunction(PBSetHard);
	*pproto = proto;
	return CK_OK;
}
Пример #22
0
//************************************
// Method:    CreatePClothAddForceAtVertexProto
// FullName:  CreatePClothAddForceAtVertexProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePClothAddForceAtVertexProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PClothAddForceAtVertex");
	if(!proto) return CKERR_OUTOFMEMORY;

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

	/*! \page PClothAddForceAtVertex  

	PClothAddForceAtVertex is categorized in \ref Clothes

	<h3>Description</h3>
	Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
	Applies a force (or impulse) defined in the global coordinate frame, to a particular 
	vertex of the cloth.<br>


	Because forces are reset at the end of every timestep, 
	you can maintain a total external force on an object by calling this once every frame.


	@see pCloth::addForceAtVertex()


	<h3>Technical Information</h3>

	\image html PClothAddForceAtVertex.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>
	<SPAN CLASS="pin">Vertex Index: </SPAN>Number of the vertex to add the force at.
	<BR>
	<SPAN CLASS="pin">Force: </SPAN>Force/impulse to add, defined in the global frame. 
	<BR>
	<SPAN CLASS="pin">Force Mode: </SPAN>The mode to use when applying the force/impulse.
	(see #ForceMode, supported modes are FM_Force, FM_Impulse, FM_Acceleration, FM_VelocityChange)
	<BR>
	
	*/



	proto->SetBehaviorCallbackFct( PClothAddForceAtVertexCB );
	proto->DeclareInParameter("Vertex Index",CKPGUID_INT);
	proto->DeclareInParameter("Force",CKPGUID_VECTOR);
	proto->DeclareInParameter("Force Mode",VTE_BODY_FORCE_MODE);

	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(PClothAddForceAtVertex);
	*pproto = proto;
	return CK_OK;
}
Пример #23
0
//************************************
// 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;
}
Пример #24
0
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);
	
	proto->SetBehaviorCallbackFct( PWOverlapSphereCB );
	proto->SetFunction(PWOverlapSphere);
	*pproto = proto;
	return CK_OK;
}
Пример #25
0
//************************************
// Method:    CreatePBPhysicalizeProto
// FullName:  CreatePBPhysicalizeProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePBPhysicalizeProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PBPhysicalize");
	if(!proto) return CKERR_OUTOFMEMORY;

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

	/* \page TestBlock
	PBPhysicalize  

	PBPhysicalize is categorized in \ref Body

	<h3>Description</h3>
	Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
	Applies an impulsive torque defined in the actor local coordinate frame to the actor.<br>
	See <A HREF="pBPhysicalize.cmo">pBPhysicalize.cmo</A> for example.
	<h3>Technical Information</h3>

	\image html PBPhysicalize.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>
	
	<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;
}
Пример #26
0
//************************************
// Method:    CreatePVWSetProto
// FullName:  CreatePVWSetProto
// Access:    public
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePVWSetProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PVWSet");
	if(!proto) return CKERR_OUTOFMEMORY;

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


	/*! \page PVWSet

	PVWSet is categorized in \ref Vehicle

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

	<h3>Technical Information</h3>

	\image html PVWSet.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>


	<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 PBSetEx.cpp
	</SPAN>
	*/

	
	proto->SetBehaviorCallbackFct( PVWSetCB );

	BB_EVALUATE_SETTINGS(pInMap2);

	//----------------------------------------------------------------
	//
	// We just want create the building block pictures
	//
	#ifdef _DOC_ONLY_
		BB_EVALUATE_INPUTS(pInMap2);
	#endif // _DOC_ONLY_
	


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

	proto->SetFunction(PVWSet);
	*pproto = proto;
	return CK_OK;
}
Пример #27
0
//************************************
// Method:    CreatePJRevoluteProto
// FullName:  CreatePJRevoluteProto
// Access:    public
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePJRevoluteProto(CKBehaviorPrototype **pproto)
{
    CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PJRevolute");
    if(!proto) return CKERR_OUTOFMEMORY;

    /*! \page PJRevolute

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

    <h3>Description</h3>
    Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
    Creates or modifies a revolute joint.
    <br>
    <br>
    DOFs removed: 5<br>
    DOFs remaining: 1<br>
    <br>
    \image html revoluteJoint.png

    A revolute joint removes all but a single rotational degree of freedom from two objects.
    The axis along which the two bodies may rotate is specified with a point and a direction
    vector. In theory, the point along the direction vector does not matter, but in practice,
    it should be near the area where the bodies are closest to improve simulation stability.

    An example for a revolute joint is a door hinge.
    Another example would be using a revolute joint to attach rotating fan blades to a
    ceiling. 	The revolute joint could be motorized, causing the fan to rotate.

    <h3>Technical Information</h3>

    \image html PJRevolute.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">Body B: </SPAN>The second body. Leave blank to create a joint constraint with the world.
    <BR>
    <BR>

    <SPAN CLASS="pin">Anchor:</SPAN>A point in world space coordinates. See pJointRevolute::setGlobalAnchor().
    <BR>
    <SPAN CLASS="pin">Anchor Reference: </SPAN>A helper entity to transform a local anchor into the world space.
    <BR>

    <SPAN CLASS="pin">Axis: </SPAN>An in world space. See pJointRevolute::setGlobalAxis().
    <BR>
    <SPAN CLASS="pin">Axis Up Reference: </SPAN>A helper entity to transform a local axis into the world space.
    <BR>
    <BR>
    <hr>

    <SPAN CLASS="pin">Collision: </SPAN>Enable Collision. See pJointRevolute::enableCollision().
    <BR>

    <hr>
    <SPAN CLASS="pin">Projection Mode: </SPAN>Joint projection mode. See pJointRevolute::setProjectionMode() and #ProjectionMode.
    <BR>

    <SPAN CLASS="pin">Projection Distance: </SPAN>If any joint projection is used, it is also necessary to set
    projectionDistance to a small value greater than zero. When the joint error is larger than projectionDistance the SDK will change it so that the joint error is equal to projectionDistance. Setting  projectionDistance too
    small will introduce unwanted oscillations into the simulation.See pJointRevolute::setProjectionDistance().
    <br>

    <SPAN CLASS="pin">Projection Angle: </SPAN>Angle must be greater than 0.02f .If its smaller then current algo gets too close to a singularity. See pJointRevolute::setProjectionAngle().
    <BR>


    <hr>
    <SPAN CLASS="pin">Spring: </SPAN>Make it springy.See pJointRevolute::setSpring().
    <BR>

    <hr>
    <SPAN CLASS="pin">High Limit: </SPAN>Higher rotation limit around the rotation axis. See pJointRevolute::setHighLimit().
    <BR>

    <SPAN CLASS="pin">Low Limit: </SPAN>Lower rotation limit around rotation axis. See pJointRevolute::setLowLimit().
    <BR>

    <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;
}
Пример #28
0
//************************************
// 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;
}
Пример #29
0
//************************************
// Method:    CreatePVSetMotorValuesProto
// FullName:  CreatePVSetMotorValuesProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePVSetMotorValuesProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PVMotor");
	if(!proto) return CKERR_OUTOFMEMORY;

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

	

	//BB_EVALUATE_PINS(gPIMAP)
	BB_EVALUATE_SETTINGS(gPIMAP);


	/*!  PVMotor  

	PVSetMotorValues is categorized in \ref Vehicle

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

	<h3>Technical Information</h3>

	\image html PVMotor.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="pin">Collisions Group: </SPAN>Which collision group this body is part of.See pRigidBody::setCollisionsGroup().
	<BR>
	<SPAN CLASS="pin">Kinematic Object: </SPAN>The kinematic state. See pRigidBody::setKinematic().
	<BR>
	<SPAN CLASS="pin">Gravity: </SPAN>The gravity state.See pRigidBody::enableGravity().
	<BR>
	<SPAN CLASS="pin">Collision: </SPAN>Determines whether the body reacts to collisions.See pRigidBody::enableCollision(). 
	<BR>
	<SPAN CLASS="pin">Mass Offset: </SPAN>The new mass center in the bodies local space.
	<BR>
	<SPAN CLASS="pin">Pivot Offset: </SPAN>The initial shape position in the bodies local space.
	<BR>
	<SPAN CLASS="pin">Notify Collision: </SPAN>Enables collision notification.This is necessary to use collisions related building blocks. 
	<BR>
	<SPAN CLASS="pin">Transformation Locks: </SPAN>Specifies in which dimension a a transformation lock should occour.
	<BR>
	<SPAN CLASS="pin">Linear Damping: </SPAN>The new linear damping scale.
	<BR>
	<SPAN CLASS="pin">Angular Damping: </SPAN>The new linear damping scale.
	<BR>

	<SPAN CLASS="pin">Filter Groups: </SPAN>Sets the filter mask of the initial or sub shape.
	<BR>


	<SPAN CLASS="setting">Collisions Group: </SPAN>Enables input for collisions group.
	<BR>
	<SPAN CLASS="setting">Kinematic Object: </SPAN>Enables input for kinematic object.
	<BR>
	<SPAN CLASS="setting">Gravity: </SPAN>Enables input for gravity.
	<BR>
	<SPAN CLASS="setting">Collision: </SPAN>Enables input for collision. 
	<BR>
	<SPAN CLASS="setting">Mas Offset: </SPAN>Enables input for mass offset. 
	<BR>
	<SPAN CLASS="setting">Pivot Offset: </SPAN>Enables input for pivot offset.
	<BR>
	<SPAN CLASS="setting">Notify Collision: </SPAN>Enables input for collision. 
	<BR>
	<SPAN CLASS="setting">Linear Damping: </SPAN>Enables input for linear damping.
	<BR>
	<SPAN CLASS="setting">Angular Damping: </SPAN>Enables input for angular damping.
	<BR>
	<SPAN CLASS="setting">Filter Groups: </SPAN>Enables input for filter groups.
	<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 PBSetEx.cpp
	</SPAN>
	*/

	//proto->DeclareSetting("Collisions Group",CKPGUID_BOOL,"FALSE");

	proto->SetBehaviorCallbackFct( PVSetMotorValuesCB );
	
	

	//proto->DeclareSetting("Output Curve",CKPGUID_BOOL,"TRUE");
	//proto->DeclareSetting("Automatic Gears",CKPGUID_BOOL,"TRUE");
	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	
	proto->SetFunction(PVSetMotorValues);
	*pproto = proto;
	return CK_OK;
}
Пример #30
0
//************************************
// Method:    CreatePBPhysicalizeExProto
// FullName:  CreatePBPhysicalizeExProto
// Access:    public 
// Returns:   CKERROR
// Qualifier:
// Parameter: CKBehaviorPrototype **pproto
//************************************
CKERROR CreatePBPhysicalizeExProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("PBPhysicalizeEx");
	if(!proto) return CKERR_OUTOFMEMORY;

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

	/*! \page PBPhysicalizeEx  

	PBPhysicalizeEx is categorized in \ref Body

	<h3>Description</h3>
	Apply to a <A HREF="Documentation.chm::/beobjects/1_ck3dentity.html">3DEntity</A><br>
	Registers an object in the physic engine.<br>
	See <A HREF="PBPhysicalizeExSamples.cmo">PBPhysicalizeEx.cmo</A> for example.
	
	<h3>Technical Information</h3>

	\image html PBPhysicalizeEx.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>
	
	<SPAN CLASS="pin">Flags: </SPAN>Flags to determine common properties for the desired body.It is possible to alter certain flags after creation. See #BodyFlags for more information <br> 

		-	<b>Range:</b> [BodyFlags] 
		-	<b>Default:</b>Moving,Collision,World Gravity<br>

		-	Ways to alter flags :
			-	Using \ref PBSetPar
			-	Using VSL : #pRigidBody::updateFlags()

	<SPAN CLASS="pin">Hull Type: </SPAN>The desired shape type. The intial shape can NOT be changed after creation. See #HullType for more information <br>
	
		-	<b>Range:</b> [HullType]<br>
		-	<b>Default:</b>Sphere<br>

	<SPAN CLASS="pin">Density: </SPAN>Density of the initial shape <br>
	
		-	<b>Range:</b> [0,inf]<br>
		-	<b>Default:</b>1.0f<br>
	
		-	Ways to change the mass : 
			-	Enable "Mass" in building block settings and set "New Density" or "Total Mass" non-zero. 
			-	Using VSL #pRigidBody::updateMassFromShapes()

	<br>
		Is utilizing #pRigidBody #pWorld #PhysicManager #pFactory::createRigidBody().<br>

	


	<h3>Optional Parameters</h3>

	All more specific parameters such as material or pivot offset must be enabled by the building block settings<br>

	PBPhysicalizeEx all settings enabled : <br>
	
	\image html PBPhysicalizeExCollapsed.jpg


	<SPAN CLASS="pin">XML Setup: </SPAN>This parameter is not being used in this release<br>
	
	<hr>
	<SPAN CLASS="pin">World Reference: </SPAN>World associated with this rigid body. Leave blank to use default world (3D - Frame "pDefaultWorld" with world attribute) <br>

		-	<b>Range:</b> [object range]<br>
		-	<b>Default:</b>NULL<br>

<hr>


	<SPAN CLASS="pin">Pivot: </SPAN>Specifies the rigid bodies local shape offset (#pPivotSettings) <br><br>
	\image html pBPivotParameter.jpg

		-	<b>Offset Linear:</b> \copydoc pPivotSettings::localPosition
		-	<b>Offset Angular:</b> \copydoc pPivotSettings::localOrientation
		-	<b>Offset Reference:</b> \copydoc pPivotSettings::pivotReference

		<h4>Notes</h4><br>

		-	Alter or set the shape offset : 
			-	Using the built-in building blocks with "Physics" settings enabled : 
				-	"Set Position" 
				-	"Translate"
				-	"Set Orientation"
			-	#pRigidBody::setPosition() or #pRigidBody::setRotation()
			-	Attach attribute "Physics\pBPivotSettings" to :	
				-	3D-Entity
				-	its mesh
				-	or to the meshes material<br>

<hr>
	
	<SPAN CLASS="pin">Mass: </SPAN>Overrides mass setup (#pMassSettings) <br><br>
	\image html pBMassParameter.jpg

	-	<b>New Density:</b>	\copydoc pMassSettings::newDensity

	-	<b>Total Mass:</b>	\copydoc pMassSettings::totalDensity

	-	<b>Offset Linear:</b>	\copydoc pMassSettings::localPosition

	-	<b>Offset Angular:</b>	\copydoc pMassSettings::localOrientation

	-	<b>Offset Reference:</b>	\copydoc pMassSettings::massReference

	<h4>Notes</h4><br>
	-	Alter or set mass settings : 
		-	Attach attribute "Physics\pBOptimization" to the :	
			-	3D-Entity
			-	its mesh
			-	or to the meshes material<br>
		-	#pRigidBody::updateMassFromShapes()

<hr>
	
		
	
	<SPAN CLASS="pin">Collision: </SPAN>Overrides collsion settings (#pCollisionSettings) <br><br>
	\image html pBCollisionParameter.jpg

	-	<b>Collision Group: </b>	\copydoc pCollisionSettings::collisionGroup
	
	-	<b>Group Mask:</b>	\copydoc pCollisionSettings::groupsMask

	-	<b>Skin Width:</b>\copydoc pCollisionSettings::skinWidth

	<h4>Notes</h4><br>
	-	Alter or set collisions settings : 
			-	\ref PBSetPar. Collisions group can be set per sub shape.
			-	pRigidBody::setCollisionsGroup()
			-	pRigidBody::setGroupsMask()
			-	Attach attribute "Physics\pBCollisionSettings" to :	
				-	3D-Entity
				-	its mesh
				-	or to the meshes material <br>
	
	-	Please create custom groups in the Virtools "Flags and Enum manager" : "pBCollisionsGroup". This enumeration is stored in the cmo <br>

<hr>

	<SPAN CLASS="pin">CCD: </SPAN>Specifies a CCD mesh. This parameter is NOT being used in this release.<br><br>
	\image html pBCCSettingsParameter.jpg

<hr>



	
	<SPAN CLASS="pin">Material: </SPAN>Specifies a physic material(#pMaterial)<br><br>
	\image html pBMaterial.jpg

	-	<b>XML Link :</b> \copydoc pMaterial::xmlLinkID
	-	<b>Dynamic Friction :</b> \copydoc pMaterial::dynamicFriction
	-	<b>Static Friction: </b> \copydoc pMaterial::staticFriction
	-	<b>Restitution: </b> \copydoc pMaterial::restitution
	-	<b>Dynamic Friction V: </b> \copydoc pMaterial::dynamicFrictionV
	-	<b>Static Friction V : </b> \copydoc pMaterial::staticFrictionV
	-	<b>Direction Of Anisotropy: </b> \copydoc pMaterial::dirOfAnisotropy
	-	<b>Friction Combine Mode: </b> \copydoc pMaterial::frictionCombineMode
	-	<b>Restitution Combine Mode: </b> \copydoc pMaterial::restitutionCombineMode
	-	<b>Flags: </b> \copydoc pMaterial::flags

	<h4>Notes</h4><br>

	-	Alter or set a physic material is also possible by :
		-	\ref PBSetMaterial
		-	#pRigidBody::updateMaterialSettings()
		-	Attach attribute "Physics\pBMaterial" to :	
			-	3D-Entity
			-	its mesh
			-	or to the meshes material
		-	Using VSL : 
			
			<SPAN CLASS="NiceCode">
				\include pBMaterialSetup.vsl
			</SPAN>
	
	-	The enumeration "XML Link"  is being populated by the file "PhysicDefaults.xml" and gets updated on every reset. 
	-	If using settings from XML, the parameter gets updated too<br>

<hr>


	<SPAN CLASS="pin">Optimization: </SPAN>Specifies various optimizations(#pOptimization)<br><br>
	\image html pBOptimization.jpg

	-	<b>Transformation Locks :</b> Flags to lock a rigid body in certain degree of freedom. See also #pRigidBody::lockTransformation
	-	<b>Damping:</b> 
		
			-	<b>Linear Damping :</b> \copydoc  pRigidBody::setLinearDamping

			-	<b>Angular Damping :</b> \copydoc  pRigidBody::setAngularDamping

	-	<b>Sleeping:</b> 
		
			-	<b>Linear Sleep Velocity :</b> \copybrief  pRigidBody::setSleepLinearVelocity

			-	<b>Angular Sleep Velocity :</b> \copydoc  pRigidBody::setSleepAngularVelocity

			-	<b>Sleep Energy Threshold :</b> \copydoc  pRigidBody::setSleepEnergyThreshold
	
	-	<b>Solver Iteration :</b> \copydoc  pRigidBody::setSolverIterationCount

	-	<b>Dominance Group :</b> \copydoc  pRigidBody::setDominanceGroup

	-	<b>Compartment Id :</b> Not Implemented

	<h4>Notes</h4><br>

	-	Alter or set a rigid bodies optimization is also possible by :
		-	\ref PBSetPar
		-	#pRigidBody::updateOptimizationSettings()
		-	Attach the attribute "Physics\pBOptimization" to :	
			-	3D-Entity
			-	its mesh
			-	or to the meshes material<br>
		-	Using VSL before creation :

		
		\include pBOptimizationCreation.vsl
		

		-	Using VSL after creation :

		<SPAN CLASS="NiceCode">
			\include pBOptimizationAfterCreation.vsl
		</SPAN>

		

<hr>

	<SPAN CLASS="pin">Capsule Settings: </SPAN>Overrides capsule default dimensions(#pCapsuleSettingsEx)<br><br>
	\image html pBCapsuleSettings.jpg

	-	<b>Radius :</b> \copydoc pCapsuleSettingsEx::radius
	-	<b>Height :</b> \copydoc pCapsuleSettingsEx::height


	<h4>Notes</h4><br>

	-	Setting a rigid bodies capsule dimension is also possible by :
	-	Attach the attribute "Physics\pCapsule" to :	
		-	3D-Entity
		-	its mesh
		-	or to the meshes material
	
	-	VSL :
	
	<SPAN CLASS="NiceCode">
		\include pBCapsuleEx.vsl
	</SPAN>
	
<hr>




	<SPAN CLASS="pin">Convex Cylinder Settings: </SPAN>Overrides default convex cylinder settings(#pConvexCylinderSettings)<br><br>
	\image html pBConvexCylinder.jpg

	-	<b>Approximation :</b> \copydoc pConvexCylinderSettings::approximation
	
	-	<b>Radius :</b> \copydoc pConvexCylinderSettings::radius
	-	<b>Height :</b> \copydoc pConvexCylinderSettings::height
	
	-	<b>Forward Axis :</b> \copydoc pConvexCylinderSettings::forwardAxis
	-	<b>Forward Axis Reference:</b> \copydoc pConvexCylinderSettings::forwardAxisRef

	-	<b>Down Axis :</b> \copydoc pConvexCylinderSettings::downAxis
	-	<b>Down Axis Reference:</b> \copydoc pConvexCylinderSettings::downAxisRef

	-	<b>Right :</b> \copydoc pConvexCylinderSettings::rightAxis
	-	<b>Right Axis Reference:</b> \copydoc pConvexCylinderSettings::rightAxisRef

	-	<b>Build Lower Half Only :</b> \copydoc pConvexCylinderSettings::buildLowerHalfOnly

	-	<b>Convex Flags :</b> \copydoc pConvexCylinderSettings::convexFlags


	<h4>Notes</h4><br>

	-	Set a rigid bodies convex cylinder parameters by :
		-	Attach the attribute "Physics\pConvexCylinder" to :	
			-	3D-Entity
			-	its mesh
			-	or to the meshes material
	-	VSL :

		<SPAN CLASS="NiceCode">
			\include pBConvexCylinder.vsl
		</SPAN>

<hr>
	
*/


	BB_EVALUATE_PINS(gPIMAP)
	BB_EVALUATE_SETTINGS(gPIMAP)



	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags(CKBEHAVIOR_TARGETABLE);
	proto->SetBehaviorCallbackFct( PBPhysicalizeExCB );
	proto->SetFunction(PBPhysicalizeEx);
	*pproto = proto;
	return CK_OK;
}