Jump to content

[1.8.x, 1.9.x, 1.10.x] Steam Gauges Recalibrated


linuxgurugamer

Recommended Posts

  • 2 weeks later...

@linuxgurugamerI don't know if this is the best place to post this, but I found a fix for the dynamic parts of the HUD when you're IVA . Here is a part of code that I've used to fix it. The problem arises at private void drawPitchLadder. Hope it's useful.
 

        //funky method
        private Quaternion updateHeadingPitchRollField(Vessel v)
        {
            Vector3d CoM, north, up;
            Quaternion rotationSurface;
            CoM = v.CoM;
            up = (CoM - v.mainBody.position).normalized;
            north = Vector3d.Exclude(up, (v.mainBody.position + v.mainBody.transform.up * (float)v.mainBody.Radius) - CoM).normalized;
            rotationSurface = Quaternion.LookRotation(north, up);
            return Quaternion.Inverse(Quaternion.Euler(90, 0, 0) * Quaternion.Inverse(v.GetTransform().rotation) * rotationSurface);
        }

        //Draws the pitch ladder or vertical ascent circle, and roll scale
        private void drawPitchLadder(Vessel v, bool full)
        {
            ball = UnityEngine.Object.FindObjectOfType<NavBall>(); //deprecated
            Quaternion attitude = updateHeadingPitchRollField(v);

            float pitch = (float)((attitude.eulerAngles.x > 180) ? (360.0 - attitude.eulerAngles.x) : -attitude.eulerAngles.x);
            //float yaw = (float)attitude.eulerAngles.y; //not useful here
            float roll = (float)((attitude.eulerAngles.z > 180) ? (attitude.eulerAngles.z - 360.0) : attitude.eulerAngles.z);
            roll = -roll;

            //Display relative pitch in orbital mode
          //...

 

Link to comment
Share on other sites

5 hours ago, doxid310 said:

I don't know if this is the best place to post this, but I found a fix for the dynamic parts of the HUD when you're IVA . Here is a part of code that I've used to fix it. The problem arises at private void drawPitchLadder. Hope it's useful.

Would be better to submit a PR, I really don't know what you've changed.

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...