Stellen Sie eine FrageStellen Sie eine Frage
 

BeantwortetExternal flight model

  • Samstag, 6. Juni 2009 21:19mamucz TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    Hi,
    I wont use ESP only for graphics rendering and i have external flight model. In input to ESP i have only  alt,lat,lon,Pitch,Bank and Heading. What is best way do it please? I try it via SIMCONNECT_DATA_INITPOSITION but it invite progress dialog.

    THX

Antworten

Alle Antworten

  • Sonntag, 7. Juni 2009 18:10Tim Gregson [MSFT] TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Vorgeschlagene Antwort
    You need to define your own data struct with the variables you need to set, and then use that data struct to set the position and orientation.  Using the INITPOSITION structure, as you've found out, causes the sim to do a partial reset (reloading terrain, AI aircraft, etc) and is designed specifically to set the Initial Position for an object.

    Tim
    http://beatlesblog.spaces.live.com/
  • Montag, 8. Juni 2009 07:17mamucz TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    Define my own data structure is not problem, but how set it? Please can you give me some example?


    THX

    Petr
  • Mittwoch, 17. Juni 2009 18:16Jon Hart ______________ TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Enthält Code
    First, set up your structure definition in ESP:

    		hr = SimConnect_AddToDataDefinition(_hSimConnect,DEFINITION, "Plane Altitude", "feet",					SIMCONNECT_DATATYPE_FLOAT64, 0.0f, SIMCONNECT_UNUSED);
    		hr = SimConnect_AddToDataDefinition(_hSimConnect,DEFINITION, "Plane Latitude", "degrees",				SIMCONNECT_DATATYPE_FLOAT64, 0.0f, SIMCONNECT_UNUSED);
    		hr = SimConnect_AddToDataDefinition(_hSimConnect,DEFINITION, "Plane Longitude","degrees",				SIMCONNECT_DATATYPE_FLOAT64, 0.0f, SIMCONNECT_UNUSED);
    		hr = SimConnect_AddToDataDefinition(_hSimConnect,DEFINITION, "Plane Heading Degrees True",	"degrees",	SIMCONNECT_DATATYPE_FLOAT64, 0.0f, SIMCONNECT_UNUSED);
    		hr = SimConnect_AddToDataDefinition(_hSimConnect,DEFINITION, "Plane Pitch Degrees",			"degrees",	SIMCONNECT_DATATYPE_FLOAT64, 0.0f, SIMCONNECT_UNUSED);
    		hr = SimConnect_AddToDataDefinition(_hSimConnect,DEFINITION, "Plane Bank Degrees",			"degrees",	SIMCONNECT_DATATYPE_FLOAT64, 0.0f, SIMCONNECT_UNUSED);
    	
    .and have a struct for it:

    struct PLANE_XYZ_HPR
    	{
    		double altitude;
    		double latitude;
    		double longitude;
    		double heading;
    		double pitch;
    		double roll;
    
    	} _PlanePos;
    populate the above, then call

    	res = SimConnect_SetDataOnSimObject(_hSimConnect,DEFINITION, SIMCONNECT_OBJECT_ID_USER, 0, 0, sizeof(_PlanePos),&_PlanePos );
    
    to set the data.

    I have more code if you want to PM me.






    Regards, Jon
  • Donnerstag, 9. Juli 2009 12:02mamucz TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet
    Thank you it is what I need!!!
    • Als Antwort markiertmamucz Donnerstag, 9. Juli 2009 12:02
    •