google produced nothing, so I wanted to ask SO. What does ccp achieve?
Here’s an example of ccpClamp being used in a method.
-(void) moveCamera:(CGPoint)pos
{
CGPoint to = ccpClamp(pos, cameraMin, cameraMax);
to = ccpSub(to, cameraOffset);
[self.camera setCenterX:to.x centerY:to.y centerZ:0];
[self.camera setEyeX:to.x eyeY:to.y eyeZ:[CCCamera getZEye]];
// update hud-level sprites
[(HudLayer*)[self.parent getChildByTag:kTagHudLayer] moveSprites:[self getCameraPosition]];
}
The official documentation doesn’t explain what the word clamp means, but
it is used to limit values to a set boundary (low, high).
In your example, it’s equivalent to:
According to dictionary.com, clamp means: