sendPOSI command change (double for lat/lon/h) (#111)
* Updated POSI to use doubles for lat/lon/alt, as step size for floats was unacceptably large at high longitudes.
This commit is contained in:
committed by
Jason Watkins
parent
48656f2b4c
commit
0e493920fa
@@ -25,11 +25,11 @@ public class Main
|
||||
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};
|
||||
double[] posi = new double[] {37.524, -122.06899, 2500, 0, 0, 0, 1};
|
||||
xpc.sendPOSI(posi);
|
||||
|
||||
System.out.println("Setting another aircraft position");
|
||||
posi[0] = 37.52465F;
|
||||
posi[0] = 37.52465;
|
||||
posi[4] = 20;
|
||||
xpc.sendPOSI(posi, 1);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class Main
|
||||
int aircraft = 0;
|
||||
while(true)
|
||||
{
|
||||
float[] posi = xpc.getPOSI(aircraft);
|
||||
float[] posi = xpc.getPOSI(aircraft); // FIXME: change this to 64-bit double
|
||||
float[] ctrl = xpc.getCTRL(aircraft);
|
||||
|
||||
System.out.format("Loc: (%4f, %4f, %4f) Aileron:%2f Elevator:%2f Rudder:%2f\n",
|
||||
|
||||
@@ -99,7 +99,7 @@ public class Main
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
float[] posi = xpc.getPOSI(0);
|
||||
float[] posi = xpc.getPOSI(0); // FIXME: change this to 64-bit double
|
||||
writer.write(String.format("%1$f, %2$f, %3$f, %4$f, %5$f, %6$f, %7$f\n",
|
||||
posi[0], posi[1], posi[2], posi[3], posi[4], posi[5], posi[6]));
|
||||
try
|
||||
@@ -125,11 +125,11 @@ public class Main
|
||||
{
|
||||
while(reader.hasNextLine())
|
||||
{
|
||||
float[] posi = new float[7];
|
||||
double[] posi = new double[7];
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
String s = reader.next();
|
||||
posi[i] = Float.parseFloat(s);
|
||||
posi[i] = Double.parseDouble(s);
|
||||
}
|
||||
reader.nextLine();
|
||||
xpc.sendPOSI(posi);
|
||||
|
||||
Reference in New Issue
Block a user