VR-Forces 4.0.4 Class Documentation
Subtasking Example

The Subtasking example demonstrates the following:

The Subtasking example creates a new controller and process state repository that can be added to an existing VRF object entry (.ope) to handle a turn to heading and a move to waypoint as a single task. When using this example, be sure to load the scenario found in this examples directory.

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

How to Run

This example demonstrates how to use the subtasking mechanisim to add a new behavior to an entity.

Usage

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 run the application:

  1. Start vrfGui
  2. Start vrfSim
  3. Load the scenario data\scenarios\developer_toolkit_examples\subtask\turnAndMove.scn.
  4. Right-click > Information... on the entity to display its information window.
  5. Set the Notify level to Info.
  6. Click on the play button.

Messages will be displayed in the Object Console tab, at each phase in the entity's behavior as it executes the turn and move behavior.

Classes

DtTurnAndMoveControllerThis subclass of DtTaskControllerComponent will listen to front-end tasks and implement the subtasking mechanism for a turn and move to.
DtTurnAndMoveControllerPSRThis subclass of DtVrfProcessStateRepository that will keep information about the turn and move task to use when reloaded as part of a scenario.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2003 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: plugin.cxx,v $ $Revision: 1.3 $ $State: Exp $
*******************************************************************************/

#include "vrfcgf/vrfPluginExtension.h"
#include "turnAndMoveController.h"
#include "turnAndMoveControllerPSR.h"

#include "vrfcgf/cgf.h"
#include "vrfcgf/factoryMgr.h"
#include "vrfobjcore/procSRFact.h"

extern "C" {

   DT_VRF_DLL_PLUGIN void DtPluginInformation(DtVrfPluginInformation& info)
   {
      info.pluginName = "subtask";
      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)
   {
      cgf->factoryManager()->componentFactory()->addCreatorFcn(
         DtTurnAndMoveControllerType, DtTurnAndMoveController::creator);  

      cgf->factoryManager()->processStateRepositoryFactory()->addCreatorFcn(
         DtTurnAndMoveControllerPSRType, DtTurnAndMoveControllerPSR::creator);
      
      return true;
   }
}


Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)