@fboes/aerofly-custom-missions 1.13.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/dto-flight/AeroflySettingsFlight.js +2 -5
- package/dist/dto-flight/AeroflySettingsFlight.test.js +17 -0
- package/dist/node/AeroflyTypes.js +0 -3
- package/package.json +1 -1
- package/src/dto-flight/AeroflySettingsFlight.test.ts +22 -0
- package/src/dto-flight/AeroflySettingsFlight.ts +2 -5
- package/src/node/AeroflyTypes.ts +0 -4
- package/types/dto-flight/AeroflySettingsFlight.d.ts.map +1 -1
- package/types/node/AeroflyTypes.d.ts +0 -1
- package/types/node/AeroflyTypes.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@ This changelog documents all notable changes to the Aerofly Custom Missions proj
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
- Fixed velocity vector conversion
|
|
8
|
+
- Removed setting speed on setting flight configuration
|
|
9
|
+
|
|
7
10
|
## [1.13.1] - 2026-07-24
|
|
8
11
|
|
|
9
12
|
- Fixed orientation / heading parsing
|
|
@@ -88,7 +88,6 @@ export class AeroflySettingsFlight {
|
|
|
88
88
|
break;
|
|
89
89
|
default:
|
|
90
90
|
this.throttle = 0;
|
|
91
|
-
this.speed_kts = 0;
|
|
92
91
|
break;
|
|
93
92
|
}
|
|
94
93
|
}
|
|
@@ -109,12 +108,10 @@ export class AeroflySettingsFlight {
|
|
|
109
108
|
*/
|
|
110
109
|
get velocity() {
|
|
111
110
|
const speed = this.speed_ms;
|
|
112
|
-
|
|
113
|
-
return new AeroflyVector3Float(Math.cos(heading_rad) * speed, Math.sin(heading_rad) * speed, 0);
|
|
111
|
+
return this.orientation.multiplyVector(new AeroflyVector3Float(speed, 0, 0));
|
|
114
112
|
}
|
|
115
113
|
set velocity(velocity) {
|
|
116
|
-
|
|
117
|
-
this.speed_ms = 0;
|
|
114
|
+
this.speed_ms = Math.sqrt(velocity.x ** 2 + velocity.y ** 2 + velocity.z ** 2);
|
|
118
115
|
}
|
|
119
116
|
get orientation() {
|
|
120
117
|
return convertHeadingToOrientation(this.heading_degree, this.position);
|
|
@@ -43,4 +43,21 @@ describe("AeroflySettingsFlight", () => {
|
|
|
43
43
|
assert.ok(flight.flaps > 0, "Flaps extended");
|
|
44
44
|
assert.strictEqual(flight.onGround, false);
|
|
45
45
|
});
|
|
46
|
+
it("should convert between speed and velocity vector", () => {
|
|
47
|
+
const flight = new AeroflySettingsFlight(-122.3088, 47.4502, 1000, 90, 150);
|
|
48
|
+
assert.strictEqual(flight.speed_kts, 150);
|
|
49
|
+
assert.strictEqual(flight.speed_ms, 77.1666);
|
|
50
|
+
const velocity = flight.velocity;
|
|
51
|
+
assert.ok(velocity.x > 60);
|
|
52
|
+
assert.ok(velocity.y < -40);
|
|
53
|
+
assert.ok(velocity.z > 0);
|
|
54
|
+
// Reset speed
|
|
55
|
+
flight.speed_ms = 0;
|
|
56
|
+
assert.strictEqual(flight.speed_kts, 0);
|
|
57
|
+
assert.strictEqual(flight.speed_ms, 0);
|
|
58
|
+
// Set speed from velocity vector
|
|
59
|
+
flight.velocity = velocity;
|
|
60
|
+
assert.strictEqual(flight.speed_kts, 150);
|
|
61
|
+
assert.strictEqual(flight.speed_ms, 77.1666);
|
|
62
|
+
});
|
|
46
63
|
});
|
|
@@ -17,9 +17,6 @@ export class AeroflyVector3Float {
|
|
|
17
17
|
cross(b) {
|
|
18
18
|
return new AeroflyVector3Float(this.y * b.z - this.z * b.y, this.z * b.x - this.x * b.z, this.x * b.y - this.y * b.x);
|
|
19
19
|
}
|
|
20
|
-
dot(b) {
|
|
21
|
-
return this.x * b.x + this.y * b.y + this.z * b.z;
|
|
22
|
-
}
|
|
23
20
|
static fromArray(array) {
|
|
24
21
|
return new this(...array);
|
|
25
22
|
}
|
package/package.json
CHANGED
|
@@ -59,4 +59,26 @@ describe("AeroflySettingsFlight", () => {
|
|
|
59
59
|
assert.ok(flight.flaps > 0, "Flaps extended");
|
|
60
60
|
assert.strictEqual(flight.onGround, false);
|
|
61
61
|
});
|
|
62
|
+
|
|
63
|
+
it("should convert between speed and velocity vector", () => {
|
|
64
|
+
const flight = new AeroflySettingsFlight(-122.3088, 47.4502, 1000, 90, 150);
|
|
65
|
+
|
|
66
|
+
assert.strictEqual(flight.speed_kts, 150);
|
|
67
|
+
assert.strictEqual(flight.speed_ms, 77.1666);
|
|
68
|
+
|
|
69
|
+
const velocity = flight.velocity;
|
|
70
|
+
assert.ok(velocity.x > 60);
|
|
71
|
+
assert.ok(velocity.y < -40);
|
|
72
|
+
assert.ok(velocity.z > 0);
|
|
73
|
+
|
|
74
|
+
// Reset speed
|
|
75
|
+
flight.speed_ms = 0;
|
|
76
|
+
assert.strictEqual(flight.speed_kts, 0);
|
|
77
|
+
assert.strictEqual(flight.speed_ms, 0);
|
|
78
|
+
|
|
79
|
+
// Set speed from velocity vector
|
|
80
|
+
flight.velocity = velocity;
|
|
81
|
+
assert.strictEqual(flight.speed_kts, 150);
|
|
82
|
+
assert.strictEqual(flight.speed_ms, 77.1666);
|
|
83
|
+
});
|
|
62
84
|
});
|
|
@@ -146,7 +146,6 @@ export class AeroflySettingsFlight {
|
|
|
146
146
|
break;
|
|
147
147
|
default:
|
|
148
148
|
this.throttle = 0;
|
|
149
|
-
this.speed_kts = 0;
|
|
150
149
|
break;
|
|
151
150
|
}
|
|
152
151
|
}
|
|
@@ -170,13 +169,11 @@ export class AeroflySettingsFlight {
|
|
|
170
169
|
*/
|
|
171
170
|
get velocity(): AeroflyVector3Float {
|
|
172
171
|
const speed = this.speed_ms;
|
|
173
|
-
|
|
174
|
-
return new AeroflyVector3Float(Math.cos(heading_rad) * speed, Math.sin(heading_rad) * speed, 0);
|
|
172
|
+
return this.orientation.multiplyVector(new AeroflyVector3Float(speed, 0, 0));
|
|
175
173
|
}
|
|
176
174
|
|
|
177
175
|
set velocity(velocity: AeroflyVector3Float) {
|
|
178
|
-
|
|
179
|
-
this.speed_ms = 0;
|
|
176
|
+
this.speed_ms = Math.sqrt(velocity.x ** 2 + velocity.y ** 2 + velocity.z ** 2);
|
|
180
177
|
}
|
|
181
178
|
|
|
182
179
|
get orientation(): AeroflyMatrix3Float {
|
package/src/node/AeroflyTypes.ts
CHANGED
|
@@ -24,10 +24,6 @@ export class AeroflyVector3Float {
|
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
dot(b: AeroflyVector3Float): number {
|
|
28
|
-
return this.x * b.x + this.y * b.y + this.z * b.z;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
27
|
static fromArray(array: AeroflyVector3FloatArray): AeroflyVector3Float {
|
|
32
28
|
return new this(...array);
|
|
33
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflySettingsFlight.d.ts","sourceRoot":"","sources":["../../src/dto-flight/AeroflySettingsFlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EACH,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAChC,MAAM,yBAAyB,CAAC;AAUjC,MAAM,MAAM,kCAAkC,GACxC,MAAM,GACN,aAAa,GACb,aAAa,GACb,SAAS,GACT,UAAU,GACV,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC;AAEd,qBAAa,qBAAqB;IA6BnB,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,MAAM;IAChB,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,MAAM;IACtB,SAAS,EAAE,MAAM;IAhC5B,IAAI,EAAE,MAAM,CAAK;IAEjB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAK;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAK;IAClB,aAAa,EAAE,kCAAkC,CAAa;IAC9D,Q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GlC;IAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,EAEzC;IAED,IAAI,WAAW,IAAI,mBAAmB,CAErC;IAED,IAAI,WAAW,CAAC,WAAW,EAAE,mBAAmB,EAE/C;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,EAElC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAE5B;IAED,UAAU,IAAI,wBAAwB;IAwBtC,MAAM;IAQN;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGrB"}
|
|
@@ -6,7 +6,6 @@ export declare class AeroflyVector3Float {
|
|
|
6
6
|
constructor(x: number, y: number, z: number);
|
|
7
7
|
normalize(): AeroflyVector3Float;
|
|
8
8
|
cross(b: AeroflyVector3Float): AeroflyVector3Float;
|
|
9
|
-
dot(b: AeroflyVector3Float): number;
|
|
10
9
|
static fromArray(array: AeroflyVector3FloatArray): AeroflyVector3Float;
|
|
11
10
|
toArray(): AeroflyVector3FloatArray;
|
|
12
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflyTypes.d.ts","sourceRoot":"","sources":["../../src/node/AeroflyTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEhE,qBAAa,mBAAmB;IAEjB,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;gBAFT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM;IAGpB,SAAS,IAAI,mBAAmB;IAShC,KAAK,CAAC,CAAC,EAAE,mBAAmB,GAAG,mBAAmB;IAQlD,
|
|
1
|
+
{"version":3,"file":"AeroflyTypes.d.ts","sourceRoot":"","sources":["../../src/node/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