Esempio n. 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);
        }
Esempio n. 2
0
        public virtual ITool Build(FScene scene, List <SceneObject> targets)
        {
            DMeshSO          target = targets[0] as DMeshSO;
            SurfaceBrushTool tool   = new_tool(scene, target);

            tool.Radius = InitialRadius.Clone();
            return(tool);
        }
Esempio n. 3
0
        void update_last_hit(SurfaceBrushTool tool, Ray3f rayW)
        {
            SORayHit soHit;

            if (tool.Target.FindRayIntersection(rayW, out soHit))
            {
                lastHitPosW = soHit.hitPos;
                lastHitTID  = soHit.hitIndex;
            }
        }
Esempio n. 4
0
        bool update_last_hit(SurfaceBrushTool tool, Ray3f rayW)
        {
            SORayHit soHit;

            if (tool.Target.FindRayIntersection(rayW, out soHit))
            {
                lastHitFrameW = new Frame3f(soHit.hitPos, soHit.hitNormal);
                lastHitTID    = soHit.hitIndex;
                return(true);
            }
            return(false);
        }
Esempio n. 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;

            sideHandF.Origin += SceneGraphConfig.VRHandTipOffset * sideHandF.Z;
            SurfaceBrushTool tool = context.ToolManager.GetActiveTool((int)eSide) as SurfaceBrushTool;

            // [RMS] old oculus hack that was not very nice...
            //bool bTouchingStick =
            //    (eSide == CaptureSide.Left) ? input.bLeftStickTouching : input.bRightStickTouching;
            //tool.ActiveBrush = (bTouchingStick) ?
            //    SurfaceBrushTool.BrushTool.Smooth : SurfaceBrushTool.BrushTool.SoftMove;

            tool.BeginBrushStroke(sideHandF, lastHitTID);

            return(Capture.Begin(this, eSide));
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
0
 public SurfaceBrushTool_2DInputBehavior(SurfaceBrushTool tool, FContext s)
 {
     this.tool = tool;
     context   = s;
 }
Esempio n. 8
0
 public SurfaceBrushTool_SpatialBehavior(SurfaceBrushTool tool, FContext s)
 {
     context   = s;
     this.tool = tool;
 }