Box2D.Common.MathUtils.Clamp C# (CSharp) Method

Clamp() public static method

public static Clamp ( Vec2 a, Vec2 low, Vec2 high ) : Vec2
a Vec2
low Vec2
high Vec2
return Vec2
        public static Vec2 Clamp(Vec2 a, Vec2 low, Vec2 high)
        {
            Vec2 min = new Vec2();
            min.X = a.X < high.X ? a.X : high.X;
            min.Y = a.Y < high.Y ? a.Y : high.Y;
            min.X = low.X > min.X ? low.X : min.X;
            min.Y = low.Y > min.Y ? low.Y : min.Y;
            return min;
        }

Same methods

MathUtils::Clamp ( float a, float low, float high ) : float