Beispiel #1
0
        protected virtual void OnRenderObject()
        {
            if (!CanRender)
            {
                return;
            }

            var cam          = Camera.current;
            var view         = cam.worldToCameraMatrix;
            var layerToWorld = layer.LayerToWorld.Matrix;

            var worldCenter = layerToWorld.MultiplyPoint3x4(Vector3.zero);
            var width       = Mathf.Min(
                debugLineWidth * cam.GetHandleSize(worldCenter),
                0.8f * borderThickness);

            var c = debugColor;

            gl.CurrentColor = c;
            gl.DrawQuad(view * layerToWorld * innerBounds.Model, width);

            gl.CurrentColor = 0.5f * c;
            gl.DrawQuad(view * layerToWorld * outerBounds.Model, width);

            if (debugFill)
            {
                gl.CurrentColor = 0.5f * c;
                gl.FillQuad(view * layerToWorld * innerBounds.Model);
            }
        }
Beispiel #2
0
 public void DrawQuad(GLFigure f)
 {
     if ((renderType & Data.RenderTypeEnum.Fill) != 0)
     {
         f.FillQuad(target.position, Camera.main.transform.rotation, size, bodyColor);
     }
     if ((renderType & Data.RenderTypeEnum.Line) != 0)
     {
         f.DrawQuad(target.position, Camera.main.transform.rotation, size, lineColor);
     }
 }
Beispiel #3
0
        private void OnRenderObject()
        {
            if (model == null)
            {
                return;
            }

            var rot   = layerPoints.transform.rotation;
            var size  = 0.1f * Vector2.one;
            var color = Color.magenta;

            foreach (var p in model)
            {
                var uv       = (Vector2)p.position;
                var worldPos = layerPoints.LocalToWorld.TransformPoint(
                    layerPoints.UvToLocalPos(uv, 0f));
                fig.FillQuad(worldPos, rot, size, color);
            }
        }