The clamp function truncates the parameter argument if it is lower as the min argument and higher as the max argument. This means that you can define a value range for the returned value. We show this by using a sine function as the parameter argument and -1 as min argument and 1 as max argument.
sphere.YPosition = camp( -1, 1, sin( time * 90 ) * 2 );
this will cut off all values of the wave that are beyond a range between -1 and 1.
|