VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Add Comm Model (addCommModel)

Table of Contents

The Add Comm Model example demonstrates the following:

Communication Models

VR-Forces includes an architecture for plug-in communication models. Communication Models are used by VR-Forces to pass simulated messages such as spot reports from one entity to another. The communication model determines what messages can get through to their destination, and how long that takes.

This example creates a communcation model that uses the radio transmitter power of sending entities, and the range between the entities to determine if a message can get through. A derived sms is used that alters the commModelParams.mtl file to use the new comm model and to publish the objects' transmitters.

Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces application

How to Run the Example

In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the plugin.

  1. Start VR-Forces GUI and SIM.
  2. To view the new behavior, load the scenario data\scenarios\developer_toolkit_examples\addCommModel\addCommModel.scn.
  3. To see default behavior without the plugin, before loading the scenario move the commModelParams.mtl file from the developer_toolkit_examples simulation model set, to a different temporary location.
  4. Then with the scenario loaded the SmWhel 2 and SmWhel 3 will both get the message from SmWhel 1 and will both start moving.
  5. To run with the example new comms model, put the commModelParams.mtl file back into the simulation model set directory and run the scenario again.
  6. With the new comms model only SmWhel 2 will receive the message and start moving. SmWhel 3 will stay in place.

Classes

MyCommModelNew comm model code, derived from VRF DtSimpleRadioCommModel.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2011 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: plugin.cxx,v $ $Revision: 1.1 $ $State: Exp $
*******************************************************************************/
#include "myCommsModel.h"
#include "vrfcgf/cgf.h"
extern "C" {
{
info.pluginName = "addCommModel";
info.pluginVersion = "1.00";
info.pluginDescription = "An example of how to add a new internal comms model showing how to override radio connectivity";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "10 Fawcett Street, Suite 204, Cambridge, MA 02138 USA";
info.pluginContactPhone = "(617) 876 8085";
}
DT_VRF_DLL_PLUGIN bool DtInitializeVrfPlugin(DtCgf* cgf)
{
//Register new comms model
return true;
}
}

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)