projectionMatrix property

Matrix4 get projectionMatrix

The projection matrix of the camera.

Implementation

Matrix4 get projectionMatrix {
  final aspectRatio = viewport.virtualSize.x / viewport.virtualSize.y;
  return switch (projection) {
    CameraProjection.perspective => _projectionMatrix
      ..setAsPerspective(fovY, aspectRatio, distanceNear, distanceFar),
    CameraProjection.orthographic => _projectionMatrix
      ..setAsOrthographic(fovY, aspectRatio, distanceNear, distanceFar)
  };
}