Manager for the OpenGL context and window.
#include <ChOpenGLWindow.h>
|
| void | Initialize (int size_x, int size_y, const char *title, ChSystem *msystem) |
| | Initialize the window and set up the opengl viewer class. More...
|
| |
|
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) |
| |
|
| static ChOpenGLWindow & | getInstance () |
| | Get the unique instance for the OpenGL window. More...
|
| |
| static void | GLFWGetVersion (GLFWwindow *main_window) |
| | Provides the version of the OpenGL context along with driver information. More...
|
| |
|
static void | WrapRenderStep (void *stepFunction) |
| |
◆ 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 |
◆ getInstance()
| static ChOpenGLWindow& chrono::opengl::ChOpenGLWindow::getInstance |
( |
| ) |
|
|
inlinestatic |
Get the unique instance for the OpenGL window.
Call this function to get a pointer to the window.
◆ GLFWGetVersion()
| void chrono::opengl::ChOpenGLWindow::GLFWGetVersion |
( |
GLFWwindow * |
main_window | ) |
|
|
static |
Provides the version of the OpenGL context along with driver information.
- Parameters
-
| main_window | A pointer to the window/context |
◆ Initialize()
| void chrono::opengl::ChOpenGLWindow::Initialize |
( |
int |
size_x, |
|
|
int |
size_y, |
|
|
const char * |
title, |
|
|
ChSystem * |
msystem |
|
) |
| |
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 |
| msystem | The ChSystem that is attached to this window |
◆ 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 |
|
) |
| |
|
inline |
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 |
◆ 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