ballistics-engine 0.33.0 → 0.33.3
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/README.md +1088 -90
- package/ballistics_engine.d.ts +84 -0
- package/ballistics_engine.js +710 -8
- package/ballistics_engine_bg.wasm +0 -0
- package/package.json +6 -14
- package/LICENSE-APACHE +0 -201
- package/ballistics_engine_bg.js +0 -585
package/ballistics_engine.d.ts
CHANGED
|
@@ -32,6 +32,14 @@ export class Calculator {
|
|
|
32
32
|
* Returns array of: [{ range_yards, drop_inches, windage_inches, velocity_fps, energy_ftlb, time_sec }, ...]
|
|
33
33
|
*/
|
|
34
34
|
getFullTrajectory(): any;
|
|
35
|
+
/**
|
|
36
|
+
* Solve all the way to the requested range instead of stopping at ground impact.
|
|
37
|
+
*
|
|
38
|
+
* Without this, `calculateTrajectory(range)` returns the closest point it actually
|
|
39
|
+
* solved, which for a typical .308 is around 516 yd — short of a 1000 yd request, and
|
|
40
|
+
* reported only by the `range_yards` field of the returned object.
|
|
41
|
+
*/
|
|
42
|
+
ignoreGroundImpact(ignore: boolean): Calculator;
|
|
35
43
|
/**
|
|
36
44
|
* Create a new calculator with default values
|
|
37
45
|
* Defaults: .308 Winchester 168gr at 2700 fps, standard atmosphere
|
|
@@ -39,6 +47,13 @@ export class Calculator {
|
|
|
39
47
|
constructor();
|
|
40
48
|
setAltitude(altitude_ft: number): Calculator;
|
|
41
49
|
setBC(bc: number): Calculator;
|
|
50
|
+
/**
|
|
51
|
+
* Height of the bore above the ground, in inches (default 60 = 5 ft). The solve stops
|
|
52
|
+
* when the projectile falls this far below the muzzle, so raising it pushes the
|
|
53
|
+
* ground-impact cutoff further downrange. Use [`Self::ignore_ground_impact`] to remove
|
|
54
|
+
* the cutoff entirely rather than setting an implausible height.
|
|
55
|
+
*/
|
|
56
|
+
setBoreHeight(height_inches: number): Calculator;
|
|
42
57
|
setDiameter(diameter_inches: number): Calculator;
|
|
43
58
|
setDragModel(model: string): Calculator;
|
|
44
59
|
setHumidity(humidity: number): Calculator;
|
|
@@ -142,3 +157,72 @@ export class WasmBallistics {
|
|
|
142
157
|
*/
|
|
143
158
|
runCommand(command: string): string;
|
|
144
159
|
}
|
|
160
|
+
|
|
161
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
162
|
+
|
|
163
|
+
export interface InitOutput {
|
|
164
|
+
readonly memory: WebAssembly.Memory;
|
|
165
|
+
readonly __wbg_calculator_free: (a: number, b: number) => void;
|
|
166
|
+
readonly __wbg_wasmballistics_free: (a: number, b: number) => void;
|
|
167
|
+
readonly calculator_addWindSegment: (a: number, b: number, c: number, d: number) => number;
|
|
168
|
+
readonly calculator_calculateTrajectory: (a: number, b: number) => [number, number, number];
|
|
169
|
+
readonly calculator_clearWindSegments: (a: number) => number;
|
|
170
|
+
readonly calculator_enableCoriolis: (a: number, b: number, c: number, d: number) => number;
|
|
171
|
+
readonly calculator_enableSpinDrift: (a: number, b: number, c: number, d: number) => number;
|
|
172
|
+
readonly calculator_getFullTrajectory: (a: number) => [number, number, number];
|
|
173
|
+
readonly calculator_ignoreGroundImpact: (a: number, b: number) => number;
|
|
174
|
+
readonly calculator_new: () => number;
|
|
175
|
+
readonly calculator_setAltitude: (a: number, b: number) => number;
|
|
176
|
+
readonly calculator_setBC: (a: number, b: number) => number;
|
|
177
|
+
readonly calculator_setBoreHeight: (a: number, b: number) => number;
|
|
178
|
+
readonly calculator_setDiameter: (a: number, b: number) => number;
|
|
179
|
+
readonly calculator_setDragModel: (a: number, b: number, c: number) => number;
|
|
180
|
+
readonly calculator_setHumidity: (a: number, b: number) => number;
|
|
181
|
+
readonly calculator_setMass: (a: number, b: number) => number;
|
|
182
|
+
readonly calculator_setMaxRange: (a: number, b: number) => number;
|
|
183
|
+
readonly calculator_setPressure: (a: number, b: number) => number;
|
|
184
|
+
readonly calculator_setShotDirection: (a: number, b: number) => number;
|
|
185
|
+
readonly calculator_setSightHeight: (a: number, b: number) => number;
|
|
186
|
+
readonly calculator_setTemperature: (a: number, b: number) => number;
|
|
187
|
+
readonly calculator_setVelocity: (a: number, b: number) => number;
|
|
188
|
+
readonly calculator_setWind: (a: number, b: number, c: number) => number;
|
|
189
|
+
readonly calculator_setWindReference: (a: number, b: number, c: number) => number;
|
|
190
|
+
readonly calculator_setZeroRange: (a: number, b: number) => number;
|
|
191
|
+
readonly wasmballistics_clearDragTable: (a: number) => number;
|
|
192
|
+
readonly wasmballistics_hasBc5dTable: (a: number) => number;
|
|
193
|
+
readonly wasmballistics_hasDragTable: (a: number) => number;
|
|
194
|
+
readonly wasmballistics_loadBc5dTable: (a: number, b: number, c: number) => [number, number, number, number];
|
|
195
|
+
readonly wasmballistics_loadDragTable: (a: number, b: number, c: number) => [number, number, number, number];
|
|
196
|
+
readonly wasmballistics_new: () => number;
|
|
197
|
+
readonly wasmballistics_runCommand: (a: number, b: number, c: number) => [number, number, number, number];
|
|
198
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
199
|
+
readonly __externref_table_alloc: () => number;
|
|
200
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
201
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
202
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
203
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
204
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
205
|
+
readonly __wbindgen_start: () => void;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
212
|
+
* a precompiled `WebAssembly.Module`.
|
|
213
|
+
*
|
|
214
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
215
|
+
*
|
|
216
|
+
* @returns {InitOutput}
|
|
217
|
+
*/
|
|
218
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
222
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
223
|
+
*
|
|
224
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
225
|
+
*
|
|
226
|
+
* @returns {Promise<InitOutput>}
|
|
227
|
+
*/
|
|
228
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|