FreeLook class final

Looking around from where the camera stands, and walking it there.

A second camera beside OrbitController, not a mode inside it. An orbit turns about a point somebody chose; this turns about the camera's own position and then walks it, which is a different motion with a different feel and a different unit — metres a second rather than radians a pixel. ux-04 asked for it as "RMB held is free-look with WASD", and the reason it is its own piece rather than another branch in the gesture classifier is that a classifier says what a gesture means; nothing in one can say how fast a camera walks or what happens when the key is let go.

It drives the orbit's own state rather than keeping a pose of its own, and that is the whole trick. An orbit is a target, two angles and a distance; the eye is wherever those put it. Turning the head is then the same two angles with the eye held still instead of the target, and walking is the target sliding — the eye follows it. So there is no handover to write and no drift to reconcile: the moment the right button comes up the orbit is already consistent, orbiting whatever point is distance ahead of where the person is now standing, which is the point they were just looking at.

Holds no Flutter types and no clock; a caller hands walk the seconds that passed, which is what makes it steppable by hand in a test.

Constructors

FreeLook(OrbitController orbit)

Properties

fastFactor ↔ double
The multiplier for the other one, held to cross a large scene.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
metresPerSecond ↔ double
How fast the keys walk, in scene units a second.
getter/setter pair
orbit → OrbitController
The camera this moves. Both cameras drive the same state on purpose — see this class's own doc comment.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slowFactor ↔ double
The multiplier walk applies while a precision modifier is held.
getter/setter pair

Methods

look(double deltaYaw, double deltaPitch) → void
Turns the head, in pixels of pointer travel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
walk({double forward = 0.0, double right = 0.0, double up = 0.0, required double seconds, bool slow = false, bool fast = false}) → void
Walks the camera for seconds, along its own axes.

Operators

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