getProjectionMatrixForViewport method
Returns the projection matrix for a view viewportSize in logical pixels.
The engine renders and picks through this, always passing the view's logical size (never the render target's physical size), so a projection whose volume follows the view's size renders what picking hits at any device pixel ratio or render scale. The default uses only the aspect ratio.
Implementation
@override
Matrix4 getProjectionMatrixForViewport(
ui.Size viewportSize, {
Vector2? jitter,
}) {
final extent = visibleSize(viewportSize);
return _matrix4Orthographic(
extent.x,
extent.y,
offset.x,
offset.y,
near,
far,
jitter: jitter,
);
}