Marker States
Using Marker States
The SimConnect interface includes a function that, when activated, displays cross hairs at defined points on the visual model. These points correspond to points defined in the models aircraft.cfg and *.air file, such as wheels, contact points, fuel tank locations, CoG etc. This is useful for designers to be able to see where exactly on the model these points have been placed.
The documentation in the SDK is limited and lacks some important detail. This article will assist in using this function. Detail included in the SDK has been omitted (look up the SIMCONNECT_DATA_MARKERSTATE entry in the SDK).
Sample Code
The first thing to add is a definition.
static enum DEFINITION_ID {
DEFINITION_MARKER
};
When you want to turn on the markers (such as after a button press) add the following code, this will send the request to FS.
SIMCONNECT_DATA_MARKERSTATE sdm;
//Set the markers to ON (use 0 for off)
sdm.dwMarkerState = 1;
//Copy the marker name to the struct
//List of available markers can be found in the SDK
strcpy_s (sdm.szMarkerName, "Scrape");
//Send the request to FS
hr = SimConnect_SetDataOnSimObject(hSimConnect, DEFINITION_MARKER, SIMCONNECT_OBJECT_ID_USER, 0, 1, sizeof(sdm), &sdm);
Finally in the callback function use the AddToDataDefinition function to add the marker state.
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_MARKER, "Marker State", "number", SIMCONNECT_DATATYPE_MARKERSTATE);
Observations
Limited testing has shown that only one marker type can be sent to FS at a time (ie no arrays). Also only the users aircraft could be targeted.
Tools
A selection of tools utilising "marker states" -
- Configuring Aircraft - Launch-bar/Tail Hook positions - Lamont Clarke's wiki - Adapting FSX aircrafts to acceleration carriers