FANDOM


ClampVx3

Name Edit

clamp - returns smallest integer not less than a scalar or each vector component.

Synopsis Edit

vector1 clamp(vector1 x, vector1 a, vector1 b);
vector2 clamp(vector2 x, vector2 a, vector2 b);
vector3 clamp(vector3 x, vector3 a, vector3 b);
vector4 clamp(vector4 x, vector4 a, vector4 b);

Parameters Edit

x
Vector or scalar to clamp.
a
Vector or scalar for bottom of clamp range.
b
Vector or scalar for top of clamp range.

Description Edit

Returns x clamped to the range [a,b] as follows:

1) Returns a if x is less than a; else
2) Returns b if x is greater than b; else
3) Returns x otherwise.

For vectors, the returned vector contains the clamped result of each element of the vector x clamped using the respective element of vectors a and b.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.