Adding the worldDiff is what pans the camera on all 3 axis of the world. If you only want it to move on X, then zero out the Y and Z property of worldDiff before adding it to the pivot point.
@Jack I will do my best to jump in here but I think there is confusion on what you would like to have as a solution. I will take a stab at what you are asking but the information is sketchy and since your project is private we are doing our best to understand. So you would like the following I think. Your x pan is to be clamped.
-80---------------------------0------------------------------80< this is x clamp preferred.
@Devortel and @yaustar have offered a solution to use pc.math.clamp Definition here and also in the documentation provided above.
So I think that you would use pc.math.clamp(xItemToClamp,-80,80) This will return the value of the clamped number. Others can verify.
There are several examples contained that relate I think to your question. I realize that you are expecting an out of the box solution but would suggest that you experiment with what has been sent. The forum search is a great resource. Hope this will help.
MouseInput.prototype.pan = function(screenPoint) {
var fromWorldPoint = MouseInput.fromWorldPoint;
var toWorldPoint = MouseInput.toWorldPoint;
var worldDiff = MouseInput.worldDiff;
// For panning to work at any zoom level, we use screen point to world projection
// to work out how far we need to pan the pivotEntity in world space
var camera = this.entity.camera;
var distance = this.orbitCamera.distance;
camera.screenToWorld(screenPoint.x, screenPoint.y, distance, fromWorldPoint);
camera.screenToWorld(this.lastPoint.x, this.lastPoint.y, distance, toWorldPoint);
worldDiff.sub2(toWorldPoint, fromWorldPoint);
// Remove Y and Z movement
worldDiff.y = 0;
worldDiff.z = 0;
this.orbitCamera.pivotPoint.add(worldDiff);
// Clamp X
this.orbitCamera.pivotPoint.x = pc.math.clamp(this.orbitCamera.pivotPoint.x, -4, 4);
};