MC02 is an complex DDM extension to RPR which creates all sorts of regions for different types of entities.
This is a talk program which uses a subset of the MC02 DDM standard to publish entities in a DDM area related to their force type instead of their geographic location, like the DDMTalk example. This program only works in HLA and is closely related to the Talk example.
int main( int argc, char* argv[] )
{
appInit.setExecName("VR-LinkMC02");
appInit.setFedFileName("VR-LinkMC02.fed");
appInit.setUseAdvisories(false);
appInit.parseCmdLine();
try
{
DtBoost::shared_ptr<DtBlueAirRegion> baRegion(
new DtBlueAirRegion(&exConn));
blueRegion = baRegion;
baRegion->notifyRtiOfUpdate();
blueRegSet.insert(baRegion);
DtBoost::shared_ptr<DtRedAirRegion> raRegion(
new DtRedAirRegion(&exConn));
redRegion = raRegion;
raRegion->notifyRtiOfUpdate();
redRegSet.insert(raRegion);
}
{
DtWarn <<
"Caught exception: " << regionException << std::endl;
}
double refLongitude =
DtDeg2Rad(-121.326577);
DtTopoView blueTopoView(blueEsr, refLatitude, refLongitude);
DtTopoView redTopoView(redEsr, refLatitude, refLongitude);
while (simTime <= 10.0)
{
blueTopoView.setLocation(bluePosition);
redTopoView.setLocation(redPosition);
blueTopoView.setVelocity(velocity);
redTopoView.setVelocity(velocity);
bluePosition[0] += velocity[0] * dt;
redPosition[0] += velocity[0] * dt;
simTime += dt;
}
return 0;
}