locked
user aircraft simulation variable calculations? RRS feed

  • Question

  • We are using the user aircraft as a camera view by modifying the Cessna model to be invisible.  This seems to work fine, except that I am now trying to get the altitude AGL for this object and find that "PLANE ALT ABOVE GROUND" always returns MSL altitude and "GROUND ALTITUDE" always returns 0.  (When the normal Cessna model is used, the variables return their proper values but we don't want to see the cockpit.)  It would be nice to have the same features work regardless of the user object's visibility -- any workaround for this?

    Thanks,
    Jerry 
    Wednesday, July 23, 2008 10:18 PM

Answers

  • Why don't you use this (standard?) definition to control the movement and get the position of your "camera" (hey it looks like we all have the same problem at the beginning ;))


    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE LATITUDE", "Degrees");  
    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE ALTITUDE", "Feet");  
    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE LONGITUDE", "Degrees"); 
    • Proposed as answer by Todd Landstad Friday, July 25, 2008 10:45 PM
    • Marked as answer by Todd Landstad Thursday, October 9, 2008 10:29 PM
    Thursday, July 24, 2008 12:08 PM

All replies

  • Why don't you use this (standard?) definition to control the movement and get the position of your "camera" (hey it looks like we all have the same problem at the beginning ;))


    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE LATITUDE", "Degrees");  
    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE ALTITUDE", "Feet");  
    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE LONGITUDE", "Degrees"); 
    • Proposed as answer by Todd Landstad Friday, July 25, 2008 10:45 PM
    • Marked as answer by Todd Landstad Thursday, October 9, 2008 10:29 PM
    Thursday, July 24, 2008 12:08 PM
  • Alex Genoud LK said:

    Why don't you use this (standard?) definition to control the movement and get the position of your "camera" (hey it looks like we all have the same problem at the beginning ;))


    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE LATITUDE", "Degrees");  
    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE ALTITUDE", "Feet");  
    hr = SimConnect_AddToDataDefinition(m_hSimConnect, DEFINITION_SIMOBJECT_POSITION, "PLANE LONGITUDE", "Degrees"); 

    I think you missed the point.  Try changing your definition to use "PLANE ALT ABOVE GROUND" instead of regular MSL altitude, and if you're using an invisible or "Viewer" user aircraft you'll find that it does not, in fact, return the altitude above ground.  It will return the MSL altitude and ground altitudes of zero (if you add ground altitude to the data definition).  However, the exact same data definition, when used with a standard user aircraft sim, will return the actual ground altitudes and altitudes above ground as requested.

    Friday, July 25, 2008 11:11 PM