NodeEditorFramework.Utilities.RTEditorGUI.CalculateBezierSegmentCount(UnityEngine.Vector2, UnityEngine.Vector2, UnityEngine.Vector2, UnityEngine.Vector2)

Here are the examples of the csharp api NodeEditorFramework.Utilities.RTEditorGUI.CalculateBezierSegmentCount(UnityEngine.Vector2, UnityEngine.Vector2, UnityEngine.Vector2, UnityEngine.Vector2) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 View Source File : RTEditorGUI.cs
License : MIT License
Project Creator : virror

public static void DrawBezier (Vector2 startPos, Vector2 endPos, Vector2 startTan, Vector2 endTan, Color col, Texture2D tex, float width = 1)
		{
			if (Event.current.type != EventType.Repaint)
				return;

			// Own Bezier Formula
			// Slower than handles because of the horrendous amount of calls into the native api

			// Calculate optimal segment count
			int segmentCount = CalculateBezierSegmentCount (startPos, endPos, startTan, endTan);
			// Draw bezier with calculated segment count
			DrawBezier (startPos, endPos, startTan, endTan, col, tex, segmentCount, width);
		}

19 View Source File : RTEditorGUI.cs
License : MIT License
Project Creator : wqaetly

public static void DrawBezier (Vector2 startPos, Vector2 endPos, Vector2 startTan, Vector2 endTan, Color col, Texture2D tex, float width = 1)
		{
			if (Event.current.type != EventType.Repaint)
				return;

			Rect clippingRect = GUIScaleUtility.getTopRect;
			clippingRect.x = clippingRect.y = 0;
			Rect bounds = new Rect(Mathf.Min(startPos.x, endPos.x), Mathf.Min(startPos.y, endPos.y), 
								Mathf.Abs(startPos.x - endPos.x), Mathf.Abs(startPos.y - endPos.y));
			if (!bounds.Overlaps(clippingRect))
				return;

			// Own Bezier Formula
			// Slower than handles because of the horrendous amount of calls into the native api

			// Calculate optimal segment count
			int segmentCount = CalculateBezierSegmentCount (startPos, endPos, startTan, endTan);
			// Draw bezier with calculated segment count
			DrawBezier (startPos, endPos, startTan, endTan, col, tex, segmentCount, width);
		}