A simple talk program which uses DDM.
This program only works in HLA and is closely related to the Talk example.
int keybrdTick()
{
if (keyPtr && (*keyPtr == 'q' || *keyPtr == 'Q'))
return -1;
else
return 0;
}
int main(int argc, char* argv[])
{
appInit.setExecName("VR-LinkDDM");
#if !DtHLA_1516
appInit.setFedFileName("VR-LinkDDM.fed");
#else
#if DtHLA_1516_EVOLVED
appInit.setFedFileName("VR-LinkDDM_evolved.xml");
#else
appInit.setFedFileName("VR-LinkDDM.xml");
#endif
#endif
appInit.parseCmdLine();
exConn.setUseGeographicDdm(true);
"F18 Entity");
try
{
}
#ifdef DtHLA_1516_EVOLVED
catch( rti1516e::Exception& )
#elif defined DtHLA_1516
catch( rti1516::Exception& )
#elif defined DtHLA
catch( RTI::Exception& )
#endif
{
DtInfo <<
"Exception Caught: Make sure that DDM is enabled.\n";
emitterSys = NULL;
return 0;
}
double refLongitude =
DtDeg2Rad(-121.326577);
DtTopoView topoView(esr, refLatitude, refLongitude);
while (1)
{
if (keybrdTick() == -1)
break;
exConn.drainInput();
topoView.setLocation(position);
topoView.setVelocity(velocity);
entityPub.tick();
position[0] += velocity[0] * dt;
simTime += dt;
}
return 0;
}