summaryrefslogtreecommitdiffstats
path: root/include/context.h
blob: a2f651f6db001a15f8da6a055a66df19fa28d6d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef CONTEXT_H
#define CONTEXT_H

#include <stddef.h>
#include <stdlib.h>
#include <stdbool.h>

#include "ace.h"

typedef enum {
	BC_UNKNOWN = 0,
	BC_G1,
	BC_G2,
	BC_G3,
	BC_G4,
	BC_G5,
	BC_G6,
	BC_G7,
} BallisticModel;

typedef enum {
	ICAO,
	ASM,
} AtmosphereModel;

typedef struct {
	double scope_angle;
	double bullet_mass;
	double bore_height;
	double muzzle_velocity;
	double ballistic_coef;
	size_t drag_model;
	double twist_dir;
} GunConfig;

typedef struct {
	double temperature;
	double barometric_pressure;
	double relative_humidity;
	double wind_speed[2];
	size_t wind_dir;
	AtmosphereModel atmosphere_model;
} AtmoContext;

typedef struct {
	double speed;
	double range;
	double inclination_angle;
	double latitude;
	size_t direction;
} TargetContext;

typedef struct {
	GunConfig gun;
	TargetContext target;
	AtmoContext atmosphere;
	size_t sim_steps;
	bool store_range_card;
	size_t stability_factor;
} ATragMXContext;

typedef struct {
	double w1;
	double w2;
} Windage;

typedef struct {
	double elev;
	Windage windage;
	double lead;
	double time_of_flight;
	double remaining_velocity;
	double remaining_energy;
	double coriolis_vdrift;
	double coriolis_hdrift;
	double spin_drift;
	double *range_card;
} ATragMXSolution;

#endif