![]() |
VR-Link C# API Documentation
|
DIS 7 lets you set the heartbeat of an object based on its entity type, class type, or whether or not it is moving.
To set the heartbeat for non-moving entities, call setStationaryDfltTimeThreshold() anywhere in your software. For example, to set the heartbeat to 20 seconds, do this:
To set the heartbeat by entity type, use setEntityTypeDfltTimeThreshold(). For example, to have all air units heartbeat once every second and humans heartbeat every 2 seconds, do this:
To set the heartbeat value by class type, use setClassDfltTimeThreshold(). For example, to tick all IFF objects every 10 seconds and entities every 5:
You can still set a single heartbeat value for every DIS object. By default, this is set to 5 seconds.
You can set multiple heartbeat values to make sure that important units get updated more frequently than less important units. If you wrote all six lines above, you would get stationary entities heartbeating every 20 seconds, moving air units and lifeforms heartbeating at 1 second, and all other moving entities heartbeating at 5 seconds. Non-entities will heartbeat every 8 seconds unless they are IFF objects, which heartbeat every 10 seconds.
You still need to call DtExerciseConnection.tick() to actually send the data over the network. At the very least, you should be ticking at the rate of the smallest heartbeat threshold.