override public Capture ForceEndCapture(InputState input, CaptureData data) { DrawPrimitivesTool tool = (context.ToolManager.ActiveRightTool as DrawPrimitivesTool); tool.CancelDraw(); return(Capture.End); }
override public Capture UpdateCapture(InputState input, CaptureData data) { DrawPrimitivesTool tool = context.ToolManager.GetActiveTool((int)data.which) as DrawPrimitivesTool; // [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); } Ray sideRay = (data.which == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay; Frame3f sideHandF = (data.which == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame; capture_data cap = data.custom_data as capture_data; tool.UpdateDraw_Spatial(sideRay, sideHandF, cap.nStep); bool bReleased = (data.which == CaptureSide.Left) ? input.bLeftTriggerReleased : input.bRightTriggerReleased; if (bReleased) { if ((cap.nStep + 1) < tool.Steps) { cap.nStep++; return(Capture.Continue); } else { tool.EndDraw(); return(Capture.End); } } else { return(Capture.Continue); } }