override public Capture UpdateCapture(InputState input, CaptureData data) { DrawPrimitivesTool tool = (context.ToolManager.ActiveRightTool as DrawPrimitivesTool); capture_data cap = data.custom_data as capture_data; tool.UpdateDraw_Ray(input.vMouseWorldRay, cap.nStep); if (input.bLeftMouseReleased) { if ((cap.nStep + 1) < tool.Steps) { cap.nStep++; return(Capture.Continue); } else { tool.EndDraw(); return(Capture.End); } } else { return(Capture.Continue); } }
override public Capture ForceEndCapture(InputState input, CaptureData data) { DrawPrimitivesTool tool = context.ToolManager.GetActiveTool((int)data.which) as DrawPrimitivesTool; tool.CancelDraw(); return(Capture.End); }
override public Capture ForceEndCapture(InputState input, CaptureData data) { DrawPrimitivesTool tool = (context.ToolManager.ActiveRightTool as DrawPrimitivesTool); tool.CancelDraw(); return(Capture.End); }
override public Capture BeginCapture(InputState input, CaptureSide eSide) { DrawPrimitivesTool tool = (context.ToolManager.ActiveRightTool as DrawPrimitivesTool); AnyRayHit rayHit; if (context.Scene.FindSceneRayIntersection(input.vMouseWorldRay, out rayHit)) { tool.BeginDraw_Ray(input.vMouseWorldRay, rayHit, 0); return(Capture.Begin(this, CaptureSide.Any, new capture_data() { nStep = 0 })); } return(Capture.Ignore); }
override public Capture BeginCapture(InputState input, CaptureSide eSide) { Ray sideRay = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay; Frame3f sideHandF = (eSide == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame; DrawPrimitivesTool tool = context.ToolManager.GetActiveTool((int)eSide) as DrawPrimitivesTool; AnyRayHit rayHit; if (context.Scene.FindSceneRayIntersection(sideRay, out rayHit)) { tool.BeginDraw_Spatial(sideRay, rayHit, sideHandF, 0); return(Capture.Begin(this, eSide, new capture_data() { nStep = 0 })); } return(Capture.Ignore); }
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); } }