public void Render(GizmoRotationArc3DLookAndFeel lookAndFeel) { _arc.ForceShortestArc = lookAndFeel.UseShortestRotation; if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.Area) != 0) { GizmoSolidMaterial solidMaterial = GizmoSolidMaterial.Get; solidMaterial.ResetValuesToSensibleDefaults(); solidMaterial.SetCullModeOff(); solidMaterial.SetLit(false); solidMaterial.SetColor(lookAndFeel.Color); solidMaterial.SetPass(0); _arc.RenderSolid(); } ArcShape3D.WireRenderFlags arcWireFlags = ArcShape3D.WireRenderFlags.None; if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.ArcBorder) != 0) { arcWireFlags |= ArcShape3D.WireRenderFlags.ArcBorder; } if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.ExtremitiesBorder) != 0) { arcWireFlags |= ArcShape3D.WireRenderFlags.ExtremitiesBorder; } GizmoLineMaterial lineMaterial = GizmoLineMaterial.Get; lineMaterial.ResetValuesToSensibleDefaults(); lineMaterial.SetColor(lookAndFeel.BorderColor); lineMaterial.SetPass(0); _arc.RenderWire(); }
public override void Render(Camera camera) { if (IsRotating && LookAndFeel.PlaneType == GizmoPlane3DType.Circle && LookAndFeel.IsRotationArcVisible) { _rotationArc.RotationAngle = TotalDragRotation; _rotationArc.Radius = GetRealCircleRadius(GetZoomFactor(camera)); _rotationArc.Render(LookAndFeel.RotationArcLookAndFeel); } if (IsVisible) { Color color = new Color(); if (!IsHovered) { color = LookAndFeel.Color; } else { color = LookAndFeel.HoveredColor; } GizmoSolidMaterial solidMaterial = GizmoSolidMaterial.Get; solidMaterial.ResetValuesToSensibleDefaults(); solidMaterial.SetCullModeOff(); solidMaterial.SetLit(LookAndFeel.ShadeMode == GizmoShadeMode.Lit); if (solidMaterial.IsLit) { solidMaterial.SetLightDirection(camera.transform.forward); } solidMaterial.SetColor(color); solidMaterial.SetPass(0); if (LookAndFeel.PlaneType == GizmoPlane3DType.Quad) { Handle.Render3DSolid(_quadIndex); } else if (LookAndFeel.PlaneType == GizmoPlane3DType.RATriangle) { Handle.Render3DSolid(_raTriangleIndex); } else if (LookAndFeel.PlaneType == GizmoPlane3DType.Circle) { Handle.Render3DSolid(_circleIndex); } } if (LookAndFeel.PlaneType == GizmoPlane3DType.Quad) { _quadBorder.Render(camera); } else if (LookAndFeel.PlaneType == GizmoPlane3DType.RATriangle) { _raTriangleBorder.Render(camera); } else if (LookAndFeel.PlaneType == GizmoPlane3DType.Circle) { _circleBorder.Render(camera); } }
public void Render(GizmoRotationArc2DLookAndFeel lookAndFeel, Camera camera) { if (_type == ArcType.Standard || _projectionPoly == null) { _arc.ForceShortestArc = lookAndFeel.UseShortestRotation; if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.Area) != 0) { GizmoSolidMaterial solidMaterial = GizmoSolidMaterial.Get; solidMaterial.ResetValuesToSensibleDefaults(); solidMaterial.SetCullModeOff(); solidMaterial.SetLit(false); solidMaterial.SetColor(lookAndFeel.Color); solidMaterial.SetPass(0); _arc.RenderArea(camera); } ArcShape2D.BorderRenderFlags arcWireFlags = ArcShape2D.BorderRenderFlags.None; if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.ArcBorder) != 0) { arcWireFlags |= ArcShape2D.BorderRenderFlags.ArcBorder; } if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.ExtremitiesBorder) != 0) { arcWireFlags |= ArcShape2D.BorderRenderFlags.ExtremitiesBorder; } GizmoLineMaterial lineMaterial = GizmoLineMaterial.Get; lineMaterial.ResetValuesToSensibleDefaults(); lineMaterial.SetColor(lookAndFeel.BorderColor); lineMaterial.SetPass(0); _arc.RenderBorder(camera); } else if (_type == ArcType.PolyProjected && _projectionPoly != null) { var arcBorderPoints = PrimitiveFactory.Generate2DArcBorderPoints(_arc.Origin, _arc.StartPoint, _arc.DegreeAngleFromStart, lookAndFeel.UseShortestRotation, NumProjectedPoints); arcBorderPoints = PrimitiveFactory.ProjectArcPointsOnPoly2DBorder(_arc.Origin, arcBorderPoints, _projectionPoly.GetPoints()); if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.Area) != 0) { GizmoSolidMaterial solidMaterial = GizmoSolidMaterial.Get; solidMaterial.ResetValuesToSensibleDefaults(); solidMaterial.SetCullModeOff(); solidMaterial.SetLit(false); solidMaterial.SetColor(lookAndFeel.Color); solidMaterial.SetPass(0); GLRenderer.DrawTriangleFan2D(_arc.Origin, arcBorderPoints, camera); } if (lookAndFeel.FillFlags != GizmoRotationArcFillFlags.None) { GizmoLineMaterial lineMaterial = GizmoLineMaterial.Get; lineMaterial.ResetValuesToSensibleDefaults(); lineMaterial.SetColor(lookAndFeel.BorderColor); lineMaterial.SetPass(0); if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.ArcBorder) != 0) { GLRenderer.DrawLines2D(arcBorderPoints, camera); } if ((lookAndFeel.FillFlags & GizmoRotationArcFillFlags.ExtremitiesBorder) != 0) { GLRenderer.DrawLines2D(new List <Vector2> { _arc.Origin, arcBorderPoints[0], _arc.Origin, arcBorderPoints[arcBorderPoints.Count - 1] }, camera); } } } }