VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Object Manager Extension (objectManager)

Table of Contents

The Object Manager Extension example demonstrates the following:

Object Manager Subclassing

This example shows how to subclass and install your own version of the DtVrfObjectManager to extend its functionality.

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

This example demonstrates how to install your own derived object manager.

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. There is no need to create a new or load an existing scenario.
  3. The vrfSim console will immediately begin repeatedly displaying 'MyObjectManager::tick()'. This confirms that the derived object manager is in use.

Classes

MyObjectManagerThis subclass of DtVrfObjectManager prints out a message every time it is ticked.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2003 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#include "myObjectManager.h"
#include "vrfcgf/cgf.h"
extern "C" {
{
info.pluginName = "objectManager";
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)
{
return true;
}
}


/*******************************************************************************
** Copyright (c) 2021 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#include "myObjectManager.h"
//It is important to pass the DtSimulationServices to the constructor of the base class
{
}
{
}
{
DtPROFILE("MyObjectManager::tick");
//This is a good place to add your own functionality. For instance, if you
//were making an after action review tool, this might be a good place to
//connect to a database to store simulation information.
DtInfo("MyObjectManager::tick()\n");
//In order for VR-Forces to function, it is vital to call down to the base
//class !
}
//The creator simply calls new. It is important to pass on the DtSimulationServices.
{
return new MyObjectManager(simManager);
}

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)