void OnRenderObject()
    {
        if (!Application.isPlaying)
        {
            return;
        }

        if (!Visualise)
        {
            return;
        }

        if (!Setup())
        {
            return;
        }

        if (Background.GetSize() != Vector2.zero)
        {
            UltiDraw.Begin();
            UltiDraw.DrawGUIRectangle(Background.GetPosition(), Background.GetSize(), Color.white);
            UltiDraw.End();
        }

        switch (Mode)
        {
        case MODE.Function:
            DrawFunction();
            break;

        case MODE.Graph:
            DrawGraph();
            break;
        }
    }
Example #2
0
 public override void GUI(Camera canvas = null)
 {
     if (DrawGUI)
     {
         UltiDraw.Begin(canvas);
         UltiDraw.OnGUILabel(Rect.GetCenter() + new Vector2(0f, 0.075f), Rect.GetSize(), 0.0175f, "Actions", UltiDraw.Black);
         Color[] colors = UltiDraw.GetRainbowColors(Styles.Length);
         for (int i = 0; i < Styles.Length; i++)
         {
             float value = Values[Pivot][i];
             UltiDraw.OnGUILabel(new Vector2(Rect.X, value.Normalize(0f, 1f, Rect.Y - Rect.H / 2f, Rect.Y + Rect.H / 2f)), Rect.GetSize(), 0.0175f, Styles[i], colors[i]);
         }
         UltiDraw.End();
     }
 }
Example #3
0
 public override void GUI(Camera canvas = null)
 {
     if (DrawGUI)
     {
         UltiDraw.Begin(canvas);
         UltiDraw.OnGUILabel(Rect.GetCenter() + new Vector2(0f, 0.13f), Rect.GetSize(), 0.0175f, "Contacts", UltiDraw.Black);
         UltiDraw.End();
     }
 }
Example #4
0
    private void DrawFunction()
    {
        UltiDraw.Begin();
        Color[]        colors    = UltiDraw.GetRainbowColors(Values.Length);
        List <float[]> functions = new List <float[]>();

        for (int i = 0; i < Values.Length; i++)
        {
            functions.Add(Values[i].ToArray());
        }
        UltiDraw.PlotFunctions(Rect.GetCenter(), Rect.GetSize(), functions.ToArray(), UltiDraw.Dimension.Y, yMin: 0f, yMax: 1f, thickness: 0.001f);
        UltiDraw.End();
    }
Example #5
0
    public void DrawDistribution(Color color, UltiDraw.GUIRect rect)
    {
        float max = Distances.Max();

        float[] distances = new float[Distances.Length];
        for (int i = 0; i < distances.Length; i++)
        {
            distances[i] = Distances[i].Normalize(0f, max, 1f, 0f);
        }

        UltiDraw.Begin();
        UltiDraw.PlotFunction(rect.GetCenter(), rect.GetSize(), distances, yMin: 0f, yMax: 1f, backgroundColor: UltiDraw.White, lineColor: color);
        UltiDraw.End();
    }
    public void DrawDistribution(Color color, UltiDraw.GUIRect rect)
    {
        float max = Distances.Max();

        float[] distances = new float[Distances.Length];
        for (int i = 0; i < distances.Length; i++)
        {
            distances[i] = Utility.Normalise(Distances[i], 0f, max, 1f, 0f);
        }

        UltiDraw.Begin();
        UltiDraw.DrawGUIFunction(rect.GetPosition(), rect.GetSize(), distances, 0f, 1f, UltiDraw.White, color);
        UltiDraw.End();
    }
    private void DrawFunction()
    {
        UltiDraw.Begin();
        Color[]        colors    = UltiDraw.GetRainbowColors(Values.Length);
        List <float[]> functions = new List <float[]>();
        float          min       = float.MaxValue;
        float          max       = float.MinValue;

        for (int i = 0; i < Values.Length; i++)
        {
            float[] values = Values[i].ToArray();
            min = Mathf.Min(values.Min(), min);
            max = Mathf.Max(values.Max(), max);
            functions.Add(values);
        }
        UltiDraw.DrawGUIFunctions(Rect.GetPosition(), Rect.GetSize(), functions, min, max, 0.001f, UltiDraw.White, colors, 0.001f, UltiDraw.DarkGrey);
        UltiDraw.End();
    }
Example #8
0
 public void DrawDistribution(Color color, UltiDraw.GUIRect rect)
 {
     UltiDraw.Begin();
     UltiDraw.PlotFunction(rect.GetCenter(), rect.GetSize(), Occupancies, yMin: 0f, yMax: 1f, backgroundColor: UltiDraw.White, lineColor: color);
     UltiDraw.End();
 }
Example #9
0
 public void DrawDistribution(Color color, UltiDraw.GUIRect rect)
 {
     UltiDraw.Begin();
     UltiDraw.DrawGUIFunction(rect.GetPosition(), rect.GetSize(), Occupancies, 0f, 1f, UltiDraw.White, color);
     UltiDraw.End();
 }