Пример #1
0
        public void Render(int viewIndex)
        {
            renderer.RenderCurrentClear();
            renderer.ApplyViewport();

            if (RuntimeConfiguration.doubleSided)
            {
                FaceCullState.Disabled.Execute();
                Material.LockFaceCullState = true;
            }

            Group hoverGroup       = (selectionManager != null) ? selectionManager.HoverGroup : null;
            Group manipulatorGroup = (manipulatorManager != null) ? manipulatorManager.ManipulatorGroup : null;
            var   selectedModels   = (selectionManager != null) ? selectionManager.Models : null;

            renderer.Requested.MeshMode = MeshMode.PolygonFill;
            foreach (var group in sceneManager.RenderGroups)
            {
                if (group.Visible == false)
                {
                    continue;
                }
                renderer.CurrentGroup = group;
                renderer.RenderGroup();
            }

            GL.Disable(EnableCap.PolygonOffsetFill);
            renderer.PartialGLStateResetToDefaults();

            if (selectionManager != null)
            {
                selectionManager.Render();
            }

            if (manipulatorManager != null)
            {
                manipulatorManager.Render();
            }

            if (RuntimeConfiguration.debugInfo && (selectionManager != null))
            {
                var physicsDrag = Services.Get <PhysicsDrag>();
                renderer.PartialGLStateResetToDefaults();
                if (
                    (selectionManager.HoverModel != null) ||
                    (selectedModels.Count > 0) ||
                    (
                        (physicsDrag != null) &&
                        (physicsDrag.Model != null)
                    )
                    )
                {
                    lineRenderer.Render(renderer.DefaultFrame);
                }
            }

            if (RuntimeConfiguration.doubleSided)
            {
                Material.LockFaceCullState = false;
            }

            // \todo fixme renderer.RenderLineRenderer(sceneManager.DebugLineRenderer, sceneManager.DebugFrame);
        }