UnityEditor.Handles.DoConeFrustrumHandle C# (CSharp) Method

DoConeFrustrumHandle() static private method

static private DoConeFrustrumHandle ( Quaternion rotation, Vector3 position, Vector3 radiusAngleRange ) : Vector3
rotation UnityEngine.Quaternion
position Vector3
radiusAngleRange Vector3
return Vector3
        internal static Vector3 DoConeFrustrumHandle(Quaternion rotation, Vector3 position, Vector3 radiusAngleRange)
        {
            Vector3 d = (Vector3) (rotation * Vector3.forward);
            Vector3 vector2 = (Vector3) (rotation * Vector3.up);
            Vector3 vector3 = (Vector3) (rotation * Vector3.right);
            float x = radiusAngleRange.x;
            float y = radiusAngleRange.y;
            float z = radiusAngleRange.z;
            y = Mathf.Max(0f, y);
            bool changed = GUI.changed;
            z = SizeSlider(position, d, z);
            GUI.changed |= changed;
            changed = GUI.changed;
            GUI.changed = false;
            x = SizeSlider(position, vector2, x);
            x = SizeSlider(position, -vector2, x);
            x = SizeSlider(position, vector3, x);
            x = SizeSlider(position, -vector3, x);
            if (GUI.changed)
            {
                x = Mathf.Max(0f, x);
            }
            GUI.changed |= changed;
            changed = GUI.changed;
            GUI.changed = false;
            float r = Mathf.Min((float) 1000f, (float) (Mathf.Abs((float) (z * Mathf.Tan(0.01745329f * y))) + x));
            r = SizeSlider(position + ((Vector3) (d * z)), vector2, r);
            r = SizeSlider(position + ((Vector3) (d * z)), -vector2, r);
            r = SizeSlider(position + ((Vector3) (d * z)), vector3, r);
            r = SizeSlider(position + ((Vector3) (d * z)), -vector3, r);
            if (GUI.changed)
            {
                y = Mathf.Clamp((float) (57.29578f * Mathf.Atan((r - x) / Mathf.Abs(z))), (float) 0f, (float) 90f);
            }
            GUI.changed |= changed;
            if (x > 0f)
            {
                DrawWireDisc(position, d, x);
            }
            if (r > 0f)
            {
                DrawWireDisc(position + ((Vector3) (z * d)), d, r);
            }
            DrawLine(position + ((Vector3) (vector2 * x)), (Vector3) ((position + (d * z)) + (vector2 * r)));
            DrawLine(position - ((Vector3) (vector2 * x)), (Vector3) ((position + (d * z)) - (vector2 * r)));
            DrawLine(position + ((Vector3) (vector3 * x)), (Vector3) ((position + (d * z)) + (vector3 * r)));
            DrawLine(position - ((Vector3) (vector3 * x)), (Vector3) ((position + (d * z)) - (vector3 * r)));
            return new Vector3(x, y, z);
        }