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

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

            SceneObject startHitSO = data.custom_data as SceneObject;

            if (input.bLeftMouseReleased)
            {
                SORayHit soHit;
                if (context.Scene.FindSORayIntersection(input.vMouseWorldRay, out soHit))
                {
                    if (soHit.hitSO == startHitSO)
                    {
                        if (soHit.hitSO is PolyCurveSO)
                        {
                            tool.UpdateCurve(input.vMouseWorldRay, soHit);
                        }
                        else
                        {
                            tool.UpdateAxis(input.vMouseWorldRay, soHit);
                        }
                    }
                }
                return(Capture.End);
            }
            else
            {
                return(Capture.Continue);
            }
        }
Exemple #3
0
        override public Capture UpdateCapture(InputState input, CaptureData data)
        {
            RevolveTool tool = context.ToolManager.GetActiveTool((int)data.which) as RevolveTool;

            // [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.Cancel();
                return(Capture.End);
            }

            if (data.custom_data == this)
            {
                // hack to detect button-press capture set
                bool bReleased = (data.which == CaptureSide.Left) ? input.bXButtonReleased : input.bAButtonReleased;
                if (bReleased)
                {
                    tool.AddCurrent();
                    return(Capture.End);
                }
            }
            else
            {
                Ray         sideRay    = (data.which == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay;
                SceneObject startHitSO = data.custom_data as SceneObject;

                bool bReleased = (data.which == CaptureSide.Left) ? input.bLeftTriggerReleased : input.bRightTriggerReleased;
                if (bReleased)
                {
                    SORayHit soHit;
                    if (context.Scene.FindSORayIntersection(sideRay, out soHit))
                    {
                        if (soHit.hitSO == startHitSO)
                        {
                            if (soHit.hitSO is PolyCurveSO)
                            {
                                if (tool.HasCurve)
                                {
                                    tool.UpdateAxis(sideRay, soHit);
                                }
                                else
                                {
                                    tool.UpdateCurve(sideRay, soHit);
                                }
                            }
                            else
                            {
                                tool.UpdateAxis(sideRay, soHit);
                            }
                        }
                    }
                    return(Capture.End);
                }
            }

            return(Capture.Continue);
        }
Exemple #4
0
        override public Capture ForceEndCapture(InputState input, CaptureData data)
        {
            RevolveTool tool =
                (context.ToolManager.ActiveRightTool as RevolveTool);

            tool.Cancel();
            return(Capture.End);
        }