void OnDrawing(Vector3 cumulativeDelta, Vector3 headPosition) { if (rect != null) { Vector3 move = cumulativeDelta - manipulationDelta; Vector3 handPosition; if (GazeGestureUtils.GetManipulationHandPosition(out handPosition)) { Vector3 fromHeadToModel = myPos - headPosition; Vector3 fromHeadToHand = handPosition - headPosition; float moveAmplifier = fromHeadToModel.magnitude / fromHeadToHand.magnitude; if (moveAmplifier > 1) { move *= moveAmplifier; } } myPos += move; if (!startDraw) { startPoint = MathUtilsExt.ProjectPointOnPlane(normal, myPos, myPos); endPoint = startPoint; ////???? AHMAD FIXME startDraw = true; } CursorManager.Instance.ActiveCursor.transform.position = myPos; //endPoint = myPos; endPoint = MathUtilsExt.ProjectPointOnPlane(normal, startPoint, myPos); //startPoint.z= endPoint.z; endPoint.z = startPoint.z; debug.text = "Start: " + startPoint.ToString(); debug.text += "\nEnd : " + endPoint.ToString(); debug.text += "\nFWD : " + Camera.main.transform.forward; rect.SetPosition(0, startPoint); rect.SetPosition(1, new Vector3(endPoint.x, startPoint.y, startPoint.z)); rect.SetPosition(2, endPoint); rect.SetPosition(3, new Vector3(startPoint.x, endPoint.y, startPoint.z)); } else { StartDrawing(cumulativeDelta, headPosition); } manipulationDelta = cumulativeDelta; }