Ejemplo n.º 1
0
        public void DrawQuery()
        {
            if (shape == null)
            {
                return;
            }



            ConvexCircle circle = shape as ConvexCircle;

            Gizmos.color = Color.yellow;
            float   cx       = circle.Radius * Mathf.Cos(0);
            float   cy       = circle.Radius * Mathf.Sin(0);
            Vector2 cpos     = circle.Center + new Vector2(cx, cy);
            Vector2 cnewPos  = cpos;
            Vector2 clastPos = cpos;

            for (float theta = 0.1f; theta < Mathf.PI * 2.0f; theta += 0.1f)
            {
                cx      = circle.Radius * Mathf.Cos(theta);
                cy      = circle.Radius * Mathf.Sin(theta);
                cnewPos = circle.Center + new Vector2(cx, cy);
                Gizmos.DrawLine(cpos, cnewPos);
                cpos = cnewPos;
            }
            Gizmos.DrawLine(cpos, clastPos);
        }
Ejemplo n.º 2
0
        protected override void AgentAwake()
        {
            base.AgentAwake();

            circle = new ConvexCircle(new Vector2(agentTransform.position.x, agentTransform.position.y), radius);
        }
Ejemplo n.º 3
0
 public QtCircleQuery(Vector2 center, float radius)
 {
     shape = new ConvexCircle(center, radius);
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     c1 = new ConvexCircle(circle1Position, c1Radius);
     c2 = new ConvexCircle(circle2Position, c2Radius);
 }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     rect1  = new ConvexRect(rectCenter, rectSize);
     circle = new ConvexCircle(circlePosition, cRadius);
 }