Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camera.FlyControl for highly configurable FPS or flight-sim style camera control #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quillaja
Copy link
Contributor

@quillaja quillaja commented Feb 25, 2022

Finally following up to #124 on my ancient promises of an alternative camera control to Orbit. I see there is also PR #196 and #262 for something similar.

I used a series of maps to allow the user to configure the keys, mouse, speeds, and constraints. Translation, Yaw, Pitch, Roll, FoV Zoom are available, and pitching is not restricted to [-90, 90] from world up.

I tried to describe the use of FlyControl as succinctly as possible in its documentation:

    FlyControl provides a camera controller that allows looking at the scene
    from a first person style view. It allows for translation in the
    Forward/Backward, Right/Left, and Up/Down directions, and rotation in the
    Yaw/Pitch/Roll directions from the camera's point of view. The camera's
    field of view can also be modified to allow ZoomOut/ZoomIn.

    For maximum flexibility, the FlyControl is very configurable, but two main
    modes of operation exist: "manual" and "automatic".

    "Manual" mode requires the user to directly make adjustments to the
    FlyControl's position and orientation by using the Forward(), Right(),
    Yaw(), Pitch() and other similar methods. Manual mode does not subscribe to
    key or mouse events, nor does it use the FlyControl's member maps "Speeds",
    "Keys", or "Mouse" ("Constraints" is used). A FlyControl created (eg with
    NewFlyControl()) with no options defaults to "manual" mode.

    "Automatic" mode subscribes to key and mouse events, and handles position
    and orientation adjustments according to parameters specified in the "Keys",
    "Mouse", "Speed", and "Constraint" maps. Generally, methods such as
    Forward() will not be used. Some preconfigured options are available with
    FPSStyle() and FlightSimStyle(), and can be further configured by the
    With*() options, and by modifying the FlyControl's Keys (etc) maps directly.

@quillaja
Copy link
Contributor Author

One thing to add would be a way to use the constraints to restrict translational movement to a plane (eg XY).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant