OculusSampleFramework.RayToolView.GetPointOnBezierCurve(UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, float)

Here are the examples of the csharp api OculusSampleFramework.RayToolView.GetPointOnBezierCurve(UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, float) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : RayToolView.cs
License : MIT License
Project Creator : IanPhilips

private void Update()
		{
			var myPosition = InteractableTool.ToolTransform.position;
			var myForward = InteractableTool.ToolTransform.forward;

			var targetPosition = _focusedTransform != null
			  ? _focusedTransform.position
			  : myPosition + myForward * DEFAULT_RAY_CAST_DISTANCE;
			var targetVector = targetPosition - myPosition;
			var targetDistance = targetVector.magnitude;
			var p0 = myPosition;
			// make points in between based on my forward as opposed to targetvector
			// this way the curve "bends" toward to target
			var p1 = myPosition + myForward * targetDistance * 0.3333333f;
			var p2 = myPosition + myForward * targetDistance * 0.6666667f;
			var p3 = targetPosition;
			for (int i = 0; i < NUM_RAY_LINE_POSITIONS; i++)
			{
				linePositions[i] = GetPointOnBezierCurve(p0, p1, p2, p3, i / 25.0f);
			}

			_lineRenderer.SetPositions(linePositions);
			_targetTransform.position = targetPosition;
		}