Beispiel #1
0
        override public Capture ForceEndCapture(InputState input, CaptureData data)
        {
            DrawTubeTool tool = context.ToolManager.GetActiveTool((int)data.which) as DrawTubeTool;

            tool.CancelDraw();
            return(Capture.End);
        }
Beispiel #2
0
        override public Capture ForceEndCapture(InputState input, CaptureData data)
        {
            DrawTubeTool tool =
                (context.ToolManager.ActiveRightTool as DrawTubeTool);

            tool.CancelDraw();
            return(Capture.End);
        }
Beispiel #3
0
        override public Capture BeginCapture(InputState input, CaptureSide eSide)
        {
            DrawTubeTool tool =
                (context.ToolManager.ActiveRightTool as DrawTubeTool);
            AnyRayHit rayHit;

            if (context.Scene.FindSceneRayIntersection(input.vMouseWorldRay, out rayHit))
            {
                tool.BeginDraw_Ray(rayHit);
                return(Capture.Begin(this));
            }
            return(Capture.Ignore);
        }
Beispiel #4
0
        override public Capture UpdateCapture(InputState input, CaptureData data)
        {
            DrawTubeTool tool =
                (context.ToolManager.ActiveRightTool as DrawTubeTool);

            tool.UpdateDraw_Ray(input.vMouseWorldRay);

            if (input.bLeftMouseReleased)
            {
                tool.EndDraw();
                return(Capture.End);
            }
            else
            {
                return(Capture.Continue);
            }
        }
Beispiel #5
0
        override public Capture BeginCapture(InputState input, CaptureSide eSide)
        {
            Ray3f        sideRay   = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
            Frame3f      sideHandF = (eSide == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame;
            DrawTubeTool tool      = context.ToolManager.GetActiveTool((int)eSide) as DrawTubeTool;

            bool bTouchingStick =
                (eSide == CaptureSide.Left) ? input.bLeftStickTouching : input.bRightStickTouching;

            AnyRayHit rayHit;

            if (bTouchingStick == false && context.Scene.FindSceneRayIntersection(sideRay, out rayHit))
            {
                tool.BeginDraw_Spatial(rayHit, sideHandF);
                return(Capture.Begin(this, eSide));
            }
            else
            {
                tool.BeginDraw_Spatial_Direct(sideHandF);
                return(Capture.Begin(this, eSide));
            }
        }
Beispiel #6
0
        override public Capture UpdateCapture(InputState input, CaptureData data)
        {
            DrawTubeTool tool = context.ToolManager.GetActiveTool((int)data.which) as DrawTubeTool;

            // [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);
            }

            Vector2f vStick = (data.which == CaptureSide.Left) ? input.vLeftStickDelta2D : input.vRightStickDelta2D;

            if (vStick[1] != 0)
            {
                tool.Radius = tool.Radius + vStick[1] * 0.01f;
            }

            Ray3f   sideRay   = (data.which == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
            Frame3f sideHandF = (data.which == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame;

            tool.UpdateDraw_Spatial(sideRay, sideHandF);

            bool bReleased = (data.which == CaptureSide.Left) ? input.bLeftTriggerReleased : input.bRightTriggerReleased;

            if (bReleased)
            {
                tool.EndDraw();
                return(Capture.End);
            }
            else
            {
                return(Capture.Continue);
            }
        }
Beispiel #7
0
 public DrawTubeTool_SpatialDeviceBehavior(DrawTubeTool tool, FContext s)
 {
     context   = s;
     this.tool = tool;
 }