From e9ea911563362c4766d34cd948a2915beac06124 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Fri, 17 Aug 2012 16:53:36 +0100 Subject: adding a clip method to handle Vector3 objects to enable a minor amount of refactoring --- OpenSim/Framework/Util.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Framework/Util.cs') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 8cc29ee..38cb3a6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -850,6 +850,12 @@ namespace OpenSim.Framework return Math.Min(Math.Max(x, min), max); } + public static Vector3 Clip(Vector3 vec, float min, float max) + { + return new Vector3(Clip(vec.X, min, max), Clip(vec.Y, min, max), + Clip(vec.Z, min, max)); + } + /// /// Convert an UUID to a raw uuid string. Right now this is a string without hyphens. /// -- cgit v1.1