Starts listening for input on options.view right away
Options for the controller
Whether look input and movement apply
Disabling it doesn't release pointer lock, so a menu that needs the cursor has to exit the lock itself.
Look sensitivity in radians per pixel
Pitch clamp in radians
ReadonlymoveMovement input from outside the keyboard, each axis -1 to 1
x strafes right, y rises along world Y and z walks forward. It adds to the keys on every
update, so the camera keeps moving until you set it back to zero.
Movement speed in world units per second
Diagonal input isn't normalised, so moving forward and sideways at once is about 1.4 times faster.
Request pointer lock on the canvas when the View is pressed, so the mouse looks around without a button held
Only a mouse press requests the lock; touch and pen still look by dragging.
Whether the browser's context menu is kept from opening over the View, so a right-button drag doesn't open it
It applies only within the View's hitArea and only while enabled is on. On Windows the menu
opens on release, so a right-button drag that ends outside the View still opens it.
ReadonlyviewThe View3D this controller listens on and whose camera it drives
StaticdefaultDefaults for every new FPSCamera; an option passed as undefined keeps its default
Whether update() runs from Ticker.shared every frame
OrbitCamera#autoUpdate explains why updating from app.ticker keeps movement in step
with the render.
Sets whether update() runs from Ticker.shared
true to update every frame
Whether WASD / arrow keys, Space and Shift are read from window
Keys are matched by position (KeyboardEvent.code), so the same physical keys work on any
keyboard layout.
Sets whether movement keys are read from window
true to read them
Sets the pitch and tilts the camera
Pitch in radians; clamped to ±maxPitch
Sets the yaw and turns the camera
Yaw in radians; unbounded
Moves the camera by this frame's movement input
Runs every frame while autoUpdate is on; call it yourself every
frame when it's off. Does nothing while enabled is off.
Walking follows the full view direction, pitch included, so walking forward while looking down descends. Strafing stays level, and Space and Shift move along world Y whatever the pitch.
Optionalticker: Ticker
The ticker driving this update; supplies the frame time. Omitted, one 60 fps frame is assumed.
true when the camera moved
First-person controller for a View3D's camera
Drag, or move the mouse under pointer lock, to look around. WASD or the arrow keys walk and strafe, and Space and Shift move along world Y. The move vector takes input from anything else, such as an on-screen joystick.
A look drag or pointer lock starts from a press on the View, within its
hitArea. The controller blocks the browser's context menu over the View so a right-button drag can look around; see preventContextMenu.Example
See