Jump to content

[1.0] Enhanced Navball 1.3


kitoban

Recommended Posts

I am afraid vector maths and such is not my thing, hence why I tended to do UI and such on projects. I did have a cursory look at the code, but I could not work out where the bit I needed to change was.

If you could identify the bit of code (and ideally the variable) that I was interested in, then I could possibly work it out, but I think stabbing away in the dark would be a bit of a waste of time.

Link to comment
Share on other sites

evilC - the core of the calculations are in here: https://github.com/kitoban/EnhancedNavBall/blob/master/EnhancedNavBall/CalculationStore.cs

which is mostly sourced from mechjebs calculations for radial+/- etc, so afraid I do not completely understand how they work (in particular what Vector3d.Exclude does) I can only follow the calculations so far...

However I have put some further thought into this and think that the radial calculations are incorrect for VTOL purposes as it is reliant on the orientation of the ship, would need to do some part interrogation to determine the up direction according to the capsule (up being above the cockpit as opposed to forward being in front of the craft), which gets tricky when you are also having to calculate for the spaceships as up gets confused with forward...

I think it is likely to be this:

Vector3d radialPlus = Vector3d.Exclude(velocityVesselOrbit, up).normalized;

with velocityVesselOrbit swapped with the orientation of the cockpit to give you what you need, feel free to branch this off and add it in, I can then look to pulling this back into the project :) (with credits ofc )

Umlüx - Thanks, yeah I have certainly seen interest in the mod increase since scott started using it in the Interstellar series. Development has slowed (as seen above with evilC) but the RL commitments look like they are starting to fall into place which should free up some time to do some further development.

Link to comment
Share on other sites

I am afraid vector maths and such is not my thing, hence why I tended to do UI and such on projects. I did have a cursory look at the code, but I could not work out where the bit I needed to change was.

If you could identify the bit of code (and ideally the variable) that I was interested in, then I could possibly work it out, but I think stabbing away in the dark would be a bit of a waste of time.

Here's how to rotate a vector by a certain angle. You should just be able to apply it to the code given. Good luck!

Link to comment
Share on other sites

Hmm, not sure enough on how it all works to be sure, but surely it is not radial that I am interested in?

I want to rotate a ghosted retrograde marker such that if you were in a forward-facing (plane style) vehicle, and were falling to earth (but not flying forwards, just dropping like a rock) then if you were leveled on the horizon, the retrograde marker would be inside the orientation indicator (-v-).

I think I maybe see what you are getting at - the ghost indicator might be at the right place on the y axis (ie angle of attack) but it may be pointing at some random place on the x axis (heading). Is this why you are saying to mess with the radial?

Whatever - I presume the variable that I am interested in is "ProgradeOrbit". Gonna maybe see if I can dig out VS again and have a play.

Link to comment
Share on other sites

OK, I built the project and had a play, and it seems that I have been maybe confusing you slightly because I was not aware of exactly what this mod did.

I see now that the "Ghost Prograde" feature is for when prograde is not visible - it creates a ghost to show you the direction that prograde is in.

This is not the kind of functionality that I require.

What I need is to make a duplicate of the retrograde marker, and place it at 90 degrees to where the actual retrograde marker is, regardless of whether it is visible or not. The "ghost" functionality to make it easier to find is gravy.

So I guess what I need to do is look at the anti-node / radial injection routines and duplicate those...

Link to comment
Share on other sites

Wow this looks fantastic! I'll try this tonight, after days of playing with just the navball - then switching to mechjeb for a few versions.. I've kind of gone full circle and gone back to navball for docking/flights, the tricks you learn while doing these maneuvers over time you end up figuring out that you've been guesstimating these reference points from just practice all along! This definitely gets rid of some of the guesswork/eyeballing now :)

Link to comment
Share on other sites

No further progress yet, but I think I know what I need.

My current code:

Vector3d offsetProgradeSurface = velocityVesselSurfaceUnit;

I need to rotate that by 90 degrees.

Previously linked sample was for rotating a Quaternion, this is a Vector3d

Link to comment
Share on other sites

This mod... It is amazing! I cannot even use words to express how I feel about it! It goes together with Kerbal Engineer Redux amazingly, to the point that I am able to get into orbit and transfer to other planets with practically no use of the map. Also, is there a way to make it show the ejection angle for interplanetary transfers on the navball? That could make a nice feature.

Link to comment
Share on other sites

OK, I think I did it.

VTOL mode prototype submitted to GitHub! (For use with craft that have a VTOL engine perpendicular to the forward direction - think harrier jump jet)

I don't think I have permissions to contribute to that project, so I forked. I added you as a contributor, so if you like we can play on this fork without fear of messing up yours.

How it currently works:

(Tested in Surface mode only at the moment)

The Blue (Sky) prograde marker should be visible as you ascend. Keeping your heading indicator (-v-) inside the blue prograde will ensure you burn prograde.

The Green (Grass) retrograde marker should be visible as you descend. If coming in from orbit, keep your heading indicator inside the retrograde marker as you burn to ensure you only slow down and do not deviate course. Can also be used to help correct deviation.

Note that to move the pro/retrograde marker left/right, ROLL in the direction you wish to move it, NOT yaw! You are correcting sideways slip, you need to roll as your controls are plane style not rocket style!

eg if you have the same pitch as the retro marker, but it is to your left, you are slipping left - roll right so some of your down burn corrects your left slip.

Some comments:

Seems to work pretty much as I envisioned. I certainly had a lot more survivable landings with my VTOL tests than I did before - makes KCA so much more useful!

What would also be nice to to change the retrograde marker scale depending on speed. So for example the marker is small when you have no speed (soft landing) and big when you have lots of speed. Any ideas on how to do that would be appreciated.

I guess this mod may be a candidate for trying out Taranis' new examples - make it a partless plugin, add an icon and a settings menu so you can turn on/off VTOL mode. That way my code can sit in the main codebase and not bother regular users.

Edited by evilC
Link to comment
Share on other sites

Forking it should be fine I think I can do a pull request to get the code into the main branch, will take a look when I have a chance.

Adding the UI switches is something I will need to get the navball custmisation (high contrast etc.)

Link to comment
Share on other sites

  • 1 month later...

Just a heads up, the mod has been updated to show that it is compatible with 0.23 on spaceport, but the thread title has not yet been updated. If you are checking here to see if it works, it works great and the version of the plugin does not look to have been changed between 0.22 and 0.23

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Suggestion for a feature: option to separate prograde/retrograde and target relative velocity+/- so that in target mode you have markers for prograde, retrograde and target relative velocity +/-, relative velocity +/- would need new icons distinct from the prograde/retrograde ones.

Link to comment
Share on other sites

Hi,

kitoban please tell can you implement feature:

provide to players an opportunity to choose what side a navball of active control module is looking at (front/rear/left/right/top/bottom). May be some sliding of an orientational mark of Navball?

For more info:

http://forum.kerbalspaceprogram.com/threads/72050-Navball-adjustment

Thank you.

Link to comment
Share on other sites

Thanks for the message of appreciation, makes the trouble I had creating the mod worthwhile :)

I will say I haven't forgotten about the mod and have been putting in work on the extra feature that have been requested, I've just been going through an extended house move which has been tacking up my time to work on getting the features added in, but they are coming.

As far as Meltafire's request:

provide to players an opportunity to choose what side a navball of active control module is looking at (front/rear/left/right/top/bottom). May be some sliding of an orientational mark of Navball?

I can look into this, but as this is a process of overridding the control of the navball orientation it might result in an argument between the mod code and the core code, which might be problematic.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...