mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Minor refactoring of POS. Adds a Util.Clamp(x, min, max) function.
This commit is contained in:
@@ -130,6 +130,14 @@ namespace OpenSim.Framework
|
||||
return Helpers.UIntsToLong(X, Y);
|
||||
}
|
||||
|
||||
public static T Clamp<T>(T x, T min, T max)
|
||||
where T : System.IComparable<T>
|
||||
{
|
||||
return x.CompareTo(max) > 0 ? max :
|
||||
x.CompareTo(min) < 0 ? min :
|
||||
x;
|
||||
}
|
||||
|
||||
public static uint GetNextXferID()
|
||||
{
|
||||
uint id = 0;
|
||||
|
||||
Reference in New Issue
Block a user