This example creates an aircraft carrier and an embarked helicopter.
It demonstrates creation of an embarked entity. This example works in DIS and HLA using Version 2.0017 of the RPR FOM and later. Embarkation is not supported in earlier versions of the RPR FOM.
Creating an Embarked Entity
In this example we create an aircraft carrier located in the Indian Ocean on the Makland Terrain Database. We also create a helicoper and embark it on the deck of the carrier.
How to Run the Example
To exit, press the 'q' key. This example works with the MAK Stealth and the VR-Forces products.
Sample Data
Embark Example Code
int main( int argc, char* argv[] )
{
try
{
#if DtDIS
appInit.setDisVersionToSend( 7 );
#else
#endif
appInit.parseCmdLine();
#ifdef DtHLA
"Carrier"
#else
#endif
);
carrierPub.entityStateRep()->setEntityId("3:2:1");
carrierPub.entityStateRep()->setMarkingText("Carrier");
#ifdef DtHLA
"Helicopter"
#else
#endif
);
helPub.entityStateRep()->setEntityId("3:2:2");
helPub.entityStateRep()->setMarkingText("Helicopter");
htv.setLocation(
DtVector(0.0,0.0,-33.0));
helPub.entityStateRep()->setHostGlobalId(carrierPub.globalId());
helPub.entityStateRep()->setRelativeAlgorithm(
DtDrStatic);
helPub.entityStateRep()->setRelativeLocation(
DtVector(0,0,-33.0));
{
carrierPub.tick();
helPub.tick();
simTime += dt;
}
}
return 0;
}