Exemplo n.º 1
0
        public override void OnPaint()
        {
            RealtimeCSG.Grid.RenderGrid();
            if (hoverBrushSurface == null)
            {
                return;
            }

            var brush       = hoverBrushSurface.brush;
            var brush_cache = InternalCSGModelManager.GetBrushCache(brush);

            if (brush_cache == null ||
                brush_cache.childData == null ||
                brush_cache.childData.ModelTransform == null)
            {
                return;
            }

            var highlight_surface = hoverBrushSurface.surfaceIndex;
            var highlight_texGen  = brush.Shape.Surfaces[highlight_surface].TexGenIndex;
            var model_translation = brush_cache.childData.Model.transform.position;
            var brush_translation = brush_cache.compareTransformation.modelLocalPosition + model_translation;

            CSGRenderer.DrawSelectedBrush(brush.brushID, brush.Shape,
                                          brush_translation, ColorSettings.WireframeOutline,
                                          highlight_texGen,
                                          false, ToolConstants.oldLineScale);
        }
Exemplo n.º 2
0
        public void OnPaint(SceneView sceneView)
        {
            RealtimeCSG.CSGGrid.RenderGrid(sceneView);

            if (hoverBrushSurface == null)
            {
                return;
            }

            var brush = hoverBrushSurface.brush;

            if (brush.ChildData == null ||
                !brush.ChildData.ModelTransform)
            {
                return;
            }

            var highlight_surface    = hoverBrushSurface.surfaceIndex;
            var brush_transformation = brush.compareTransformation.localToWorldMatrix;

            CSGRenderer.DrawSelectedBrush(brush.brushNodeID, brush.Shape,
                                          brush_transformation, ColorSettings.WireframeOutline,
                                          highlight_surface,
                                          false, GUIConstants.oldLineScale);
        }
Exemplo n.º 3
0
        public void OnPaint()
        {
            if (!hoverOnSelectedSurfaces)
            {
                var activetool = EditModeManager.ActiveTool as EditModeSurface;
                if (activetool != null)
                {
                    var selectedBrushSurfaces = activetool.GetSelectedSurfaces();
                    for (int i = 0; i < selectedBrushSurfaces.Length; i++)
                    {
                        var brush       = selectedBrushSurfaces[i].brush;
                        var brush_cache = InternalCSGModelManager.GetBrushCache(brush);
                        if (brush_cache == null)
                        {
                            return;
                        }

                        var highlight_surface = selectedBrushSurfaces[i].surfaceIndex;
                        var highlight_texGen  = brush.Shape.Surfaces[highlight_surface].TexGenIndex;
                        var brush_translation = brush_cache.compareTransformation.modelLocalPosition + brush_cache.childData.ModelTransform.position;

                        CSGRenderer.DrawTexGenOutlines(brush.brushID, brush.Shape,
                                                       brush_translation, highlight_texGen,
                                                       ColorSettings.SurfaceInnerStateColor[2],
                                                       ColorSettings.SurfaceOuterStateColor[2],
                                                       //ColorSettings.SurfaceTriangleStateColor[2],
                                                       ToolConstants.oldThinLineScale);
                    }
                }
            }

            if (hoverBrushSurfaces != null)
            {
                for (int i = 0; i < hoverBrushSurfaces.Length; i++)
                {
                    var brush       = hoverBrushSurfaces[i].brush;
                    var brush_cache = InternalCSGModelManager.GetBrushCache(brush);
                    if (brush_cache == null)
                    {
                        return;
                    }

                    var brush_translation = brush_cache.compareTransformation.modelLocalPosition + brush_cache.childData.ModelTransform.position;

                    var highlight_surface = hoverBrushSurfaces[i].surfaceIndex;
                    if (highlight_surface == -1 || selectAllSurfaces)
                    {
                        CSGRenderer.DrawSelectedBrush(brush.brushID, brush.Shape, brush_translation, ColorSettings.WireframeOutline, 0, selectAllSurfaces, ToolConstants.oldLineScale);
                    }
                    else
                    {
                        var highlight_texGen = brush.Shape.Surfaces[highlight_surface].TexGenIndex;
                        CSGRenderer.DrawSelectedBrush(brush.brushID, brush.Shape, brush_translation, ColorSettings.WireframeOutline, highlight_texGen, selectAllSurfaces, ToolConstants.oldLineScale);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public void OnPaint(SceneView sceneView)
        {
            if (hoverOverObject != null)
            {
                return;
            }

            if (!hoverOnSelectedSurfaces)
            {
                var activetool = EditModeManager.ActiveTool as EditModeSurface;
                if (activetool != null)
                {
                    var selectedBrushSurfaces = activetool.GetSelectedSurfaces();
                    for (int i = 0; i < selectedBrushSurfaces.Length; i++)
                    {
                        var brush = selectedBrushSurfaces[i].brush;

                        var highlight_surface    = selectedBrushSurfaces[i].surfaceIndex;
                        var brush_transformation = brush.compareTransformation.localToWorldMatrix;

                        CSGRenderer.DrawSurfaceOutlines(brush.brushNodeID, brush.Shape,
                                                        brush_transformation, highlight_surface,
                                                        ColorSettings.SurfaceInnerStateColor[2],
                                                        ColorSettings.SurfaceOuterStateColor[2],
                                                        GUIConstants.oldThinLineScale);
                    }
                }
            }

            if (hoverBrushSurfaces != null)
            {
                for (int i = 0; i < hoverBrushSurfaces.Length; i++)
                {
                    var brush = hoverBrushSurfaces[i].brush;

                    var brush_transformation = brush.compareTransformation.localToWorldMatrix;

                    var highlight_surface = hoverBrushSurfaces[i].surfaceIndex;
                    if (highlight_surface == -1 || selectAllSurfaces)
                    {
                        CSGRenderer.DrawSelectedBrush(brush.brushNodeID, brush.Shape, brush_transformation, ColorSettings.WireframeOutline, 0, selectAllSurfaces, GUIConstants.oldLineScale);
                    }
                    else
                    {
                        CSGRenderer.DrawSelectedBrush(brush.brushNodeID, brush.Shape, brush_transformation, ColorSettings.WireframeOutline, highlight_surface, selectAllSurfaces, GUIConstants.oldLineScale);
                    }
                }
            }
        }