コード例 #1
0
        override public Capture UpdateCapture(InputState input, CaptureData data)
        {
            SnapDrawPrimitivesTool tool =
                (context.ToolManager.ActiveRightTool as SnapDrawPrimitivesTool);
            capture_data cap = data.custom_data as capture_data;

            tool.UpdateDraw_Ray(input.vMouseWorldRay, cap.nStep);

            if (input.bLeftMouseReleased)
            {
                if ((cap.nStep + 1) < tool.Steps)
                {
                    cap.nStep++;
                    return(Capture.Continue);
                }
                else
                {
                    tool.EndDraw();
                    return(Capture.End);
                }
            }
            else
            {
                return(Capture.Continue);
            }
        }
コード例 #2
0
        override public Capture ForceEndCapture(InputState input, CaptureData data)
        {
            SnapDrawPrimitivesTool tool = context.ToolManager.GetActiveTool((int)data.which) as SnapDrawPrimitivesTool;

            tool.CancelDraw();
            return(Capture.End);
        }
コード例 #3
0
        override public Capture ForceEndCapture(InputState input, CaptureData data)
        {
            SnapDrawPrimitivesTool tool =
                (context.ToolManager.ActiveRightTool as SnapDrawPrimitivesTool);

            tool.CancelDraw();
            return(Capture.End);
        }
コード例 #4
0
        override public Capture BeginCapture(InputState input, CaptureSide eSide)
        {
            SnapDrawPrimitivesTool tool =
                (context.ToolManager.ActiveRightTool as SnapDrawPrimitivesTool);
            AnyRayHit rayHit;

            if (context.Scene.FindSceneRayIntersection(input.vMouseWorldRay, out rayHit))
            {
                tool.BeginDraw_Ray(input.vMouseWorldRay, rayHit, 0);
                return(Capture.Begin(this, CaptureSide.Any, new capture_data()
                {
                    nStep = 0
                }));
            }
            return(Capture.Ignore);
        }
コード例 #5
0
        override public Capture BeginCapture(InputState input, CaptureSide eSide)
        {
            Ray     sideRay             = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
            Frame3f sideHandF           = (eSide == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame;
            SnapDrawPrimitivesTool tool = context.ToolManager.GetActiveTool((int)eSide) as SnapDrawPrimitivesTool;

            AnyRayHit rayHit;

            if (context.Scene.FindSceneRayIntersection(sideRay, out rayHit))
            {
                tool.BeginDraw_Spatial(sideRay, rayHit, sideHandF, 0);
                return(Capture.Begin(this, eSide, new capture_data()
                {
                    nStep = 0
                }));
            }
            return(Capture.Ignore);
        }
コード例 #6
0
        override public Capture UpdateCapture(InputState input, CaptureData data)
        {
            SnapDrawPrimitivesTool tool = context.ToolManager.GetActiveTool((int)data.which) as SnapDrawPrimitivesTool;

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

            Ray          sideRay   = (data.which == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
            Frame3f      sideHandF = (data.which == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame;
            capture_data cap       = data.custom_data as capture_data;

            tool.UpdateDraw_Spatial(sideRay, sideHandF, cap.nStep);

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

            if (bReleased)
            {
                if ((cap.nStep + 1) < tool.Steps)
                {
                    cap.nStep++;
                    return(Capture.Continue);
                }
                else
                {
                    tool.EndDraw();
                    return(Capture.End);
                }
            }
            else
            {
                return(Capture.Continue);
            }
        }