setScaling

fun Camera.setScaling(scaling: Float2)

Sets an additional matrix that scales the projection matrix.

This is useful to adjust the aspect ratio of the camera independent from its projection. First, pass an aspect of 1.0 to setProjection. Then set the scaling with the desired aspect ratio:

double aspect = width / height;

// with Fov.HORIZONTAL passed to setProjection:
camera.setScaling(1.0, aspect);

// with Fov.VERTICAL passed to setProjection:
camera.setScaling(1.0 / aspect, 1.0);

By default, this is an identity matrix.

Parameters

scaling

horizontal and vertical scaling to be applied after the projection matrix.

See also

Camera.setProjection
Camera.setLensProjection
Camera.setCustomProjection