/// <summary> /// Binds the MousePosition input. /// </summary> /// <param name="ipk">The InputPlaybleMousePosition.</param> public void BindInput(InputPlaybleMousePosition ipk) { System.Diagnostics.Debug.Assert(ipk != null); BindMouseCommand bkc = new BindMouseCommand(ipk, BindAction.ADD); MouseBinds.Add(ipk, bkc); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bkc); }
/// <summary> /// Removes the MousePosition bindings. /// </summary> /// <param name="ipk">The InputPlaybleMousePosition.</param> public void RemoveInputBinding(InputPlaybleMousePosition ipk) { System.Diagnostics.Debug.Assert(ipk != null); BindMouseCommand bc = MouseBinds[ipk]; if (bc != null) { bc.BindAction = BindAction.REMOVE; CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bc); } }
public LightThrowForward(IWorld mundo, GraphicFactory factory) { this.factory = factory; _mundo = mundo; { ///Register a function to be called when the the mouse is pressed InputPlaybleMouseBottom ip1 = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS, EntityType.IOBJECT, MouseButtons.LeftButton, mousebuttonteste); mm0 = new BindMouseCommand(ip1, BindAction.ADD); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(mm0); } }
public LightThrowBepu(IWorld mundo, GraphicFactory factory, float lightsize = 25, float lightintensity = 5) { this.lightintensity = lightintensity; this.lightsize = lightsize; this.factory = factory; _mundo = mundo; { ///Register a function to be called when the the mouse is pressed InputPlaybleMouseBottom ip1 = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS, EntityType.IOBJECT, MouseButtons.LeftButton, mousebuttonteste); mm0 = new BindMouseCommand(ip1, BindAction.ADD); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(mm0); } { InputPlaybleMouseBottom ip = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS, EntityType.IOBJECT, MouseButtons.RightButton, mousebuttontesteRight); mm1 = new BindMouseCommand(ip, BindAction.ADD); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(mm1); } }
/// <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, float pickingRayDistance = 500) : base(owner) { leftButtonIntercept = rightButtonIntercept = noneButtonIntercept = CullNothing; this.pickingRayDistance = pickingRayDistance; world = owner.World; info = owner.GraphicInfo; { SimpleConcreteMouseBottomInputPlayable pbLeft = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS, EntityType.COMPONENT, MouseButtons.LeftButton, MouseBottomLeft, InputMask.GPICKING); bmc1 = new BindMouseCommand(pbLeft, BindAction.ADD); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bmc1); } { SimpleConcreteMouseBottomInputPlayable pbRight = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS, EntityType.COMPONENT, MouseButtons.RightButton, MouseBottomRight, InputMask.GPICKING); bmc2 = new BindMouseCommand(pbRight, BindAction.ADD); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(bmc2); } }