CGPdocs

camera_controller_first_person_euler

Mouse and keyboard control of a camera_first_person_euler (walk in a scene).

Derives from: camera_controller_generic_base

Fields and methods

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

Fields

camera_first_person_euler camera_modelEuler-angle first person camera 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 (or any move in cursor-captured mode) changes yaw and pitch, Ctrl + left drag twists axis_of_rotation, right drag moves forward/backward. src
Sets the axis_of_rotation (up direction when pitch = 0) of the camera. src
Sets the axis_of_rotation of the camera to (1,0,0). src
Sets the axis_of_rotation of the camera to (0,1,0). src
Sets the axis_of_rotation of the camera to (0,0,1). src
Toggles the cursor-captured mode with Shift+C (Escape releases the cursor). src
Moves the camera at 2 units per second while keys are held; W/S and up/down arrows forward/backward (Ctrl + up/down moves up/down), A/D and left/right sideways, R/F up/down, Q/E twist axis_of_rotation at 2 radians per second. src
Places the camera at eye looking toward center; the third argument is ignored (the up vector is set by axis_of_rotation). src
Returns a text describing the mouse and keyboard controls of the Euler first person camera. src
Inherited from camera_controller_generic_base (5 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 mouse button press or release event; does nothing in the base class. src

Functions taking a camera_controller_first_person_euler

None.

Functions returning a camera_controller_first_person_euler

None.

Operators

None.

CGP - Computer Graphics Programming.