![]() |
VR-Forces Developer's Guide
|
A plug-in lets you extend VR-Forces without rebuilding the entire application.
You can extend much of the VRF sim engine application through plug-ins. Through the plug-in interface you have access to:
When you create a sim engine plug-in, you must include vrfPluginExtension.h in the plug-in module. The vrfPluginExtension.h header file contains a description of the entry points available to plug-ins for initialization and cleanup.
Use the following plug-in callbacks when you create a plug-in. At least one of these callbacks must be present in a plug-in for it to be loaded:
The DtVrfPluginInformation parameter supplied to DtPluginInformation allows you to identify your plug-in. This information is recorded to the plug-in's log file and vrfSim.log file as each plug-in is loaded and initially used. This structure has the following information:
The following entry point is optional and should be used only if the plug-in needs to clean up memory when it is unloaded:
The following example is a plug-in for the sim engine. The plug-in overrides the normal behavior of an actuator.
This example:
The DtCgf class is passed in to the plug-in through the DtInitializeVrfPlugin entry point. In this function, you can register the creation functions for the classes you want to override. You can also register callback functions on important events, such as opening and closing scenarios.
Plug-in libraries are placed in the ./bin directory. By default, the sim engine does not load any plug-ins. You can specify which plug-ins to load on the command line or in an xml file in the ./plugins directory. The preferred way to configure loading of plug-ins is through the Plugins dialog box in the VRF GUI, or in the VRF Launcher. For details, please see "Managing Plug-ins", in VR-Forces Users Guide.
Many of the examples included with VR-Forces are plug-ins. Please see VR-Forces Examples for the complete list of examples.