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

            tool.EndBrushStroke();
            return(Capture.End);
        }
示例#2
0
        override public Capture UpdateCapture(InputState input, CaptureData data)
        {
            if (tool == null)
            {
                throw new Exception("SurfaceBrushTool_MouseBehavior.UpdateCapture: tool is null, how did we get here?");
            }

            if (Released(ref input))
            {
                tool.EndBrushStroke();
                return(Capture.End);
            }
            else
            {
                update_last_hit(tool, WorldRay(ref input));
                tool.UpdateBrushStroke(lastHitFrameW, lastHitTID);
                return(Capture.Continue);
            }
        }
示例#3
0
        override public Capture UpdateCapture(InputState input, CaptureData data)
        {
            SurfaceBrushTool tool = context.ToolManager.GetActiveTool((int)data.which) as SurfaceBrushTool;

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

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

            if (vStick[1] != 0)
            {
                tool.Radius.Add(fDimension.World(vStick[1] * resize_speed(ref input)));
            }

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

            sideHandF.Origin += SceneGraphConfig.VRHandTipOffset * sideHandF.Z;
            //tool.UpdateDraw_Spatial(sideRay, sideHandF);

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

            if (bReleased)
            {
                tool.EndBrushStroke();
                return(Capture.End);
            }
            else
            {
                tool.UpdateBrushStroke(sideHandF, lastHitTID);
                return(Capture.Continue);
            }
        }