OrthographicProjection.bounds constructor

OrthographicProjection.bounds({
  1. required double left,
  2. required double right,
  3. required double bottom,
  4. required double top,
  5. double near = 0.0,
  6. double far = 1000.0,
})

An explicit view volume in view-space world units, independent of the render target's aspect ratio (it stretches to fit).

Implementation

factory OrthographicProjection.bounds({
  required double left,
  required double right,
  required double bottom,
  required double top,
  double near = 0.0,
  double far = 1000.0,
}) => OrthographicProjection(
  size: OrthographicSize.stretch(right - left, top - bottom),
  offset: Vector2((left + right) * 0.5, (bottom + top) * 0.5),
  near: near,
  far: far,
);