public float GetRawValue()
        {
            if (is_horizontal)
            {
                return(stick.GetRawValue().x);
            }

            return(stick.GetRawValue().y);
        }
Exemplo n.º 2
0
        public VectorI2 GetRawValue()
        {
            VectorF2 vector = stick.GetRawValue();

            return(new VectorI2(
                       (vector.x > threshold).ConvertBool(1) + (vector.x < -threshold).ConvertBool(-1),
                       (vector.y > threshold).ConvertBool(1) + (vector.y < -threshold).ConvertBool(-1)
                       ));
        }
Exemplo n.º 3
0
        protected override void UpdateInternal()
        {
            value     = stick.GetRawValue();
            magnitude = value.GetMagnitude();

            if (magnitude != 0.0f)
            {
                angle_in_degrees = value.GetAngleInDegrees();
            }

            if (magnitude < 0.5f)
            {
                stick_zones.LogValue(GamepadStickZone.Center);
            }
            else
            {
                stick_zones.LogValue(
                    angle_in_degrees.GetDegreeAngleClosestCardinalOrdinalDirection().GetGamepadStickZone()
                    );
            }
        }