Issue with non square aspect ratio and resizing

I’ve had another look at this and it looks like it can be tidied up into a nice utility script without needing to patch a core math function.

The camera component has projection matrix calculation override property: https://developer.playcanvas.com/en/api/pc.CameraComponent.html#calculateProjection

We can do this in the orbit camera script (in this instance):

this.entity.camera.calculateProjection = function(mat4, view) {
        var fov = this._fov;
        var aspect = this._aspectRatio;
        var znear = this._nearClip;
        var zfar = this._farClip;
        var fovIsHorizontal =  this._horizontalFov;
        var requiredAspectRatio = 0.55;
        
        var xmax = 0; 
        var ymax = 0;
        if (!fovIsHorizontal) 
        {
            ymax = znear * Math.tan(fov * Math.PI / 360);
            xmax = ymax * aspect;
        } 
        else
        {                
            xmax = znear * Math.tan(fov * Math.PI / 360);
            xmax *= requiredAspectRatio;
            ymax = xmax / aspect;
        }

        return mat4.setFrustum(-xmax, xmax, -ymax, ymax, znear, zfar);
    };