![]() |
VR-Forces 4.0.4 Class Documentation
|
The Add Simulation Command example demonstrates the following:
The Add Simulation Command example adds a new simuation command which will receive and implement the new MySimCommand
Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces application
This example demonstrates how to add a new kind of sim command.
Select Settings, Plugins... and on the Plugins Editor page, use the combo box at the top of the page to select the plug-in. Then enable the Load Plugin checkbox and re-start VR-Forces.
To view the new behavior:
Note that the text you typed in to the 'My Sim Command' window appears in the back-end console, prefaced by the name of the entity.\
| MySimCommand | The subclass of DtSimCommand that is used to communicate the new simulation command. |
| MySimCommandExecutor | The subclass of DtSimCommandExecutor implements the MySimCommand command. |
/******************************************************************************* ** Copyright (c) 2006 MAK Technologies, Inc. ** All rights reserved. *******************************************************************************/ /******************************************************************************* ** $RCSfile: plugin.cxx,v $ $Revision: 1.1 $ $State: Exp $ *******************************************************************************/ #include "vrfcgf/vrfPluginExtension.h" #include "mySimCommand.h" #include "mySimCommandExecutor.h" #include "vrfobjcore/simCommandExecutorFactory.h" #include "vrfcgf/cgf.h" #include "vrfcgf/factoryMgr.h" #include "vrfobjcore/compTypes.h" extern "C" { DT_VRF_DLL_PLUGIN void DtPluginInformation(DtVrfPluginInformation& info) { info.pluginName = "Add Sim Command Sim"; info.pluginVersion = "1.00"; info.pluginCreator = "MAK Technologies"; info.pluginCreatorEmail = "sales@mak.com"; info.pluginContactWebPage = "www.mak.com"; info.pluginContactMailingAddress = "68 Moulton Street - Cambridge, MA 02138"; info.pluginContactPhone = "(617) 876 8085"; } DT_VRF_DLL_PLUGIN bool DtInitializeVrfPlugin(DtCgf* cgf) { //For simulation commands, the executor and the message both need to be registered cgf->factoryManager()->simCommandFactory()->addCreatorFcn( MySimCommandTypeString, MySimCommandType, MySimCommand::creator); cgf->factoryManager()->simCommandExecutorFactory()->addCreatorFcn( MySimCommandType, MySimCommandExecutor::create); return true; } }