Skip to content

Commit e6977df

Browse files
author
Alex Marko
committed
0.11.0
* towplane/ghost rotation SU6 issue fixed * winch/tow rope simulation improved, rotation forces depends on selected connection point * towplane track replay quality greatly decreased because of SimConenct bug introduced in SimUpdate6 * taxi light does not toggle during towing to avoid conflict with FLARM * hotspot lift simulation improved, added possibility to use external XML script for lift creation; hotspot * strength no longer adjusting for low game FPS/simrate, ensure you have at least 30 frames per second for the best effectiveness
1 parent adc34f9 commit e6977df

File tree

9 files changed

+303
-141
lines changed

9 files changed

+303
-141
lines changed

MSFS Kinetic Assistant/MainWindow.xaml.cs

+249-124
Large diffs are not rendered by default.

MSFS Kinetic Assistant/PlaneInfoResponse.cs

+21-4
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@ public struct PlaneInfoResponse
1616
public double PlaneBank;
1717
public double GpsGroundSpeed;
1818
public double AirspeedIndicated;
19+
public double AirspeedTrue;
1920
public double VerticalSpeed;
2021
public double AmbientWindY;
2122
public double VelocityBodyX;
2223
public double VelocityBodyY;
2324
public double VelocityBodyZ;
25+
public double AccelerationBodyY;
26+
public double AccelerationBodyZ;
2427
public double RotationVelocityBodyX;
2528
public double RotationVelocityBodyY;
2629
public double RotationVelocityBodyZ;
2730
public double RotationAccelerationBodyX;
2831
public double RotationAccelerationBodyY;
2932
public double RotationAccelerationBodyZ;
33+
public double FoldingWindR;
3034
};
3135

3236
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
@@ -38,7 +42,7 @@ public struct PlaneInfoCommit
3842
};
3943

4044
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
41-
public struct PlaneInfoRotate
45+
public struct PlaneInfoRotateVelocity
4246
{
4347
public double RotationVelocityBodyX;
4448
public double RotationVelocityBodyY;
@@ -97,6 +101,16 @@ public struct PlaneInfoLift
97101
public double Altitude;
98102
};
99103

104+
public struct ThermalVelocity
105+
{
106+
public double VelocityBodyY;
107+
public double VelocityBodyZ;
108+
public double RotationAccelerationBodyX;
109+
//public double FoldingWindR;
110+
111+
};
112+
113+
100114
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
101115
public struct NearbyInfoResponse
102116
{
@@ -149,9 +163,12 @@ public struct GhostCommit
149163
public double VelocityBodyX;
150164
public double VelocityBodyY;
151165
public double VelocityBodyZ;
152-
public double RotationVelocityBodyX;
153-
public double RotationVelocityBodyY;
154-
public double RotationVelocityBodyZ;
166+
//public double RotationVelocityBodyX;
167+
//public double RotationVelocityBodyY;
168+
//public double RotationVelocityBodyZ;
169+
public double planeHeading;
170+
public double planePitch;
171+
public double planeRoll;
155172

156173
};
157174

MSFS Kinetic Assistant/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("0.10.3.0")]
55-
[assembly: AssemblyFileVersion("0.10.3.0")]
54+
[assembly: AssemblyVersion("0.11.0.0")]
55+
[assembly: AssemblyFileVersion("0.11.0.0")]

MSFS Kinetic Assistant/RadarClass.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public void insertRadarThermals(Canvas RadarCanvas, List<winchPosition> thermals
373373

374374
Label label = new Label();
375375
label.Name = "Label_" + lbl + "_" + id;
376-
label.FontSize = 10;
376+
label.FontSize = 12;
377377
label.Content = Math.Round(thermalsList[id].airspeed) + "m/s" + (thermalsList[id].alt > 1000 ? Environment.NewLine + (thermalsList[id].alt / 0.305).ToString("0") + "ft AGL" : "");
378378
label.Foreground = new SolidColorBrush(Colors.DarkRed);
379379
group.Children.Add(label);

MSFS Kinetic Assistant/Requests.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public enum Requests
44
{
55
PlaneInfo = 0,
66
PlaneCommit = 1,
7-
PlaneRotate = 2,
7+
PlaneRotationVelocity = 2,
88
NearbyObjects = 3,
99
TowPlane = 4,
1010
Airport = 5,
@@ -21,13 +21,16 @@ public enum Requests
2121
PlaneLift = 16,
2222
GhostCommit = 17,
2323
PlaneRotateAccel = 18,
24+
ThermalVelocityCommit = 19,
25+
FoldingWindCommit = 20,
26+
RotationVelocityZCommit = 21,
2427
}
2528

2629
public enum Definitions
2730
{
2831
PlaneInfo = 0,
2932
PlaneCommit = 1,
30-
PlaneRotate = 2,
33+
PlaneRotationVelocity = 2,
3134
NearbyObjects = 3,
3235
TowPlane = 4,
3336
Airport = 5,
@@ -44,5 +47,8 @@ public enum Definitions
4447
PlaneLift = 16,
4548
GhostCommit = 17,
4649
PlaneRotateAccel = 18,
50+
ThermalVelocityCommit = 19,
51+
FoldingWindCommit = 20,
52+
RotationVelocityZCommit = 21,
4753
}
4854
}

MSFS Kinetic Assistant/Server.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ private static string NmeaFormat(Location location)
303303
var alt = location.alt.ToString("F1");
304304
var speed = (location.speed * 1.9).ToString("F3");
305305
var time = location.time.ToString("HHmmss.ff");
306-
var date = location.time.ToString("ddmmyy");
306+
var date = location.time.ToString("ddMMyy");
307307
var ha = location.ha.ToString("0.00", CultureInfo.InvariantCulture);
308308

309309
var gga = String.Format("GPGGA,{0},{1},{2},1,12,1,{3},M,,,,", time, lat, lon, alt);

MSFS Kinetic Assistant/Tracking.cs

+21-7
Original file line numberDiff line numberDiff line change
@@ -448,29 +448,39 @@ public GhostCommit updateGhostPlayer(uint ID, NearbyInfoResponse response, Ghost
448448
double progress = ((ghostPlane.Progress + deltaTime) - prev.Timer) / (curr.Timer - prev.Timer);
449449
double timeLeft = curr.Timer - (ghostPlane.Progress + deltaTime);
450450

451-
double distancePrev = _mathClass.findDistanceBetweenPoints(response.Latitude, response.Longitude, prev.Location.Latitude, prev.Location.Longitude);
451+
//double distancePrev = _mathClass.findDistanceBetweenPoints(response.Latitude, response.Longitude, prev.Location.Latitude, prev.Location.Longitude);
452452
double distanceCurr = _mathClass.findDistanceBetweenPoints(response.Latitude, response.Longitude, curr.Location.Latitude, curr.Location.Longitude);
453-
double distanceNext = _mathClass.findDistanceBetweenPoints(response.Latitude, response.Longitude, next.Location.Latitude, next.Location.Longitude);
453+
//double distanceNext = _mathClass.findDistanceBetweenPoints(response.Latitude, response.Longitude, next.Location.Latitude, next.Location.Longitude);
454+
455+
/*if (distanceCurr / timeLeft > 1.25 * curr.Velocity)
456+
{
457+
distanceCurr = 1.25 * curr.Velocity * timeLeft;
458+
Console.WriteLine($"TOO FAR FROM NEXT POINT: {distanceCurr:F6}");
459+
}*/
460+
454461

455462
double bearing = normalizeRadAngle(_mathClass.findBearingToPoint(response.Latitude, response.Longitude, next.Location.Latitude, next.Location.Longitude));
456463
response.Heading = normalizeRadAngle(response.Heading);
457464
bearing = zeroeRadAngle(bearing - response.Heading);
458465
double newHeading = zeroeRadAngle(response.Heading + (absoluteTime - ghostPlane.LastTrackPlayed) * bearing);
459-
towCommit.RotationVelocityBodyY = Math.Sin(newHeading - response.Heading);
466+
//towCommit.RotationVelocityBodyY = Math.Sin(newHeading - response.Heading);
467+
towCommit.planeHeading = newHeading;
460468
//Console.WriteLine($"Tracking heading: {response.Heading:F4} bearing: {bearing:F4} newHeading: {newHeading:F4}");
461469

462470
double requiredBank = ((1 - progress) * (prev.Roll * Math.PI / 180 - response.Bank) + progress * (curr.Roll * Math.PI / 180 - response.Bank)) / 2;
463-
towCommit.RotationVelocityBodyZ = Math.Sin(requiredBank - response.Bank);
471+
//towCommit.RotationVelocityBodyZ = Math.Sin(requiredBank - response.Bank);
472+
towCommit.planeRoll = requiredBank;
464473
double requiredPitch = ((1 - progress) * (prev.Pitch * Math.PI / 180 - response.Pitch) + progress * (prev.Pitch * Math.PI / 180 - response.Pitch)) / 2;
465-
towCommit.RotationVelocityBodyX = Math.Sin(requiredPitch - response.Pitch);
474+
//towCommit.RotationVelocityBodyX = Math.Sin(requiredPitch - response.Pitch);
475+
towCommit.planePitch = requiredPitch;
466476

467477
//Console.WriteLine($"RotationVelocityBodyX: {towCommit.RotationVelocityBodyX:F4} RotationVelocityBodyY: {towCommit.RotationVelocityBodyY:F4} RotationVelocityBodyZ: {towCommit.RotationVelocityBodyZ:F4}");
468478
//towCommit.Heading = newHeading;
469479

470480
towCommit.VelocityBodyX = 0;
471481
towCommit.VelocityBodyY = ((1 - progress) * (prev.Elevation - response.Altitude) + progress * (curr.Elevation - response.Altitude)) / 2;
472-
towCommit.VelocityBodyZ = (0.8 * curr.Velocity + 0.1 * distanceCurr / Math.Max(1, timeLeft)) * (Math.Abs(distanceCurr) < 10 ? Math.Abs(distanceCurr) / 10 : 1);
473-
482+
towCommit.VelocityBodyZ = (0.9 * curr.Velocity + 0.1 * distanceCurr / Math.Max(1, timeLeft)) * (distanceCurr < 10 ? distanceCurr / 10 : 1);
483+
474484
// TAXIING
475485
if (towCommit.VelocityBodyZ < 1 && towCommit.VelocityBodyZ > -1)
476486
{
@@ -524,6 +534,10 @@ public GhostCommit updateGhostPlayer(uint ID, NearbyInfoResponse response, Ghost
524534

525535
ghostPlanes[index] = gp;
526536
}
537+
else
538+
{
539+
540+
}
527541

528542

529543
return towCommit;
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)