camera_controller_fly_mode
Plane-like camera control moving forward continuously.
Derives from: camera_controller_first_person
Fields and methods
Members of the struct camera_controller_fly_mode. Most of what you do with a CGP type goes through the free functions listed below.
Fields
float speed = 0.05f | Current forward speed in units per second, 0.05 by default, kept between speed_min and speed_max. |
float roll = 0.8f | Roll rate in radians per second applied while left/right (or A/D) is held, 0.8 by default. |
float pitch = 0.5f | Pitch rate in radians per second applied while up/down (or W/S) is held, 0.5 by default. |
float speed_increase = 1.02f | Factor, 1.02 by default, by which speed is multiplied (or divided) per frame at 60 fps while +/R (or -/F) is held; the rate does not depend on the frame rate (factor speed_increase^(60 dt) per frame). |
float speed_max = 0.5f | Upper bound of speed, 0.5 by default. |
float speed_min = 0.0001f | Lower bound of speed, 0.0001 by default. |
Methods
| Rolls the camera from the horizontal and pitches it from the vertical mouse displacement, during a left drag or for any move in cursor-captured mode, when the cursor is not on the GUI. src | |
| Moves the camera forward by speed * time_interval at each frame, pitching with up/down (W/S), rolling with left/right (A/D) and changing speed with +/R and -/F. src | |
| Returns a text describing the mouse and keyboard controls of the fly mode. src |
Inherited from camera_controller_first_person (6 members)
Fields
camera_first_person camera_model | First person camera (free rotation) driven by the controller. |
float translation_speed = 1 | Multiplier of the translation speed for keyboard moves and right mouse drag, 1 by default. |
float rotation_speed = 1 | Multiplier of the rotation speed for mouse drags and Q/E twists, 1 by default. |
Inherited from camera_controller_generic_base (5 members)
Fields
bool is_active = true | Enables the controller, true by default; when false the mouse and idle actions return without moving the camera. |
input_devices* inputs = nullptr | Pointer to the global keyboard/mouse state, nullptr until initialize() is called. |
window_structure* window = nullptr | Pointer to the global window state, nullptr until initialize() is called. |
Functions taking a camera_controller_fly_mode
None.
Functions returning a camera_controller_fly_mode
None.
Operators
None.