![]() |
VR-Forces 4.8 Class Documentation
|
The Parallel Tick example demonstrates the following:
This example shows the skeleton of a thread safe component.
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.
See the Parallel Tick Dev Guide .
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.
Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces application. Once you have verified the plugin is loaded you will need:
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.
| MyParallelTickComponent | Parallel Tick Component, which is derived from DtSimComponent. |
/*******************************************************************************
** 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;
}
}