override public Capture ForceEndCapture(InputState input, CaptureData data) { DrawSpaceCurveTool tool = context.ToolManager.GetActiveTool((int)data.which) as DrawSpaceCurveTool; tool.CancelDraw(); return(Capture.End); }
override public Capture UpdateCapture(InputState input, CaptureData data) { Frame3f worldFrame = (data.which == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame; DrawSpaceCurveTool tool = context.ToolManager.GetActiveTool((int)data.which) as DrawSpaceCurveTool; // [RMS] this is a hack for trigger+shoulder grab gesture...really need some way // to interrupt captures!! if ((data.which == CaptureSide.Left && input.bLeftShoulderPressed) || (data.which == CaptureSide.Right && input.bRightShoulderPressed)) { tool.CancelDraw(); return(Capture.End); } // this happens if we exit tool while in draw (cts or multi-click). We need to fail gracefully in those cases. if (tool == null) { return(Capture.End); } // this can happen if we called tool.EndDraw() somewhere else if (tool.InDraw == false) { return(Capture.End); } bool bReleased = (data.which == CaptureSide.Left) ? input.bLeftTriggerReleased : input.bRightTriggerReleased; if (tool.InputMode == DrawSpaceCurveTool.DrawMode.OnClick) { if (bReleased) { if (tool.UpdateDraw_Ray_MultiClick(worldFrame) == false) { tool.EndDraw(); return(Capture.End); } } else { tool.UpdateDrawPreview_Ray_MultiClick(worldFrame); } return(Capture.Continue); } else { tool.UpdateDraw_Ray_Continuous(worldFrame); if (bReleased) { tool.EndDraw(); return(Capture.End); } else { return(Capture.Continue); } } }