Solar System OpenGL v1.0.0
|
Handles keyboard input for controlling the application. More...
#include <GL/glut.h>
#include <iostream>
Go to the source code of this file.
Functions | |
void | keyPressed (unsigned char key, int x, int y) |
Handles keyboard input for controlling the application. | |
Variables | |
bool | showOrbits |
Flag to toggle orbital visibility. | |
float | cameraDistance |
Distance of the camera from the target. | |
float | zoomExcess |
Additional zoom factor beyond the default. | |
int | selectedElement |
Index of the currently selected celestial body. | |
bool | paused |
Flag to toggle simulation pause state. | |
Handles keyboard input for controlling the application.
This file declares functions and external variables used for handling keyboard input to control various aspects of the application, such as camera zoom, orbital visibility, and simulation state.
void keyPressed | ( | unsigned char | key, |
int | x, | ||
int | y ) |
Handles keyboard input for controlling the application.
key | The ASCII code of the pressed key. |
x | The X-coordinate of the mouse cursor. |
y | The Y-coordinate of the mouse cursor. |
This function is called when a key is pressed. It updates various aspects of the application based on the key input, such as toggling orbital visibility, adjusting camera zoom, selecting celestial bodies, and pausing or resuming the simulation.
Handles keyboard input for controlling the application.
key | The ASCII code of the pressed key. |
x | The X-coordinate of the mouse cursor. |
y | The Y-coordinate of the mouse cursor. |
This function is called when a key is pressed. It processes the key input to perform actions such as zooming the camera, toggling orbital visibility, selecting celestial bodies, and pausing or resuming the simulation.
|
extern |
Distance of the camera from the target.
This variable represents the distance between the camera and the point it is observing, affecting the zoom level.
This external float variable represents the distance between the camera and the point it is observing, affecting the zoom level.
This external variable represents the distance between the camera and the point it is looking at, affecting the zoom level.
|
extern |
Flag to toggle simulation pause state.
This variable indicates whether the simulation is currently paused or running.
This external boolean variable indicates whether the simulation is currently paused or running.
|
extern |
Index of the currently selected celestial body.
This variable represents the index of the currently selected planet or celestial body, used for highlighting or focusing. A value of -1 indicates no selection.
This external integer variable represents the index of the currently selected planet or celestial body, used for highlighting or focusing.
|
extern |
Flag to toggle orbital visibility.
This variable indicates whether the orbital paths of celestial bodies are visible or hidden.
This external boolean variable indicates whether the orbital paths of celestial bodies are visible or hidden.
|
extern |
Additional zoom factor beyond the default.
This external float variable represents the amount of additional zoom applied to the camera view, beyond the default zoom level.