Closed dbookstaber closed 9 months ago
Also: It doesn't make sense to bind anything to the Calculator interface object. Weapon, Ammo, and Atmo are properties of a Shot. Therefore:
weapon
, ammo
, zero_atmo
Done now in refactor_angles branch: 36e7f84264e3c5bf46f4bb3a791a78d3abe0845f
New paradigm:
Weapon class stores only characteristics of the gun: scope_height, barrel twist, and zero_elevation (which gives angle of barrel with sight set to "zero"). (Expect to use Calculator.set_weapon_zero to get the zero-elevation to hit a target under specific conditions.) Note that a "zero" is an angle between the sight and the barrel. Given zero angle, the zero distance depends on atmosphere and load fired, which is one of the things we use the calculator to compute!
Shot class stores data specific to a shot: atmosphere, weapon, look_angle, cant_angle, and relative_angle (which reflects any sight/hold adjustments to firing angle)
The range and step for trajectory calculation are now passed explicitly to Calculator.fire(), not stored in Shot.
To accommodate non-zero look-angle, shot_results.drop-adjustment shouldn't be locked in reference to horizontal. Instead it should reference the zero and adjustment to zero to hit the indicated distance.
Here's an example showing how we get this "firing solution" from the existing paradigm: