feat(flight): enhance flight model with transonic drag and vortex lift features

This commit is contained in:
richard committed 2026-10-28 23:14:37 +01:00
1 parent 599ecae21f
commit 44a5f7f9bc
12 files changed
+177 -26

No files matched your search

@@ -61,6 +61,7 @@ final class WingShape {
int[] count = new int[n];
int[] minSpan = new int[n];
int[] maxSpan = new int[n];
boolean[] hasWing = new boolean[n];
java.util.Arrays.fill(minSpan, Integer.MAX_VALUE);
java.util.Arrays.fill(maxSpan, Integer.MIN_VALUE);
for (int i = 0; i < n; i++) {
@@ -70,6 +71,7 @@ final class WingShape {
int root = find(parent, i);
int span = all[i].type().vertical ? cell[i * 3 + 1] : cell[i * 3] * Math.abs(all[i].rightX()) + cell[i * 3 + 2] * Math.abs(all[i].rightZ());
count[root]++;
hasWing[root] |= all[i].type() == SurfaceType.WING;
minSpan[root] = Math.min(minSpan[root], span);
maxSpan[root] = Math.max(maxSpan[root], span);
}
@@ -80,7 +82,7 @@ final class WingShape {
int root = find(parent, i);
double span = maxSpan[root] - minSpan[root] + 1;
double aspectRatio = span * span / count[root];
all[i] = all[i].withAspectRatio(Math.max(MIN_ASPECT_RATIO, Math.min(MAX_ASPECT_RATIO, aspectRatio)));
all[i] = all[i].withWingShape(Math.max(MIN_ASPECT_RATIO, Math.min(MAX_ASPECT_RATIO, aspectRatio)), hasWing[root]);
}
return all;
}