Viewport aspect problems when application resizes

When the application is resized (eg: using AndroidHarnessFragment and coming from another activity) the aspect ratio of every viewport is re-fixed overriding the left and right values.

When AndroidHarnessFragment.reshape is called, it calls LegacyApplication.reshape, what calls RenderManager.notifyReshape, wich, in turn, calls Camera.resize(w, h, true) for every viewport.


    public void resize(int width, int height, boolean fixAspect) {
        this.width = width;
        this.height = height;

        if (fixAspect /*&& !parallelProjection*/) {
            frustumRight = frustumTop * ((float) width / height);
            frustumLeft = -frustumRight;

The frustumRight and frustumLeft values seems to be wrong calculated. As it is, it breaks any custom aspect it has. Shouldn’t this method be aware of the current aspect (which can be calculated from the current height, width and it frustum values) while setting the new right/left?

1 Like

Yes. This is issue #357, which is fixed in ‘master’ as of July, but not in the ‘v3.1’ branch.
See Updating the frustum does not work as expected · Issue #357 · jMonkeyEngine/jmonkeyengine · GitHub for more details.

1 Like

Oh, thanks, I’ve been looking at the forums for it but I forgot github.

1 Like