VR-Forces 4.2 Class Documentation
Tank Parameter Entry

This DtTankParametersBuilder creates the entry for the tank object


Header file:

/*******************************************************************************
** Copyright (c) 2004 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: tankParametersBuilder.h,v $ $Revision: 1.5 $ $State: Exp $
*******************************************************************************/
#ifndef DtTankParametersBuilder_H_
#define DtTankParametersBuilder_H_
//class DtTankParametersBuilder:
//
//Instances of DtTankParametersBuilder are used to create and configure a
//DtVrfObjectParameters object for a tank. The parameters object returned
//should fully specify the necessary parameters to create a tank entity.
{
public:
//default constructor
//destructor
//Creates and configures parameters for a tank.
protected:
//Set up the bounding volume for the parameters entry. Configures a
//rectangular bounding volume, with an appropriate size for a tank.
//Create and configure resources for the entity. Configures entity
//with ammo and fuel.
//Set up the parameter's soil factors with values appropriate for a tank.
//Create and configure sensors, controllers, and actuators for the given
//movingObjectParameters object. Connects appropriate components to one another.
//Creates just a basic subset of all possible components a tank could be
//configured with.
//Creates and configures all of the sensor components and places them
//on the given descriptor list.
DtComponentDescriptorList& sensorDescriptors);
//Creates and configures all of the controller components and places them
//on the given descriptor list.
DtComponentDescriptorList& controllerDescriptors);
//Creates and configures all of the actuator components and places them
//on the given descriptor list.
DtComponentDescriptorList& actuatorDescriptors);
//Configures a DtTargetDetectionSensorDescriptor component.
DtSignatureObjectSensorDescriptor& targetDetectSensor);
//Configure local and remote subcomponent types for the given parameters object.
//Specifies the kinds of state repository, network interface, radio, etc. to
//create when an object is created using this the parameters object.
//copy constructor - not implemented
//assignment operator - not implemented
};
#endif

Implementation:

/*******************************************************************************
** Copyright (c) 2004 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: tankParametersBuilder.cxx,v $ $Revision: 1.19 $ $State: Exp $
*******************************************************************************/
#include <vlutil/vlPrint.h>
#include <vlpi/disEnums.h>
#include <vrfExtProtocol/objTypeEnums.h>
#include <matrix/3dBoundingVolume.h>
#include "vrfobjparam/targetSelectionControllerDesc.h"
#include <matrix/LibMatrix.h>
#include "vrfobjparam/pathMoveDesc.h"
{
}
{
}
{
//A tank is a kind of ground vehicle, so create a DtGroundVehicleParameters
//object for it.
"ground-vehicle-param");
parameters->init();
//Set the state repository user extention and type (required). For this example,
//just create the default (we're not extending the state repository in any
//special way).
DtVrfStateRepositoryUserExtension stateRepositoryUserExtension(0);
parameters->setStateRepositoryUserExtension(stateRepositoryUserExtension);
//See objTypeEnums.h for the complete set of extended object type used
//in VR-Forces.
DtRwObjectType objectType("object-type",
DtObjectTypeIndividual,
DtPlatform,
DtPlatformDomainLand,
-1,
DtTank,
1,
3,
-1);
parameters->setObjectType(objectType);
//Configure the rectangular bounding volume for the tank. Bounding volume
//is used in line of sight intersection tests.
//Configure the support points for the tank. These points will be
//used to place the tank on the terrain. Specify them in body coordinates
//of the tank.
parameters->setLeftSupport(DtVector(0.5, -1.0, 0.0));
parameters->setRightSupport(DtVector(0.5, 1.0, 0.0));
parameters->setOtherSupport(DtVector(-0.2, 0.0, 0.0));
parameters->setFormation(DtOtherAggregateFormation);
parameters->setForceType(DtForceOther);
parameters->setCategory("M1A2");
parameters->setEchelonLevel("");
parameters->setOrganized(true);
parameters->setMinTickPeriod(0.0);
parameters->setMinTickPeriodVariance(0.0);
parameters->setDeadReckoningAlgorithm(DtDrDrmRvw);
parameters->setUnderFireTime(120.0);
parameters->setUnderFireDistance(1000.0);
parameters->setMass(57145.0);
parameters->setEngagementRules("fire-at-will");
parameters->setCanPivot(true);
parameters->setMaxPivotSpeed(0.2);
parameters->setMaxSpeed(18.5);
parameters->setMaxReverseSpeed(11.0);
parameters->setTurningRadius(10.0);
parameters->setMaxSlope(0.94);
parameters->setOrderedSpeed(10.0);
parameters->setMaxAcceleration(1.27);
parameters->setMaxStoppingDeceleration(4.0);
parameters->setFuelEfficiency(243.8);
//Set up sensor, controller, and actuator components.
//Set up the soil factors (acceleration/deceleration factors as a
//function of soil type). This parameters entry is configured with
//a DtGroundAutoControllerComponent
configureSoilFactors(*parameters);
//Configure the parameters with resources (i.e. ammo and fuel).
//Configure local and remote subcomponent types for the given parameters object.
//Specifies the kinds of state repository, network interface, radio, etc. to
//create when an object is created using this the parameters object.
return parameters;
}
{
//Configure the entity's rectangular bounding volume.
//First three arguments are the extents:
// half length (along body x-axis)
// half width (along body y-axis)
// half height (along body z-axis)
//Next three are the offset from DIS/RPR location to center of bounding
//volume (in body coordinates)
Dt3dBoundingVolume boundingVolume(4.0, 1.8, 1.44, 0.0, 0.0, -1.44);
parameters.setBoundingVolume(boundingVolume);
}
DtVrfObjectParameters& parameters)
{
//Create the sensor, controller, and actuator descriptors.
sensorDescriptorList());
controllerDescriptorList());
actuatorDescriptorList());
//Specify how the components should be connected by creating and configuring
//a connection descriptor list. Connect component descriptors to one another
//by their names (specified in the component descriptors' constructors)
//and their port names.
DtConnectionDescriptorList connectionList("connections");
connectionList.addConnection("joystick:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("collision-avoidance:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("move-to:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("move-to-location:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("move-along:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("patrol-route:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("patrol-between:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("follow-entity:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("turn-to-heading:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("stop-moving:automotive-control",
"powertrain:automotive-control");
connectionList.addConnection("main-gun-control-joy:gun-control",
"main-gun-joy:gun-control");
connectionList.addConnection("target-selection:main-gun",
"turret-acquire:target-list");
connectionList.addConnection("turret-joystick:slew", "turret:slew");
connectionList.addConnection("turret-acquire:slew", "turret:slew");
connectionList.addConnection("turret-acquire:line-of-sight",
"main-gun-control-joy:line-of-sight");
connectionList.addConnection("turret-scan:slew", "turret:slew");
//Configure the parameters object with the connection list.
parameters.setConnectionDescriptorList(connectionList);
}
DtComponentDescriptorList& sensorDescriptors)
{
//For each component, be sure to give it a unique name in the constructor.
//Remember to call setComponentType(<component type string>) for each
//descriptor. <component type string> is the type of DtSimComponent to
//create (types are defined in compTypes.h).
DtUnderFireDeterminationComponentDescriptor underFireDeterminationDesc(
DtSymbolString("under-fire-determination-sensor"));
underFireDeterminationDesc.setComponentType("under-fire-determination-sensor");
DtSignatureObjectSensorDescriptor visualSensorDesc("visual-sensor");
sensorDescriptors.addComponentDescriptor(underFireDeterminationDesc);
sensorDescriptors.addComponentDescriptor(visualSensorDesc);
}
DtComponentDescriptorList& controllerDescriptors)
{
//For each component, be sure to give it a unique name in the constructor.
//Remember to call setComponentType(<component type string>) for each
//descriptor. <component type string> is the type of DtSimComponent to
//create (types are defined in compTypes.h).
DtComponentDescriptor organziationControllerDescriptor("org-controller");
organziationControllerDescriptor.setComponentType("organization-controller");
DtComponentDescriptor setDataControllerDescriptor("set-data");
setDataControllerDescriptor.setComponentType("local-entity-set-controller");
joystickControllerDescriptor("joystick");
joystickControllerDescriptor.setComponentType("ground-move-joystick-controller");
turretControllerDescriptor("turret-joystick");
turretControllerDescriptor.setComponentType("ground-turret-joystick-controller");
DtComponentDescriptor waitControllerDescriptor("wait-controller");
waitControllerDescriptor.setComponentType("wait-controller");
DtGroundCollisionAvoidanceDescriptor groundCollisionAvoidDesc("collision-avoidance");
groundCollisionAvoidDesc.setComponentType("ground-auto-collision-controller");
DtGroundMoveToDescriptor moveToControllerDescriptor("move-to");
moveToControllerDescriptor.setComponentType("ground-auto-move-to-controller");
DtGroundMoveToDescriptor moveToLocationControllerDescriptor("move-to-location");
moveToLocationControllerDescriptor.setComponentType("ground-auto-move-to-location-controller");
DtGroundMoveToDescriptor moveAlongControllerDescriptor("move-along");
moveAlongControllerDescriptor.setComponentType("ground-auto-move-along-controller");
DtGroundMoveToDescriptor patrolRouteControllerDescriptor("patrol-route");
patrolRouteControllerDescriptor.setComponentType("ground-auto-patrol-route-controller");
DtGroundMoveToDescriptor patrolBetweenControllerDescriptor("patrol-between");
patrolBetweenControllerDescriptor.setComponentType("ground-auto-patrol-between-controller");
DtGroundFollowEntityDescriptor followControllerDescriptor("follow-entity");
followControllerDescriptor.setComponentType("ground-auto-follow-entity-controller");
followControllerDescriptor.setApproachSpeed(2.0);
followControllerDescriptor.setAtDistance(2.0);
followControllerDescriptor.setFarCatchUpFactor(1.25);
followControllerDescriptor.setPassedSlowDownFactor(0.9);
DtGroundMoveToDescriptor turnToHeadingControllerDescriptor("turn-to-heading");
turnToHeadingControllerDescriptor.setComponentType("ground-auto-turn-to-heading-controller");
DtComponentDescriptor stopMovingControllerDescriptor("stop-moving");
stopMovingControllerDescriptor.setComponentType("ground-stop-moving-controller");
DtPathMovementControllerDescriptor pathMovementControllerDescriptor("path-movement");
pathMovementControllerDescriptor.setComponentType("path-movement-controller");
DtTurretAcquireControllerDescriptor turretAcquireControllerDescriptor(
"turret-acquire");
turretAcquireControllerDescriptor.setComponentType("turret-acquire-controller");
turretAcquireControllerDescriptor.setCheckLOS(true);
turretAcquireControllerDescriptor.setFireNowTimeout(10);
DtTurretScanComponentDescriptor turretScanControllerDescriptor(
"turret-scan");
turretScanControllerDescriptor.setComponentType("turret-scan-controller");
turretScanControllerDescriptor.setScanRate(0.3);
DtBallisticGunControllerDescriptor ballisticGunControllerDescriptor(
"main-gun-control-joy");
ballisticGunControllerDescriptor.setComponentType("ballistic-gun-controller");
ballisticGunControllerDescriptor.setLoadAmmoTime(2.0);
ballisticGunControllerDescriptor.setUnloadAmmoTime(2.0);
DtAmmoSelectTable ammoSelectTable;
DtAmmoSelectEntry ammoSelectEntry;
ammoSelectEntry.setTargetType(DtEntityType(1, 1, -1, -1, -1, -1, -1));
DtSimMunitionList munitionList("ammo");
DtSimMunition munition1("M830-HEAT-120mm");
munition1.setMunitionType(DtEntityType(2, 2, 225, 2, 13, 3, 0));
munition1.setWarhead(0);
DtSimMunition munition2("M829A1-AP-120mm");
munition2.setMunitionType(DtEntityType(2, 2, 225, 2, 13, 2, 0));
munition2.setWarhead(0);
munitionList.addSimMunition(munition2);
ammoSelectEntry.setSimMunitionList(munitionList);
ammoSelectTable.addAmmoSelectEntry(ammoSelectEntry);
ballisticGunControllerDescriptor.setAmmoSelectTable(ammoSelectTable);
DtTargetSelectionControllerDescriptor targetSelectionControllerDescriptor(
"target-selection");
targetSelectionControllerDescriptor.setComponentType(
"target-selection-controller");
DtTargetSelectionCriteria* mainGunCriteria =
new DtTargetSelectionCriteria("main-gun");
mainGunCriteria->setMaxTargets(1);
DtTargetPriorityEntry entry1("entity-priority");
DtEntityType trackedVehicles("1:1:-1:1:-1:-1:-1");
entry1.setEntityType(trackedVehicles);
entry1.setPriority(1);
mainGunCriteria->priorityList().addTargetPriorityEntry(entry1);
DtTargetPriorityEntry entry2("entity-priority");
DtEntityType allGroundVehicles("1:1:-1:-1:-1:-1:-1");
entry2.setEntityType(allGroundVehicles);
entry2.setPriority(2);
mainGunCriteria->priorityList().addTargetPriorityEntry(entry2);
targetSelectionControllerDescriptor.targetSelectionCriteriaList().
add(mainGunCriteria);
controllerDescriptors.addComponentDescriptor(organziationControllerDescriptor);
controllerDescriptors.addComponentDescriptor(setDataControllerDescriptor);
controllerDescriptors.addComponentDescriptor(joystickControllerDescriptor);
controllerDescriptors.addComponentDescriptor(turretControllerDescriptor);
controllerDescriptors.addComponentDescriptor(waitControllerDescriptor);
controllerDescriptors.addComponentDescriptor(groundCollisionAvoidDesc);
controllerDescriptors.addComponentDescriptor(moveToControllerDescriptor);
controllerDescriptors.addComponentDescriptor(moveToLocationControllerDescriptor);
controllerDescriptors.addComponentDescriptor(moveAlongControllerDescriptor);
controllerDescriptors.addComponentDescriptor(patrolRouteControllerDescriptor);
controllerDescriptors.addComponentDescriptor(patrolBetweenControllerDescriptor);
controllerDescriptors.addComponentDescriptor(followControllerDescriptor);
controllerDescriptors.addComponentDescriptor(turnToHeadingControllerDescriptor);
controllerDescriptors.addComponentDescriptor(stopMovingControllerDescriptor);
controllerDescriptors.addComponentDescriptor(pathMovementControllerDescriptor);
controllerDescriptors.addComponentDescriptor(turretAcquireControllerDescriptor);
controllerDescriptors.addComponentDescriptor(turretScanControllerDescriptor);
controllerDescriptors.addComponentDescriptor(ballisticGunControllerDescriptor);
controllerDescriptors.addComponentDescriptor(targetSelectionControllerDescriptor);
}
DtComponentDescriptorList& actuatorDescriptors)
{
//For each component, be sure to give it a unique name in the constructor.
//Remember to call setComponentType(<component type string>) for each
//descriptor. <component type string> is the type of DtSimComponent to
//create (types are defined in compTypes.h).
DtAutomotiveActuatorDescriptor autoActuatorDescriptor("powertrain");
autoActuatorDescriptor.setComponentType("automotive-actuator");
DtTurretComponentDescriptor turretAcutatorDescriptor("turret");
turretAcutatorDescriptor.setComponentType("turret-actuator");
DtSimArtPartDescriptorList artPartDescriptorList("art-part-list");
DtSimArtPartDescriptor artPartDescriptor("primary-turret");
artPartDescriptor.setPartType(DtPrimaryTurret1); //disEnums.h
artPartDescriptor.setParentPartType(DtEntityBase);
artPartDescriptor.setAttachPoint(DtVector(0.2, 0.0, -2.0));
paramList.addArtPartParam("part-type", DtApAzimuth);
paramList.addArtPartParam("part-type", DtApAzimuthRate);
artPartDescriptor.setParamList(paramList);
artPartDescriptorList.addArtPartDescriptor(artPartDescriptor);
turretAcutatorDescriptor.setArtPartDescriptorList(artPartDescriptorList);
DtBallisticGunDescriptor ballisticGunActuatorDescriptor("main-gun-joy");
ballisticGunActuatorDescriptor.setComponentType("ballistic-gun-joystick-actuator");
DtSimArtPartDescriptorList artPartDescriptorList1("art-part-list");
DtSimArtPartDescriptor artPartDescriptor1("primary-gun");
artPartDescriptor1.setPartType(DtPrimaryGun1); //disEnums.h
artPartDescriptor1.setParentPartType(DtPrimaryTurret1);
artPartDescriptor1.setAttachPoint(DtVector(2.331, -0.125, 0.418));
paramList1.addArtPartParam("part-type", DtApElevation);
paramList1.addArtPartParam("part-type", DtApElevationRate);
artPartDescriptor1.setParamList(paramList1);
artPartDescriptorList1.addArtPartDescriptor(artPartDescriptor1);
ballisticGunActuatorDescriptor.setArtPartDescriptorList(artPartDescriptorList1);
ballisticGunActuatorDescriptor.setElevationRate(0.3);
ballisticGunActuatorDescriptor.setMaxElevationRange(50.0);
ballisticGunActuatorDescriptor.setMuzzleSpeed(1000.0);
ballisticGunActuatorDescriptor.setMuzzleOffset(DtVector(6.0, 0.0, 0.0));
DtRangeProbabilityTable hitProbabilityTable("hit-probability-table");
DtDetectionPrbRangeLookupEntry rangeEntry("entity-range");
rangeEntry.setEntityType(DtEntityType(1, 1, -1, -1, -1, -1, -1));
DtPrbRangeTableEntry rangeTableEntry1;
rangeTableEntry1.addProbability("probablity", 0.9);
rangeTableEntry1.setRange(1000.0);
rangeEntry.addTableEntry(rangeTableEntry1);
DtPrbRangeTableEntry rangeTableEntry2;
rangeTableEntry2.addProbability("probablity", 0.8);
rangeTableEntry2.setRange(2000.0);
rangeEntry.addTableEntry(rangeTableEntry2);
DtPrbRangeTableEntry rangeTableEntry3;
rangeTableEntry3.addProbability("probablity", 0.75);
rangeTableEntry3.setRange(3000.0);
rangeEntry.addTableEntry(rangeTableEntry3);
DtPrbRangeTableEntry rangeTableEntry4;
rangeTableEntry4.addProbability("probablity", 0.7);
rangeTableEntry4.setRange(4000.0);
rangeEntry.addTableEntry(rangeTableEntry4);
hitProbabilityTable.addDetectionProbabilityEntry(rangeEntry);
ballisticGunActuatorDescriptor.setHitProbabilityTable(hitProbabilityTable);
DtDamageAdjudicationComponentDescriptor damageActuatorDescriptor(DtSymbolString("damage-component"));
damageActuatorDescriptor.setComponentType("damage-adjudication-actuator");
damageActuatorDescriptor.setSmokeTime(1200.0);
damageActuatorDescriptor.setFlameTime(600.0);
DtDmgMunitionTable* model = new DtDmgMunitionTable("damage-model");
DtDmgMunitionEntry munitionEntry;
DtSimMunition munition;
munition.setMunitionType(DtEntityType(2, 2, 225, 2, 13, -1, -1));
munition.setWarhead(-1);
munitionEntry.setMunition(munition);
DtDmgSurfaceEntry surfaceEntry;
angleTable.setAngleOfIncidence(0.5236);
double coefficientValues[] = {-5.0E-008, 0.0, 1.0};
coefficients.setCoefficients(3, coefficientValues);
angleTable.addProbabilityCoefficients(coefficients);
surfaceEntry.addAngleOfIncidenceTable(angleTable);
angleTable.setAngleOfIncidence(1.0472);
angleTable.addProbabilityCoefficients(coefficients);
surfaceEntry.addAngleOfIncidenceTable(angleTable);
angleTable.setAngleOfIncidence(1.5708);
angleTable.addProbabilityCoefficients(coefficients);
surfaceEntry.addAngleOfIncidenceTable(angleTable);
munitionEntry.addSurfaceEntry(surfaceEntry);
model->addMunitionEntry(munitionEntry);
damageActuatorDescriptor.setDamageModel(model);
actuatorDescriptors.addComponentDescriptor(autoActuatorDescriptor);
actuatorDescriptors.addComponentDescriptor(turretAcutatorDescriptor);
actuatorDescriptors.addComponentDescriptor(ballisticGunActuatorDescriptor);
actuatorDescriptors.addComponentDescriptor(damageActuatorDescriptor);
}
{
signatureSensor.setComponentType("signature-sensor");
signatureSensor.setSensorDomain("visual");
//sensor geometry
rangeFilter.setRange(4000.0);
signatureSensor.sensorGeometry()->setSpatialFilter(rangeFilter);
signatureSensor.setMinTickPeriod(2.0);
signatureSensor.setMinTickPeriodVariance(0.1);
signatureSensor.setSensorOffset(DtVector(-1.14, 0.57, -2.9));
DtRwDetectionLevelContainer detectionLevelDeterminatorParmeters("detection-level-determinator");
detectionLevelDeterminatorParmeters.setDetectLevelDeterminatorType(DtSignatureDetectLevelDeterminatorType);
detectionLevelDeterminatorParmeters.setDetectionLevelForForce(LEVEL_IDENTIFIED);
DtCombatIdentificationLevelTable table("Combat-Identification-Level-Table");
entryA.setAppSignature(1.0);
detectionIntervalA1.setDetectionInterval(0.0);
detectionIntervalA1.setIdentificationLevel(1);
entryA.addDetectionInterval(&detectionIntervalA1);
detectionIntervalA2.setDetectionInterval(5.0);
detectionIntervalA2.setIdentificationLevel(2);
entryA.addDetectionInterval(&detectionIntervalA2);
detectionIntervalA3.setDetectionInterval(10.0);
detectionIntervalA3.setIdentificationLevel(3);
entryA.addDetectionInterval(&detectionIntervalA3);
table.addTableEntry(&entryA);
entryB.setAppSignature(3.0);
detectionIntervalB1.setDetectionInterval(0.0);
detectionIntervalB1.setIdentificationLevel(2);
entryB.addDetectionInterval(&detectionIntervalB1);
detectionIntervalB2.setDetectionInterval(2.0);
detectionIntervalB2.setIdentificationLevel(3);
entryB.addDetectionInterval(&detectionIntervalB2);
detectionIntervalB3.setDetectionInterval(5.0);
detectionIntervalB3.setIdentificationLevel(4);
entryB.addDetectionInterval(&detectionIntervalB3);
table.addTableEntry(&entryB);
detectionLevelDeterminatorParmeters.setSensorCombatIdentificationTable(table);
signatureSensor.setSensorDetectLevelDeterminatorParameters(detectionLevelDeterminatorParmeters);
}
DtVrfObjectParameters& parameters)
{
local->setSimStateRepositoryType("ground-entity-state-repository");
local->setNetworkInterfaceType("individual-local-entity-net-interface");
local->setComponentManagerType("component-manager");
local->setTaskManagerType("local-task-manager");
remote->setSimStateRepositoryType("vrf-moving-object-state-repository");
remote->setNetworkInterfaceType("vrf-individual-remote-entity-net-interface");
remote->setTaskManagerType("");
}
DtVrfObjectParameters& parameters)
{
//Create resources, add them to a resource manager, and configure
//the parameters object with this resource manager.
//Create some various kinds of munition resources.
DtIntegerResource* m829A1Resource = new DtIntegerResource("M829A1-AP-120mm");
m829A1Resource->setFullAmount(20);
m829A1Resource->setAmount(20);
DtIntegerResource* m830Resource = new DtIntegerResource("M830-HEAT-120mm");
m830Resource->setFullAmount(20);
m830Resource->setAmount(20);
DtIntegerResource* m16A2Resource = new DtIntegerResource("M16A2-556mm");
m16A2Resource->setFullAmount(20);
m16A2Resource->setAmount(20);
//Configure them as children of a parent "ammo" resource.
DtIntegerResource* ammoResource = new DtIntegerResource("ammo");
ammoResource->addChildResource(m829A1Resource);
ammoResource->addChildResource(m830Resource);
ammoResource->addChildResource(m16A2Resource);
//Create a fuel resource (the automotive actuator will check for
//a resource of type "fuel", and model its consumption, if present.
DtRealResource* fuelResource = new DtRealResource("fuel");
fuelResource->setFullAmount(1907.0);
fuelResource->setAmount(1907.0);
//Add the "fuel" and composite "ammo" resources to the resource
//manager and set it in the parameters object.
DtSimResourceManager resourceManager("resources");
resourceManager.addResource(ammoResource);
resourceManager.addResource(fuelResource);
parameters.setResourceManager(resourceManager);
}
{
//Set up table of soil factors. Each DtSoilFactors constructor is of the form:
//<string soil type>, NULL, <acceleration factor>, <stopping factor>, <max speed factor>
//See the VR-Forces Configuration Guide for details on these parameters.
parameters.addSoilFactors(new DtSoilFactors("paved-road", NULL, 1.0, 1.0, 1.0));
parameters.addSoilFactors(new DtSoilFactors("hard-packed", NULL, 0.72, 0.72, 0.72));
parameters.addSoilFactors(new DtSoilFactors("gravel", NULL, 0.6, 0.6, 0.6));
parameters.addSoilFactors(new DtSoilFactors("rocks", NULL, 0.4, 0.4, 0.4));
parameters.addSoilFactors(new DtSoilFactors("sand", NULL, 0.4, 0.4, 0.4));
parameters.addSoilFactors(new DtSoilFactors("shallow-water", NULL, 0.6, 0.6, 0.6));
parameters.addSoilFactors(new DtSoilFactors("deep-water", NULL, 0.0, 0.0, 0.0));
parameters.addSoilFactors(new DtSoilFactors("muck", NULL, 0.3, 0.3, 0.3));
}

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)