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

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

            tool.CancelDraw();
            return(Capture.End);
        }
Exemple #3
0
        public ITool Build(FScene scene, List <SceneObject> targets)
        {
            DrawCurveTool tool = new DrawCurveTool(scene);

            tool.Width    = DefaultWidth;
            tool.MinWidth = Math.Min(tool.MinWidth, DefaultWidth * 0.1f);
            return(tool);
        }
Exemple #4
0
        override public Capture BeginCapture(InputState input, CaptureSide eSide)
        {
            DrawCurveTool tool =
                (context.ToolManager.ActiveRightTool as DrawCurveTool);
            AnyRayHit rayHit;

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

            tool.UpdateDraw_Ray(WorldRay(input));

            if (Released(input))
            {
                tool.EndDraw();
                return(Capture.End);
            }
            else
            {
                return(Capture.Continue);
            }
        }
Exemple #6
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;
            DrawCurveTool tool      = context.ToolManager.GetActiveTool((int)eSide) as DrawCurveTool;

            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));
            }
        }
Exemple #7
0
        override public Capture UpdateCapture(InputState input, CaptureData data)
        {
            DrawCurveTool tool = context.ToolManager.GetActiveTool((int)data.which) as DrawCurveTool;

            // [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.Width = tool.Width + 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);
            }
        }