1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Markerstate

Discussion in 'SimConnect' started by lc0277, 27/1/07.

  1. lc0277

    lc0277

    Joined:
    25/9/06
    Messages:
    156
    Country:
    france
    It took me some time to figure out what are marker states and how they works since the documentation isn't very explicit on that. The simulation variables "Marker State" is missing in the SDK, but is needed to build appropriate data definitions.

    So how it works:

    Code:
    SimConnect_AddToDataDefinition(hSimConnect, DATA_ID, "Marker State", NULL, SIMCONNECT_DATATYPE_MARKERSTATE);
    SIMCONNECT_DATA_MARKERSTATE ms;
    strncpy(ms.szMarkerName, "Wheel", 64);
    ms.dwMarkerState = 1;
    SimConnect_SetDataOnSimObject(hSimConnect, DATA_ID, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_DATA_SET_FLAG_DEFAULT, 1, sizeof(SIMCONNECT_DATA_MARKERSTATE), &ms);
    
    And the result:
    [​IMG]

    Various model elements are available (wheel, center of gravity, wing tips, engines, etc)
  2. ziporama

    ziporama

    Joined:
    28/9/06
    Messages:
    203
    Country:
    unitedstates
    Very nice investigative work!

    Probably the same method used to draw the boxes around objects.
  3. rhysa

    rhysa

    Joined:
    23/3/05
    Messages:
    42
    Country:
    australia
    I wrote an article on this in the wiki some time ago. I've listed my observations on the limitations of the feature in the article, maybe you could add any you noticed.
  4. lc0277

    lc0277

    Joined:
    25/9/06
    Messages:
    156
    Country:
    france
    Thanks rhysa ! I didn't notice your article. That would have saved me some brainstorming. :eek:
  5. rhysa

    rhysa

    Joined:
    23/3/05
    Messages:
    42
    Country:
    australia
    Its a very useful feature for developers. I have written an addon dll that adds a simple menu interface for the marker state functionality.

Share This Page