Example #1
0
 public override CaptureRequest WantsCapture(InputState input)
 {
     if ((input.bYButtonPressed ^ input.bBButtonPressed) &&
         input.LeftCaptureActive == false &&
         input.RightCaptureActive == false)
     {
         CaptureSide eSide = (input.bYButtonPressed) ? CaptureSide.Left : CaptureSide.Right;
         return(CaptureRequest.Begin(this, eSide));
     }
     return(CaptureRequest.Ignore);
 }
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (input.bRightMousePressed)
     {
         if (WantsCaptureF(input))
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #3
0
 public override CaptureRequest WantsCapture(InputState input)
 {
     if (scene.Scene.Selected.Count > 0 && input.bLeftTriggerPressed)
     {
         SORayHit rayHit;
         if (scene.Scene.FindSORayIntersection(input.vGamepadWorldRay, out rayHit) == false)
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #4
0
        public override CaptureRequest WantsCapture(InputState input)
        {
            if (input.bHaveTouch == false)
            {
                return(CaptureRequest.Ignore);
            }

            if (input.bTouchPressed)
            {
                return(CaptureRequest.Begin(this, CaptureSide.Any));
            }
            return(CaptureRequest.Ignore);
        }
Example #5
0
 public override CaptureRequest WantsCapture(InputState input)
 {
     selectSO = null;
     if (input.bLeftTriggerPressed || input.bAButtonPressed)
     {
         SORayHit rayHit;
         if (scene.Scene.FindSORayIntersection(input.vGamepadWorldRay, out rayHit))
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
 override public CaptureRequest WantsCapture(InputState input)
 {
     if ((input.bLeftTriggerPressed && input.LeftCaptureActive == false) ^
         (input.bRightTriggerPressed && input.RightCaptureActive == false))
     {
         CaptureSide eSide = (input.bLeftTriggerPressed) ? CaptureSide.Left : CaptureSide.Right;
         if (WantsCaptureF(input, eSide))
         {
             return(CaptureRequest.Begin(this, eSide));
         }
     }
     return(CaptureRequest.Ignore);
 }
 public override CaptureRequest WantsCapture(InputState input)
 {
     selectSO = null;
     if (input.bLeftMousePressed)
     {
         SORayHit rayHit;
         if (FindSORayIntersection(input.vMouseWorldRay, out rayHit))
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #8
0
 public void CollectWantsCapture(InputState input, List <CaptureRequest> result)
 {
     foreach (BehaviorInfo binfo in Behaviors)
     {
         if (supports_input_type(binfo.b, input))
         {
             CaptureRequest req = binfo.b.WantsCapture(input);
             if (req.type != CaptureRequestType.Ignore)
             {
                 result.Add(req);
             }
         }
     }
 }
Example #9
0
 public override CaptureRequest WantsCapture(InputState input)
 {
     if (input.bLeftTriggerPressed ^ input.bRightTriggerPressed)
     {
         CaptureSide eSide  = (input.bLeftTriggerPressed) ? CaptureSide.Left : CaptureSide.Right;
         Ray3f       useRay = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
         SORayHit    rayHit;
         if (scene.Scene.FindSORayIntersection(useRay, out rayHit))
         {
             return(CaptureRequest.Begin(this, eSide));
         }
     }
     return(CaptureRequest.Ignore);
 }
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (input.bLeftTriggerPressed ^ input.bRightTriggerPressed)
     {
         CaptureSide eSide = (input.bLeftTriggerPressed) ? CaptureSide.Left : CaptureSide.Right;
         ITool       tool  = context.ToolManager.GetActiveTool((int)eSide);
         if (tool != null && tool is DrawSpaceCurveTool)
         {
             DrawSpaceCurveTool drawTool = tool as DrawSpaceCurveTool;
             return(CaptureRequest.Begin(this, eSide));
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #11
0
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (context.ToolManager.ActiveRightTool == null || !(context.ToolManager.ActiveRightTool is BaseSingleClickTool))
     {
         return(CaptureRequest.Ignore);
     }
     if (Pressed(input))
     {
         SORayHit rayHit;
         if (context.Scene.FindSORayIntersection(WorldRay(input), out rayHit, ObjectFilterF))
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #12
0
        public override CaptureRequest WantsCapture(InputState input)
        {
            // [RMS] ugh hack to prevent this from capturing when triggers are down
            if (input.bLeftTriggerDown || input.bRightTriggerDown)
            {
                return(CaptureRequest.Ignore);
            }

            if ((input.bLeftShoulderPressed && input.bRightShoulderPressed) ||
                (input.bLeftShoulderPressed && input.bRightShoulderDown) ||
                (input.bLeftShoulderDown && input.bRightShoulderPressed))
            {
                return(CaptureRequest.Begin(this, CaptureSide.Both));
            }
            return(CaptureRequest.Ignore);
        }
Example #13
0
        override public CaptureRequest WantsCapture(InputState input)
        {
            // [RMS] something doesn't make sense here...if tool was active on both sides, this could
            // capture on either? We should only be capturing if capture-side tool == this.tool...

            if (input.bLeftTriggerPressed ^ input.bRightTriggerPressed)
            {
                CaptureSide eSide = (input.bLeftTriggerPressed) ? CaptureSide.Left : CaptureSide.Right;
                ITool       tool  = context.ToolManager.GetActiveTool((int)eSide);
                if (tool != null && tool is SculptCurveTool)
                {
                    return(CaptureRequest.Begin(this, eSide));
                }
            }
            return(CaptureRequest.Ignore);
        }
Example #14
0
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (context.ToolManager.ActiveRightTool == null || !(context.ToolManager.ActiveRightTool is DrawPrimitivesTool))
     {
         return(CaptureRequest.Ignore);
     }
     if (input.bLeftMousePressed)
     {
         AnyRayHit rayHit;
         if (context.Scene.FindSceneRayIntersection(input.vMouseWorldRay, out rayHit))
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #15
0
        public override CaptureRequest WantsCapture(InputState input)
        {
            UIRayHit uiHit;

            if (input.bTouchPressed && input.nTouchCount == 1)
            {
                if (scene.FindUIHit(input.vTouchWorldRay, out uiHit))
                {
                    bool bCanCapture = uiHit.hitUI.WantsCapture(InputEvent.Touch(input, new AnyRayHit(uiHit)));
                    if (bCanCapture)
                    {
                        return(CaptureRequest.Begin(this));
                    }
                }
            }
            return(CaptureRequest.Ignore);
        }
Example #16
0
 public override CaptureRequest WantsCapture(InputState input)
 {
     if ((input.bLeftTriggerDown && input.bLeftShoulderPressed) ||
         (input.bLeftTriggerPressed && input.bLeftShoulderDown))
     {
         return(CaptureRequest.Begin(this, CaptureSide.Left));
     }
     else if ((input.bRightTriggerDown && input.bRightShoulderPressed) ||
              (input.bRightTriggerPressed && input.bRightShoulderDown))
     {
         return(CaptureRequest.Begin(this, CaptureSide.Right));
     }
     else
     {
         return(CaptureRequest.Ignore);
     }
 }
Example #17
0
        public override CaptureRequest WantsCapture(InputState input)
        {
            UIRayHit uiHit;

            if (input.bLeftMousePressed)
            {
                if (scene.Find2DCockpitUIHit(input.vMouseOrthoWorldRay, out uiHit))
                {
                    bool bCanCapture = uiHit.hitUI.WantsCapture(InputEvent.Mouse(input.ToOrthoLayerInput(), new AnyRayHit(uiHit)));
                    if (bCanCapture)
                    {
                        return(CaptureRequest.Begin(this));
                    }
                }
            }
            return(CaptureRequest.Ignore);
        }
 public override CaptureRequest WantsCapture(InputState input)
 {
     if (input.bLeftTriggerPressed ^ input.bRightTriggerPressed)
     {
         CaptureSide eSide  = (input.bLeftTriggerPressed) ? CaptureSide.Left : CaptureSide.Right;
         Ray3f       useRay = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
         UIRayHit    uiHit;
         if (scene.FindUIHit(useRay, out uiHit))
         {
             bool bCanCapture = uiHit.hitUI.WantsCapture(InputEvent.Spatial(eSide, input, new AnyRayHit(uiHit)));
             if (bCanCapture)
             {
                 return(CaptureRequest.Begin(this, eSide));
             }
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #19
0
        public override CaptureRequest WantsCapture(InputState input)
        {
            UIRayHit uiHit;

            if (input.bLeftTriggerPressed || input.bAButtonPressed)
            {
                ActiveInput = (input.bLeftTriggerPressed) ? WhichInput.LeftTrigger : WhichInput.AButton;
                if (scene.FindUIHit(input.vGamepadWorldRay, out uiHit))
                {
                    bool bCanCapture = uiHit.hitUI.WantsCapture(InputEvent.Gamepad(input, new AnyRayHit(uiHit)));
                    if (bCanCapture)
                    {
                        return(CaptureRequest.Begin(this));
                    }
                }
            }
            return(CaptureRequest.Ignore);
        }
Example #20
0
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (context.ToolManager.ActiveRightTool == null || !(context.ToolManager.ActiveRightTool is DrawSurfaceCurveTool))
     {
         return(CaptureRequest.Ignore);
     }
     if (Pressed(input))
     {
         DrawSurfaceCurveTool tool =
             (context.ToolManager.ActiveRightTool as DrawSurfaceCurveTool);
         SORayHit rayHit;
         if (tool.Target.FindRayIntersection(WorldRay(input), out rayHit))
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #21
0
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (input.bLeftTriggerPressed ^ input.bRightTriggerPressed)
     {
         CaptureSide eSide   = (input.bLeftTriggerPressed) ? CaptureSide.Left : CaptureSide.Right;
         Ray         sideRay = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
         ITool       tool    = context.ToolManager.GetActiveTool((int)eSide);
         if (tool != null && tool is DrawPrimitivesTool)
         {
             AnyRayHit rayHit;
             if (context.Scene.FindSceneRayIntersection(sideRay, out rayHit))
             {
                 return(CaptureRequest.Begin(this, eSide));
             }
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #22
0
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (context.ToolManager.ActiveRightTool == null || !(context.ToolManager.ActiveRightTool is SurfaceBrushTool))
     {
         return(CaptureRequest.Ignore);
     }
     if (Pressed(ref input))
     {
         if (tool.BeginStrokeHitTestFilter(WorldRay(ref input)) == false)
         {
             return(CaptureRequest.Ignore);
         }
         if (update_last_hit(tool, WorldRay(ref input)))
         {
             return(CaptureRequest.Begin(this));
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #23
0
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (input.bLeftTriggerPressed ^ input.bRightTriggerPressed)
     {
         CaptureSide eSide = (input.bLeftTriggerPressed) ? CaptureSide.Left : CaptureSide.Right;
         ITool       tool  = context.ToolManager.GetActiveTool((int)eSide);
         if (tool != null && tool is DrawSurfaceCurveTool)
         {
             DrawSurfaceCurveTool drawTool = tool as DrawSurfaceCurveTool;
             SORayHit             rayHit;
             Ray3f ray = (input.bLeftTriggerPressed) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
             if (drawTool.Target.FindRayIntersection(ray, out rayHit))
             {
                 return(CaptureRequest.Begin(this, eSide));
             }
         }
     }
     return(CaptureRequest.Ignore);
 }
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (context.ToolManager.ActiveRightTool == null || !(context.ToolManager.ActiveRightTool is BaseSurfacePointTool))
     {
         return(CaptureRequest.Ignore);
     }
     if (Pressed(input))
     {
         SORayHit rayHit;
         if (context.Scene.FindSORayIntersection(WorldRay(input), out rayHit, ObjectFilterF))
         {
             BaseSurfacePointTool tool =
                 (context.ToolManager.ActiveRightTool as BaseSurfacePointTool);
             if (tool.WantCapture(rayHit.hitSO, ClickPoint(input), WorldRay(input)))
             {
                 return(CaptureRequest.Begin(this));
             }
         }
     }
     return(CaptureRequest.Ignore);
 }
Example #25
0
 override public CaptureRequest WantsCapture(InputState input)
 {
     if (input.bLeftTriggerPressed ^ input.bRightTriggerPressed)
     {
         CaptureSide eSide = (input.bLeftTriggerPressed) ? CaptureSide.Left : CaptureSide.Right;
         ITool       itool = context.ToolManager.GetActiveTool((int)eSide);
         if (itool != null && itool is BaseSurfacePointTool)
         {
             Ray3f    worldRay = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
             SORayHit rayHit;
             if (context.Scene.FindSORayIntersection(worldRay, out rayHit, ObjectFilterF))
             {
                 BaseSurfacePointTool tool = itool as BaseSurfacePointTool;
                 if (tool.WantCapture(rayHit.hitSO, Vector2d.Zero, worldRay))
                 {
                     return(CaptureRequest.Begin(this, eSide));
                 }
             }
         }
     }
     return(CaptureRequest.Ignore);
 }
        public override CaptureRequest WantsCapture(InputState input)
        {
            if ((input.bLeftShoulderPressed == true && input.bRightShoulderPressed == false && input.bRightShoulderDown == false) ||
                (input.bLeftShoulderDown == true && input.bRightShoulderReleased == true))
            {
                // [RMS] ugh hack to prevent this from capturing when triggers are down
                if (input.bLeftTriggerDown == false)
                {
                    return(CaptureRequest.Begin(this, CaptureSide.Left));
                }
            }
            if ((input.bRightShoulderPressed == true && input.bLeftShoulderPressed == false && input.bLeftShoulderDown == false) ||
                (input.bRightShoulderDown == true && input.bLeftShoulderReleased == true))
            {
                // [RMS] ugh hack to prevent this from capturing when triggers are down
                if (input.bRightTriggerDown == false)
                {
                    return(CaptureRequest.Begin(this, CaptureSide.Right));
                }
            }

            return(CaptureRequest.Ignore);
        }
Example #27
0
        override public CaptureRequest WantsCapture(InputState input)
        {
            if (context.ToolManager.ActiveRightTool == null || !(context.ToolManager.ActiveRightTool is SculptCurveTool))
            {
                return(CaptureRequest.Ignore);
            }
            if (Pressed(ref input))
            {
                // if we have a brush target, we only capture when we click on it
                if (tool.BrushTarget != null)
                {
                    Vector3d vHit, vNormal;
                    bool     bHit = tool.BrushTarget.RayIntersect(WorldRay(ref input), out vHit, out vNormal);
                    if (bHit == false)
                    {
                        return(CaptureRequest.Ignore);
                    }
                }

                return(CaptureRequest.Begin(this));
            }
            return(CaptureRequest.Ignore);
        }