chrono::opengl::ChOpenGLWindow Class Reference
Description
Manager for the OpenGL context and window.
#include <ChOpenGLWindow.h>
Collaboration diagram for chrono::opengl::ChOpenGLWindow:

Public Member Functions | |
void | Initialize (int size_x, int size_y, const char *title) |
Initialize the window and set up the OpenGL viewer class. More... | |
void | AttachSystem (ChSystem *system) |
Attach a Chrono system to the run-time visualization system. | |
void | SetUserEventReceiver (ChOpenGLEventCB *receiver) |
Attach a custom event receiver to the OpenGL window. | |
void | StartDrawLoop (double time_step) |
This starts the drawing loop and takes control away from the main program. More... | |
bool | DoStepDynamics (double time_step) |
Perform a dynamics step, the user needs to use this so that pausing the simulation works correctly. More... | |
void | EnableHUD (bool state) |
Enable/disable HUD display (default: true). | |
void | Render () |
Render the ChSystem and the HUD. | |
bool | Active () |
Check if the GLFW context is still valid and the window has not been closed. | |
bool | Running () |
Check if the simulation is running or paused. | |
void | Pause () |
Pause simulation. | |
void | SetCamera (ChVector<> pos, ChVector<> look, ChVector<> up, float scale=0.5f, float near_clip_dist=0.1f, float far_clip_dist=1000.0f) |
Set the camera position, look at and up vectors. More... | |
void | SetRenderMode (RenderMode mode) |
void | SetParticleRenderMode (float radius, RenderMode mode) |
Static Public Member Functions | |
static ChOpenGLWindow & | getInstance () |
Get the unique instance for the OpenGL window. | |
static void | GLFWGetVersion (GLFWwindow *main_window) |
Provides the version of the OpenGL context along with driver information. | |
static void | WrapRenderStep (void *stepFunction) |
Callback wrapper for steps of the render loop. Works with Emscripten. | |
Public Attributes | |
ChOpenGLViewer * | viewer |
Pointer to the opengl viewer that handles rendering, text and user interaction. | |
Member Function Documentation
◆ DoStepDynamics()
bool chrono::opengl::ChOpenGLWindow::DoStepDynamics | ( | double | time_step | ) |
Perform a dynamics step, the user needs to use this so that pausing the simulation works correctly.
- Parameters
-
time_step integration step size
◆ Initialize()
void chrono::opengl::ChOpenGLWindow::Initialize | ( | int | size_x, |
int | size_y, | ||
const char * | title | ||
) |
Initialize the window and set up the OpenGL viewer class.
- Parameters
-
size_x Width of window in pixels size_y Height of window in pixels title Window title string
◆ SetCamera()
void chrono::opengl::ChOpenGLWindow::SetCamera | ( | ChVector<> | pos, |
ChVector<> | look, | ||
ChVector<> | up, | ||
float | scale = 0.5f , |
||
float | near_clip_dist = 0.1f , |
||
float | far_clip_dist = 1000.0f |
||
) |
Set the camera position, look at and up vectors.
- Parameters
-
pos The position of the camera look The point that the camera is looking at up The up vector associated with the camera scale zoom level near_clip_dist near clipping distance far_clip_dist far clipping distance
◆ StartDrawLoop()
void chrono::opengl::ChOpenGLWindow::StartDrawLoop | ( | double | time_step | ) |
This starts the drawing loop and takes control away from the main program.
This function is the easiest way to start rendering.
- Parameters
-
time_step integration step size
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_opengl/ChOpenGLWindow.h
- /builds/uwsbel/chrono/src/chrono_opengl/ChOpenGLWindow.cpp