Lens class final

The lens a game is played through: one base projection, and the only operations that may change it.

Why this is a value and not two numbers on the camera. A game that widens its view for speed rebuilds the camera's projection every frame, so something has to say what it widens from. In the game this came from, that something was a second, bare PerspectiveProjection() beside the camera, and the field of view and far plane the game was written with were overwritten on the first frame and never seen again. One base and operations that move only the field of view leave no second base to disagree with the first.

The field of view by aspect. base is drawn as written on a screen at least designAspect wide. On a narrower one, a handset held upright or a square window, the vertical field of view is opened until the horizontal one is what it was at designAspect, so the ledge or the corner the player was shown on a wide screen is still on a tall one. With no designAspect the lens ignores the screen.

Constructors

Lens(PerspectiveProjection base, {double? designAspect})
A lens on base, opened on screens narrower than designAspect when one is given.
const

Properties

base → PerspectiveProjection
What the camera is built with, and what a widened view returns to.
final
designAspect → double?
The narrowest width over height base is drawn at unchanged, or null to draw it unchanged at every aspect. A unitless ratio.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

at(double aspect, {double extraFieldOfView = 0.0}) → PerspectiveProjection
base for a screen of aspect, opened by extraFieldOfView radians.
fieldOfViewAt(double aspect) → double
The vertical field of view at aspect, width over height.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
widened(double extraFieldOfView) → PerspectiveProjection
base opened up by extraFieldOfView radians, for speed.

Operators

operator ==(Object other) → bool
The equality operator.
inherited