Esempio n. 1
0
    protected override void setupCamerasOnBound(AirVRClientConfig config)
    {
        var projection = config.GetCameraProjectionMatrix(camera.nearClipPlane, camera.farClipPlane);

        if (projection == Matrix4x4.zero)
        {
            return;
        }

#if UNITY_2018_2_OR_NEWER
        var props = config.physicalCameraProps;

        camera.usePhysicalProperties = true;
        camera.focalLength           = props.focalLength;
        camera.sensorSize            = props.sensorSize;
        camera.lensShift             = props.lensShift;
        camera.aspect  = props.aspect;
        camera.gateFit = Camera.GateFitMode.None;
#else
        camera.projectionMatrix = projection;
#endif
    }