NikolaiVChr / flightgear-saab-ja-37-viggen

Saab 37 Viggen for Flightgear flight simulator
http://wiki.flightgear.org/Saab_37_Viggen
GNU General Public License v2.0
26 stars 15 forks source link

Remote control for Rb05 #121

Closed colingeniet closed 4 years ago

colingeniet commented 4 years ago

Solves #113

The general idea is there, it needs fine tuning. For now the controls are the same as for the cursor in the JA: either bind separate joystick axes for control, or use the main flight controls, with y to toggle between flight controls and missile(doesn't work yet). Eventually the AJS will get a radar cursor and this will need to be improved, but it can wait until then.

To do:

colingeniet commented 4 years ago

Force pushed (sorry) a new version. Not much changed for users, but removes some hard coded assumptions in missile.nas.

Firing two Rb05 together now works correctly: only the last one receives inputs. The fuse was modified for ground targets, in order to give them a pseudo hit-box.

colingeniet commented 4 years ago

Sorry about yet another force push, but the commit history was quite messy.

@NikolaiVChr For me the missile.nas part is now final. Unless I made a mistake nothing changed since the last version except the dead code you mentioned. I made sure to keep all the changes to missile.nas in a single separate commit, to make it easier in case you want to port it to another aircraft.

colingeniet commented 4 years ago

Ready to merge for me. @NikolaiVChr just to confirm you are fine with the PR (in particular the changes to missile.nas)?

I started working on radar-logic.nas to solve the last issue I added to the list (no damage if target is outside of radar FOV) but I prefer to make a separate PR for this because I am touching a few other things.

NikolaiVChr commented 4 years ago

The remote control needs to depend on time.

Else somebody with higher FPS will get higher sensitivity, etc.

In the 2 functions in missle.nas just multiply the input with me.dt

NikolaiVChr commented 4 years ago

And unless there is a bug, completelist should have all contacts, in FoV or not.

colingeniet commented 4 years ago

The remote control needs to depend on time.

Indeed, woops

And unless there is a bug, completelist should have all contacts, in FoV or not.

Well there is a bug: in processTracks, the track is only added to complete_list if trackCalc does not return nil, and trackCalc only returns a Contact object once all the line of sight/FOV/range tests pass, and returns nil otherwise.