Esempio n. 1
0
        override public Capture BeginCapture(InputState input, CaptureSide eSide)
        {
            SORayHit rayHit;

            if (SceneUtil.FindNearestRayIntersection(tool.Targets, WorldRay(input), out rayHit))
            {
                return(Capture.Begin(this));
            }
            return(Capture.Ignore);
        }
Esempio n. 2
0
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (context.ToolManager.ActiveRightTool != tool)
     {
         return(CaptureRequest.Ignore);
     }
     if (Pressed(input))
     {
         SORayHit rayHit;
         if (SceneUtil.FindNearestRayIntersection(tool.Targets, WorldRay(input), out rayHit))
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
Esempio n. 3
0
 override public Capture UpdateCapture(InputState input, CaptureData data)
 {
     if (Released(input))
     {
         SORayHit rayHit;
         if (SceneUtil.FindNearestRayIntersection(tool.Targets, WorldRay(input), out rayHit))
         {
             Frame3f clickW = new Frame3f(rayHit.hitPos, rayHit.hitNormal);
             tool.Scene.Context.RegisterNextFrameAction(() => {
                 tool.SetPlaneFromSingleClick(clickW, input.bShiftKeyDown);
             });
         }
         return(Capture.End);
     }
     else
     {
         return(Capture.Continue);
     }
 }