예제 #1
0
        public void BindInput(InputPlaybleGesture ipk)
        {
            System.Diagnostics.Debug.Assert(ipk != null);
            BindGestureCommand bkc = new BindGestureCommand(ipk, BindAction.ADD);

            GestureBinds.Add(ipk, bkc);
            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bkc);
        }
예제 #2
0
        public void RemoveInputBinding(InputPlaybleGesture ipk)
        {
            System.Diagnostics.Debug.Assert(ipk != null);
            BindGestureCommand bc = GestureBinds[ipk];

            if (bc != null)
            {
                bc.BindAction = BindAction.REMOVE;
                CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bc);
            }
        }
예제 #3
0
 public void BindInput(InputPlaybleGesture ipk)
 {
     System.Diagnostics.Debug.Assert(ipk != null);
     BindGestureCommand bkc = new BindGestureCommand(ipk, BindAction.ADD);
     GestureBinds.Add(ipk, bkc);
     CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bkc);
 }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Picking"/> class.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="pickingRayDistance">The picking ray distance.</param>
        public Picking(IScene owner, GestureType GestureType, float pickingRayDistance = 500)
            : base(owner)
        {
            leftButtonIntercept = noneButtonIntercept = CullNothing;
            this.pickingRayDistance = pickingRayDistance;
            world = owner.World;
            info = owner.GraphicInfo;
            {
                SimpleConcreteGestureInputPlayable pbRight = new SimpleConcreteGestureInputPlayable(GestureType,

                    (sample) =>
                    {
                        if (OnPickedGesture != null)
                        {
                            TouchCollection tc = TouchPanel.GetState();
                            for (int i = 0; i < tc.Count; i++)
                            {
                            UpdatePickRay(tc[i].Position);

                            SegmentInterceptInfo rti = world.PhysicWorld.SegmentIntersect(ray, noneButtonIntercept, pickingRayDistance);
                            if (rti == null)
                                return;
                            OnPickedGesture(rti,tc[i]);
                            }
                        }
                    
                    }
                    , InputMask.GPICKING);
                bmc2 = new BindGestureCommand(pbRight, BindAction.ADD);
                CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bmc2);
            }
        }