added a newly clamp function that only a param
This commit is contained in:
@@ -94,13 +94,19 @@ namespace hgl
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline T clamp(const T &v,const T &min_v,const T &max_v)
|
||||
inline T clamp(const T v,const T min_v,const T max_v)
|
||||
{
|
||||
if(v<min_v)return min_v;
|
||||
if(v>max_v)return max_v;
|
||||
return v;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline const T clamp(const T in)
|
||||
{
|
||||
return clamp<double>(in,0.0f,1.0f);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline T normalized(const T &v)
|
||||
{
|
||||
|
Reference in New Issue
Block a user