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();
    }
Exemple #2
0
    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
            );
    }
Exemple #3
0
 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);
 }