CGPdocs

camera_controller_orbit

Mouse and keyboard control of a camera_orbit (rotate, zoom, pan).

Derives from: camera_controller_generic_base

module 19_camera_controllersource: camera_controller_orbit.hpp

Fields and methods

Members of the struct camera_controller_orbit. Most of what you do with a CGP type goes through the free functions listed below.

Fields

camera_orbit camera_modelOrbit camera (free arcball rotation) driven by the controller.

Methods

Returns camera_model as a read-only camera_generic_base. src
Updates the camera from the mouse displacement when the cursor is not on the GUI; left drag rotates (arcball), Ctrl + left drag pans in the view plane, right drag changes the distance to the center, Ctrl + right drag translates the center front/back. src
Rolls the camera around the view direction while the left/right arrow (or R/F) key is held, at 1 radian per second. src
Places the camera at eye looking toward center with the given up vector, center becoming the center of rotation. src
Returns a text describing the mouse and keyboard controls of the orbit camera (including the R/F keys). src
Inherited from camera_controller_generic_base (6 members)

Fields

bool is_active = trueEnables the controller, true by default; when false the mouse and idle actions return without moving the camera.
input_devices* inputs = nullptrPointer to the global keyboard/mouse state, nullptr until initialize() is called.
window_structure* window = nullptrPointer to the global window state, nullptr until initialize() is called.

Methods

Stores pointers to the global inputs and window; must be called before any action function. src
Handles a keyboard press or release event; does nothing in the base class. src
Handles a mouse button press or release event; does nothing in the base class. src

Functions taking a camera_controller_orbit

None.

Functions returning a camera_controller_orbit

None.

Operators

None.

CGP - Computer Graphics Programming.