@@ -23,6 +23,13 @@ int main()
|
||||
// Open Socket
|
||||
const char* IP = "127.0.0.1"; //IP Address of computer running X-Plane
|
||||
XPCSocket sock = openUDP(IP);
|
||||
float tVal[1];
|
||||
int tSize;
|
||||
if (getDREF(sock, "sim/test/test_float", tVal, &tSize) < 0)
|
||||
{
|
||||
printf("Error establishing connecting. Unable to read data from X-Plane.");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Set Location/Orientation (sendPOSI)
|
||||
// Set Up Position Array
|
||||
|
||||
@@ -21,8 +21,8 @@ public class Main
|
||||
System.out.println("Setting up simulation...");
|
||||
try(XPlaneConnect xpc = new XPlaneConnect())
|
||||
{
|
||||
System.out.println("Setting inbound port");
|
||||
xpc.setCONN(49055);
|
||||
// Ensure connection established.
|
||||
xpc.getDREF("sim/test/test_float");
|
||||
|
||||
System.out.println("Setting player aircraft position");
|
||||
float[] posi = new float[] {37.524F, -122.06899F, 2500, 0, 0, 0, 1};
|
||||
|
||||
@@ -11,6 +11,10 @@ import XPlaneConnect.*
|
||||
disp('xplaneconnect Example Script-');
|
||||
disp('Setting up Simulation');
|
||||
Socket = openUDP(49005);
|
||||
|
||||
%% Ensure connected
|
||||
getDREFs('sim/test/test_float')
|
||||
|
||||
%% Set position of the player aircraft
|
||||
disp('Setting position');
|
||||
pauseSim(1);
|
||||
|
||||
Reference in New Issue
Block a user