Example #1
0
        void UpdateHeadingUV()
        {
            float   headingShift = headingRulerUVT.textureSize.x / 360 * heading;
            Vector2 shift        = new Vector2(headingShift, 0);

            headingRulerUVT.UpdateUVTransformation(shift, 0, Vector2.zero, Vector2.zero);
        }
Example #2
0
        void UpdateVelocityUV(bool updateDigital)
        {
            displaySpeed = Mathf.Lerp(displaySpeed, (float)vessel.srfSpeed, initializeFactor);
            float velShift = Mathf.Clamp(displaySpeed, 0, 1650) * velRulerCoefficient;

            Vector2 shift = new Vector2(-velShift, 0);

            velRulerUVT.UpdateUVTransformation(shift, 0, Vector2.zero, Vector2.zero);

            if (updateDigital)
            {
                spdNumberField.SetValue(Mathf.RoundToInt(displaySpeed));
            }
        }
Example #3
0
        void UpdateLadderUV()
        {
            float pitchShift = (pitch / 90) * (ladderUVT.textureSize.y / 2);

            Vector2 aoa = new Vector2(horizAoA, vertAoA);

            aoa = Quaternion.AngleAxis(roll, Vector3.forward) * aoa;

            float yawShift = Mathf.Clamp(aoa.x, -horizAoALimit, horizAoALimit) * horizAoACoefficient;

            yawShift = Mathf.Clamp(yawShift, -300, 300);

            Vector2 shift = new Vector2(yawShift, pitchShift);

            ladderUVT.UpdateUVTransformation(initialLadderOffset, -roll, 0.5f * ladderUVT.textureSize, shift);
        }
Example #4
0
        void UpdateAltUV(bool updateDigital)
        {
            float altShift = Mathf.Clamp(displayAlt, 0, 33000) * altRulerCoefficient;

            Vector2 shift = new Vector2(-altShift, 0);

            altRulerUVT.UpdateUVTransformation(shift, 0, Vector2.zero, Vector2.zero);

            if (displayRdrAlt)
            {
                rdrObject.SetActive(true);
                aslObject.SetActive(false);
            }
            else
            {
                rdrObject.SetActive(false);
                aslObject.SetActive(true);
            }

            if (updateDigital)
            {
                altNumberField.SetValue(Mathf.RoundToInt(displayAlt));
            }
        }