Пример #1
0
        public Line(ConfigurableJoint joint, ParachuteAirfoil airfoil, int lineType)
        {
            if (joint != null)
            {
                _joint  = joint;
                _limit  = joint.linearLimit;
                _length = _limit.limit;
            }

            _airfoil  = airfoil;
            _lineType = lineType;

            switch (lineType)
            {
            case 1:
                _pullLength = 0.15f;
                break;

            case 2:
                _pullLength = 0.3f;
                break;

            case 3:
                _pullLength = 0.3f;
                break;
            }
        }
Пример #2
0
        private static void DrawHandle(ParachuteAirfoil foil, GizmoType gizmosType)
        {
            if (!Application.isPlaying)
            {
                return;
            }

            var text = string.Format("AoA: {0:0.0}deg\nSpd: {1:0.0}m/s\nLift: {2:0}N\nDrag: {3:0}N\n" +
                                     "Defl: {4:0.0},{5:0.0},{6:0.0},{7:0.0}",
                                     foil.AngleOfAttack,
                                     foil.AirSpeed,
                                     foil.LiftForce.magnitude,
                                     foil.DragForce.magnitude,
                                     foil.DeflectionInputs[0],
                                     foil.DeflectionInputs[1],
                                     foil.DeflectionInputs[2],
                                     foil.DeflectionInputs[3]);

            Handles.Label(foil.transform.position, text, GUI.skin.box);
        }