Exemplo n.º 1
0
        public override void OnGizmoRender(Camera camera)
        {
            bool multipleRenderCams = RTGizmosEngine.Get.NumRenderCameras > 1;

            if (multipleRenderCams)
            {
                _mvAxesSliders.ApplyZoomFactor(camera);
                if (!_isMvVertexSnapEnabled && !_is2DModeEnabled)
                {
                    _mvDblSliders.ApplyZoomFactor(camera);
                    PlaceMvDblSlidersInSliderPlanes(camera);
                }

                Update2DGizmoPosition();
                if (_is2DModeEnabled)
                {
                    Update2DModeHandlePositions();
                }

                _rtMidCap.ApplyZoomFactor(camera);
                _rtAxesSliders.ApplyZoomFactor(camera);
                if (_rtCamLookSlider.IsBorderVisible)
                {
                    UpdateRtCamLookSlider(camera);
                }

                _scMidCap.ApplyZoomFactor(camera);
            }

            _rtXSlider.Render(camera);
            _rtYSlider.Render(camera);
            _rtZSlider.Render(camera);
            _rtMidCap.Render(camera);

            var sortedSliders = _mvAxesSliders.GetRenderSortedSliders(camera);

            foreach (var slider in sortedSliders)
            {
                slider.Render(camera);
            }

            _rtCamLookSlider.Render(camera);
            _mvXYSlider.Render(camera);
            _mvYZSlider.Render(camera);
            _mvZXSlider.Render(camera);
            _scMidCap.Render(camera);

            _mvVertSnapCap.Render(camera);
            _mv2DModeSliders.Render(camera);
            _mv2DModeDblSlider.Render(camera);

            if (LookAndFeel3D.IsScScaleGuideVisible && Gizmo.IsDragged && IsScaleHandle(Gizmo.DragHandleId))
            {
                _scScaleGuide.Render(GameObjectEx.FilterParentsOnly(_scScaleGuideTargetObjects), camera);
            }
        }
Exemplo n.º 2
0
        public override void OnGizmoRender(Camera camera)
        {
            var boxWireMaterial = GizmoLineMaterial.Get;

            boxWireMaterial.ResetValuesToSensibleDefaults();
            boxWireMaterial.SetColor(LookAndFeel3D.BoxWireColor);
            boxWireMaterial.SetPass(0);
            GraphicsEx.DrawWireBox(new OBB(BoxCenter, _boxSize, BoxRotation));

            if (RTGizmosEngine.Get.NumRenderCameras > 1)
            {
                UpdateTickPositions();
            }

            _leftTick.Render(camera);
            _rightTick.Render(camera);
            _topTick.Render(camera);
            _bottomTick.Render(camera);
            _frontTick.Render(camera);
            _backTick.Render(camera);
        }
Exemplo n.º 3
0
        public override void OnGizmoRender(Camera camera)
        {
            bool multipleRenderCams = RTGizmosEngine.Get.NumRenderCameras > 1;

            if (multipleRenderCams)
            {
                _axesSliders.ApplyZoomFactor(camera);
                if (_midCap.IsVisible)
                {
                    _midCap.ApplyZoomFactor(camera);
                }
                if (!_isVertexSnapEnabled && !_is2DModeEnabled)
                {
                    _dblSliders.ApplyZoomFactor(camera);
                    PlaceDblSlidersInSliderPlanes(camera);
                }

                Update2DGizmoPosition();
                if (_is2DModeEnabled)
                {
                    Update2DModeHandlePositions();
                }
            }

            List <GizmoLineSlider3D> sortedSliders = _axesSliders.GetRenderSortedSliders(camera);

            foreach (GizmoLineSlider3D slider in sortedSliders)
            {
                slider.Render(camera);
            }

            _midCap.Render(camera);
            _xySlider.Render(camera);
            _yzSlider.Render(camera);
            _zxSlider.Render(camera);

            _vertSnapCap.Render(camera);
            _2DModeSliders.Render(camera);
            _2DModeDblSlider.Render(camera);
        }
Exemplo n.º 4
0
        public override void Render(Camera camera)
        {
            if (!IsVisible && !Is2DCapVisible)
            {
                return;
            }

            if (LookAndFeel.IsRotationArcVisible && IsRotating)
            {
                _rotationArc.RotationAngle = _rotationDrag.TotalRotation;
                _rotationArc.Render(LookAndFeel.RotationArcLookAndFeel, camera);
            }

            if (IsVisible)
            {
                if (LookAndFeel.LineType == GizmoLine2DType.Thin ||
                    LookAndFeel.FillMode == GizmoFillMode2D.FilledAndBorder ||
                    LookAndFeel.FillMode == GizmoFillMode2D.Filled)
                {
                    Color fillColor = new Color();
                    if (!_overrideFillColor.IsActive)
                    {
                        fillColor = LookAndFeel.Color;
                        if (Gizmo.HoverHandleId == HandleId)
                        {
                            fillColor = LookAndFeel.HoveredColor;
                        }
                    }
                    else
                    {
                        fillColor = _overrideFillColor.Color;
                    }

                    GizmoSolidMaterial solidMaterial = GizmoSolidMaterial.Get;
                    solidMaterial.ResetValuesToSensibleDefaults();
                    solidMaterial.SetLit(false);
                    solidMaterial.SetColor(fillColor);
                    solidMaterial.SetPass(0);

                    Handle.Render2DSolid(camera);
                }

                if (LookAndFeel.LineType != GizmoLine2DType.Thin &&
                    (LookAndFeel.FillMode == GizmoFillMode2D.FilledAndBorder || LookAndFeel.FillMode == GizmoFillMode2D.Border))
                {
                    Color borderColor = new Color();
                    if (!_overrideFillColor.IsActive)
                    {
                        borderColor = LookAndFeel.BorderColor;
                        if (Gizmo.HoverHandleId == HandleId)
                        {
                            borderColor = LookAndFeel.HoveredBorderColor;
                        }
                    }
                    else
                    {
                        borderColor = _overrideBorderColor.Color;
                    }

                    GizmoLineMaterial lineMaterial = GizmoLineMaterial.Get;
                    lineMaterial.ResetValuesToSensibleDefaults();
                    lineMaterial.SetColor(borderColor);
                    lineMaterial.SetPass(0);

                    Handle.Render2DWire(camera);
                }
            }

            _cap2D.Render(camera);
        }