adding a clip method to handle Vector3 objects to enable a minor amount of refactoring

This commit is contained in:
SignpostMarv
2012-08-17 16:53:36 +01:00
committed by Justin Clark-Casey (justincc)
parent ef4122213c
commit e9ea911563
2 changed files with 11 additions and 6 deletions

View File

@@ -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));
}
/// <summary>
/// Convert an UUID to a raw uuid string. Right now this is a string without hyphens.
/// </summary>