public override Capture UpdateCapture(InputState input, CaptureData data) { SceneUIElement uiElem = data.custom_data as SceneUIElement; if ((data.which == CaptureSide.Left && input.bLeftTriggerReleased) || (data.which == CaptureSide.Right && input.bRightTriggerReleased)) { if (uiElem != null) { uiElem.EndCapture(InputEvent.Spatial(data.which, input)); } return(Capture.End); } else if ((data.which == CaptureSide.Left && input.bLeftTriggerDown) || (data.which == CaptureSide.Right && input.bRightTriggerDown)) { if (uiElem != null) { uiElem.UpdateCapture(InputEvent.Spatial(data.which, input)); } return(Capture.Continue); } else { // [RMS] can end up here sometimes in Gamepad if we do camera controls // while we are capturing... return(Capture.End); } }
public override Capture ForceEndCapture(InputState input, CaptureData data) { SceneUIElement uiElem = data.custom_data as SceneUIElement; if (uiElem != null) { uiElem.EndCapture(InputEvent.Spatial(data.which, input)); } return(Capture.End); }
public override Capture BeginCapture(InputState input, CaptureSide eSide) { Ray3f useRay = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay; UIRayHit uiHit; if (scene.FindUIHit(useRay, out uiHit)) { bool bCanCapture = uiHit.hitUI.BeginCapture(InputEvent.Spatial(eSide, input, new AnyRayHit(uiHit))); if (bCanCapture) { return(Capture.Begin(this, eSide, uiHit.hitUI)); } } return(Capture.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); }