Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static inline Vec3 clamp(Vec3 const & _val,Vec3 const & _min,Vec3 const & _max)
- {
- Vec3 rVal = _val;
- if (rVal.mX < _min.mX)
- rVal.mX = _min.mX;
- if (rVal.mX > _max.mX)
- rVal.mX = _max.mX;
- if (rVal.mY < _min.mY)
- rVal.mY = _min.mY;
- if (rVal.mY > _max.mY)
- rVal.mY = _max.mY;
- if (rVal.mZ < _min.mZ)
- rVal.mZ = _min.mZ;
- if (rVal.mZ > _max.mZ)
- rVal.mZ = _max.mZ;
- return rVal;
- }
Add Comment
Please, Sign In to add comment