Getting User Position
Posted: Thu Oct 17, 2019 11:15 am
Hey,
after upgrading V4 as well as the SDK to HF2 I have a problem in my software when trying to get the current User Position, the code was running in HF1:
Struct is looking like this:
problem is now that the structure has not the correct values. For example my current Position in the Sim is:
Lon -122, Lat 47, Alt 24
the return struct has: Lon 47, Lat 0, Alt -122
i have used the codeparts above for collecting AI Traffic as well, using the SIMCONNECT_SIMOBJECT_TYPE.AIRCRAFT I get the correct values for the user aircraft, any ideas?
after upgrading V4 as well as the SDK to HF2 I have a problem in my software when trying to get the current User Position, the code was running in HF1:
Code: Select all
this.SimConnect.AddToDataDefinition(DataIdentifier.RecieveUserPositionQuery,
"PLANE LATITUDE", // Simulation Variable
"degrees", // Units - for strings put 'null'
SIMCONNECT_DATATYPE.FLOAT64, // Data type
0.0f,
SimConnect.SIMCONNECT_UNUSED);
this.SimConnect.AddToDataDefinition(DataIdentifier.RecieveUserPositionQuery,
"PLANE LONGITUDE", // Simulation Variable
"degrees", // Units - for strings put 'null'
SIMCONNECT_DATATYPE.FLOAT64, // Data type
0.0f,
SimConnect.SIMCONNECT_UNUSED);
this.SimConnect.AddToDataDefinition(DataIdentifier.RecieveUserPositionQuery,
"PLANE ALTITUDE", // Simulation Variable
"Feet", // Units - for strings put 'null'
SIMCONNECT_DATATYPE.FLOAT64, // Data type
0.0f,
SimConnect.SIMCONNECT_UNUSED);
Code: Select all
public struct Position
{
public double latitude;
public double longitude;
public double altitude;
}
Lon -122, Lat 47, Alt 24
the return struct has: Lon 47, Lat 0, Alt -122
i have used the codeparts above for collecting AI Traffic as well, using the SIMCONNECT_SIMOBJECT_TYPE.AIRCRAFT I get the correct values for the user aircraft, any ideas?