VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Parallel Tick (parallelTick)

Table of Contents

The Parallel Tick example demonstrates the following:

Creating a Thread Safe Component

This example shows the skeleton of a thread safe component.

Marking Components as Thread Safe

When the component is created it needs to be passed to DtSimComponent::MarkThreadSafe. This is generally done in the creator function for the component. The component should be passed to MarkThreadSafe and the component which is returned by that function should be returned from the creator.

Writing Thread Safe Component Code

See the Parallel Tick Dev Guide .

Configuring the Component

In order to use the component it must be added to the system and configured on an entity. See the Add Actuator example for details.

How to Run the Example

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

Usage

In the launcher, set the parallelTick plugin to load start VR Forces. This example only shows how to create the component type. To use it, it must be configured on an entity type.

Classes

MyParallelTickComponentParallel Tick Component, which is derived from DtSimComponent.

Plugin Entry Points

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

#include "vrfcgf/vrfPluginExtension.h"
#include "parallelTickActuator.h"

#include <vrfcgf/cgf.h>
#include <vrfcgf/factoryManager.h>
#include <vrfobjcore/simComponentTypes.h>

extern "C" {

   DT_VRF_DLL_PLUGIN void DtPluginInformation(DtVrfPluginInformation& info)
   {
      info.pluginName = "Parallel Tick";
      info.pluginVersion = "1.00";
      info.pluginCreator = "MAK Technologies";
      info.pluginCreatorEmail = "sales@mak.com";
      info.pluginContactWebPage = "www.mak.com";
      info.pluginContactMailingAddress = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 USA";
      info.pluginContactPhone = "(617) 876 8085";
   }

   DT_VRF_DLL_PLUGIN bool DtInitializeVrfPlugin(DtCgf* cgf)
   {
      //Register the creation function for our derived actuator with the
      //DtSimComponentFactory.
      cgf->factoryManager()->componentFactory()->addCreatorFcn(
         MyParallelTickComponent::Tag, MyParallelTickComponent::creator);
      
      return true;
   }
}


Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)