Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public override CaptureRequest WantsCapture(InputState input)
        {
            UIRayHit uiHit;

            if (input.bLeftMousePressed)
            {
                if (scene.FindUIHit(input.vMouseWorldRay, out uiHit))
                {
                    bool bCanCapture = uiHit.hitUI.WantsCapture(InputEvent.Mouse(input, new AnyRayHit(uiHit)));
                    if (bCanCapture)
                    {
                        return(CaptureRequest.Begin(this));
                    }
                }
            }
            return(CaptureRequest.Ignore);
        }
Ejemplo n.º 3
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);
        }
 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);
 }