panningAxis behavior changed between 4.2 and 5.alpha

Expecting it to pan on x & z axis

camera.panningAxis.copyFromFloats(1,0,1);

switch between 4.2 and 5.0, use right-click for pan, to see it.

It looks like it’s now using local axes instead of global.

Bump! Is this intended behaviour or a bug? If it is intended, any tips on how to achieve the same behaviour in 5.0?

1 Like

@PolygonalSun do you know if something changed between these two versions?

Indeed, I’ve noticed the same, in version 5.
Looks like the panning is doing some camera dollying back and forth, when panning back and forth.

Interested to know when this is resolved.
Thanks

Sorry about missing this message. Originally, I thought that I had reverted this behavior to work like it did in 4.2 but maybe something got changed. Lemme take a look to see what’s going on.

1 Like

Setting camera.mapPanning = true solves the issue.

This is what changed, from:

//Eliminate y if map panning is enabled (panningAxis == 1,0,1)
if (!this.panningAxis.y) {
  this._transformedDirection.y = 0;
}

to:

// Eliminate y if mapPanning is enabled
if (this.mapPanning) {
  this._transformedDirection.y = 0;
}

Perhaps it should be changed to this to allow for backwards compatibility?

if (this.mapPanning || !this.panningAxis.y) {
  this._transformedDirection.y = 0;
}

@PolygonalSun
In this case, i think mapPanning should be true by default for backwards compat, to not change behaviour in older applications when babylonjs is updated.

That would disable y-panning in all applications. See the last code example in my comment above for a backwards compatible solution

Hey @Oscar and @aWeirdo,
Sorry about the delay in response here but based on what I’ve tested, I believe that the best approach would be to actually add the proposed change (with backwards compatibility) by Oscar to replicate the original behavior in 4.2 and earlier. I do feel like there should be an option to move the camera with respect to local space but I feel like it’d be more important to address this first.

Update is in PR: Added check to ArcRotateCamera for non-y axis panning by PolygonalSun · Pull Request #12065 · BabylonJS/Babylon.js (github.com)

PR is merged

1 Like