VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Scenario Metrics (scenarioMetrics)

Table of Contents

The Scenario Metrics example demonstrates the following:

Registering Callbacks

VR-Forces includes an architecture for registering callbacks on the backend( DtCgf class). This allows one to regestier pre and post tick callbacks.

This example creates a DtMetricCollector class. It registers a postTickCallback on the DtCgf class to be able to query for scenario metrics each tick.

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

Usage

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

To view the new behavior:

  1. Start VR-Forces GUI and SIM.
  2. Load the scenarioMetrics.scnx scenario from the developer_toolkit_examples.
  3. Run the scenario.
  4. The R 1 will move around with spot reports enabled and the metric collector will collect his location and his sensor contracts.
  5. A metrics.txt file will get created in the /bin64/ folder. It will contain the collected data.
  6. After running the scenario for a while - open the "metrics.txt" to see the metrics collected from the scenario.

Classes

DtMetricCollectorNew code

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2003 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: plugin.cxx,v $ $Revision: 1.4 $ $State: Exp $
*******************************************************************************/
#include <vrfcgf/cgf.h>
void tickMetricCollector()
{
}
DtMetricCollector* theMetricCollector = 0;
extern "C" {
{
info.pluginName = "Scenario Metrics";
info.pluginVersion = "1.00";
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)
{
theMetricCollector = new DtMetricCollector(cgf);
return true;
}
}

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)