private void GlDrawCircle(Vector3 center, float radius, CirclePlane plane, bool dotted = false, int segments = 32)
        {
            for (int i = 0; i < segments; i++)
            {
                float x = radius * Mathf.Sin(Mathf.Deg2Rad * (((float)i / segments) * 360.0f));
                float y = radius * Mathf.Cos(Mathf.Deg2Rad * (((float)i / segments) * 360.0f));
                switch (plane)
                {
                case CirclePlane.X: GL.Vertex(center + new Vector3(x, y, 0)); break;

                case CirclePlane.Y: GL.Vertex(center + new Vector3(x, 0, y)); break;

                case CirclePlane.Z: GL.Vertex(center + new Vector3(0, x, y)); break;
                }

                if (!dotted)
                {
                    x = radius * Mathf.Sin(Mathf.Deg2Rad * (((float)(i + 1) / segments) * 360.0f));
                    y = radius * Mathf.Cos(Mathf.Deg2Rad * (((float)(i + 1) / segments) * 360.0f));
                    switch (plane)
                    {
                    case CirclePlane.X: GL.Vertex(center + new Vector3(x, y, 0)); break;

                    case CirclePlane.Y: GL.Vertex(center + new Vector3(x, 0, y)); break;

                    case CirclePlane.Z: GL.Vertex(center + new Vector3(0, x, y)); break;
                    }
                }
            }
        }
Пример #2
0
 public Transition(PathType pType, double s, CirclePlane cPlane, double p, int dInt, int uniquePoints, bool[] nlockValues)
 {
     pathType                 = pType;
     speed                    = s;
     circlePlane              = cPlane;
     circleRadius             = p;
     directionInt             = dInt;
     uniqueIntermediatePoints = uniquePoints;
     lockValues               = nlockValues;
 }