public override void AnalogChanged(UniVRPNity.AnalogEvent e) { base.AnalogChanged(e); Actions.YawLeft = this.coordinates.x < Left; Actions.YawRight = this.coordinates.x > Right; Actions.PitchUp = this.coordinates.y < Up; Actions.PitchBottom = this.coordinates.y > Down; }
public override void AnalogChanged(UniVRPNity.AnalogEvent e) { base.AnalogChanged(e); ActionsTyped.sensibility = new Vector3( Math.Abs(accelerationWiimote.Pitch) * multiplier.x, Math.Abs(accelerationWiimote.Roll) * multiplier.y, 0); this.AssignAction(); }
public override void TrackerChanged(UniVRPNity.TrackerEvent e) { try { if (Sensor == e.Sensor) { Position = Utils.Convert(e.Position); Rotation = Utils.Convert(e.Orientation); } } catch (InvalidOperationException) { /* Not found */} }
public static System.Type ConvertType(UniVRPNity.Type type) { switch (type) { case Type.Analog: return typeof(AnalogEvent); case Type.Button: return typeof(ButtonEvent); case Type.Tracker: return typeof(TrackerEvent); default: return null; } }
public override void AnalogChanged(UniVRPNity.AnalogEvent e) { base.AnalogChanged(e); joystick = new Joystick((float)e.Channel((int)Wiimote.Analog.JoystickAngle), (float)e.Channel((int)Wiimote.Analog.JoystickMagnitude)); if (joystick.Magnitude < delta) joystick.Magnitude = 0; joystickPosition = new Vector2( (float)Math.Sin(Math.PI * joystick.Angle / 180), (float)Math.Cos(Math.PI * joystick.Angle / 180)); ActionsTyped.sensibility = new Vector3( joystick.Magnitude * Math.Abs(joystickPosition.y) * multiplier.x, joystick.Magnitude * Math.Abs(joystickPosition.x) * multiplier.y, 0); this.AssignAction(); }
public virtual void TrackerChanged(UniVRPNity.TrackerEvent e) { }
public virtual void ButtonChanged(UniVRPNity.ButtonEvent e) { }
public virtual void AnalogChanged(UniVRPNity.AnalogEvent e) { }
public BaseRemote(UniVRPNity.Type type) { this.Type = type; }
public virtual void AnalogChanged(UniVRPNity.AnalogEvent e) { accelerationWiimote = new Acceleration( (float)e.Channel((int)Wiimote.Analog.Roll) + offsetWiimote.Roll, (float)e.Channel((int)Wiimote.Analog.Pitch) + offsetWiimote.Pitch, (float)e.Channel((int)Wiimote.Analog.Yaw) + offsetWiimote.Yaw ); accelerationNunchuck = new Acceleration( (float)e.Channel((int)Wiimote.Analog.NunchuckRoll) + offsetNunchuck.Roll, (float)e.Channel((int)Wiimote.Analog.NunchuckPitch) + offsetNunchuck.Pitch, (float)e.Channel((int)Wiimote.Analog.NunchuckYaw) + offsetNunchuck.Yaw ); }
/// <summary> /// Build a object without the socket. /// </summary> /// <param name="name">See <see cref="VrpnObjects.Name"/>.</param> /// <param name="type">See <see cref="VrpnObjects.Type"/>.</param> public VrpnObjectInfo(string name, UniVRPNity.Type type) { this.Name = name; this.Type = type; }
public virtual void AnalogChanged(UniVRPNity.AnalogEvent e) { this.coordinates.x = (float)e.Channel((int)Mouse.Analog.X); this.coordinates.y = (float)e.Channel((int)Mouse.Analog.Y); }