예제 #1
0
        public void OnRenderObject()
        {
            NavDebug.Draw(mHelper.mesh, mSelectedPoly, 1);

            if (mSegmentCount == 0)
            {
                return;
            }

            DebugDraw.SimpleMaterial.SetPass(0);

            GL.Begin(GL.LINES);
            GL.Color(QEUtil.SelectColor);

            for (int i = 0; i < mSegmentCount; i++)
            {
                int p = i * 2;

                GL.Vertex(mSegments[p + 0]);
                GL.Vertex(mSegments[p + 1]);

                if (mSegmentRefs[i] == 0)
                {
                    continue;
                }

                Vector2 a = new Vector2(mSegments[p + 0].x, mSegments[p + 0].z);
                Vector2 b = new Vector2(mSegments[p + 1].x, mSegments[p + 1].z);

                Vector2 norm2 = Line2.GetNormalAB(a, b);
                Vector3 norm3 = new Vector3(norm2.x, 0, norm2.y) * -0.25f;

                Vector3 mid = new Vector3((a.x + b.x) / 2
                                          , (mSegments[p + 0].y + mSegments[p + 1].y) / 2
                                          , (a.y + b.y) / 2);

                DebugDraw.AppendArrow(mid, mid + norm3, 0, QEUtil.HeadScaleSm);
            }

            GL.End();
        }