Description
OpenGL-based run-time visualization system for GPU systems.
Requires the Chrono::OpenGL module.
Visualization is based on a separate Chrono system which carries proxies for all particles in the Chrono::Gpu system. This separate system can be provided by the user or else created automatically. Note that using run-time visualization for a Chrono::Gpu system incurs the penalty of collecting positions of all particles every time the Render() function is invoked.
#include <ChGpuVisualizationGL.h>


Public Member Functions | |
ChGpuVisualizationGL (ChSystemGpu *sysGPU) | |
Create a run-time visualization object associated with a given Chrono::Gpu system. | |
virtual void | SetTitle (const std::string &title) override |
Set title of the visualization window (default: ""). | |
virtual void | SetSize (int width, int height) override |
Set window dimensions (default: 1280x720). | |
virtual void | AddCamera (const ChVector3d &pos, const ChVector3d &target) override |
Add a camera initially at the specified position and target (look at) point. | |
virtual void | UpdateCamera (const ChVector3d &pos, const ChVector3d &target) override |
Set camera position and target (look at) point. | |
virtual void | SetCameraVertical (CameraVerticalDir up) override |
Set camera up vector (default: Z). | |
virtual void | SetCameraMoveScale (float scale) override |
Set scale for camera movement increments (default: 0.1). More... | |
virtual void | Initialize () override |
Initialize the run-time visualization system. More... | |
virtual bool | Render () override |
Render the current state of the Chrono::Gpu system. More... | |
virtual ChVisualSystem * | GetVisualSystem () const override |
Return the underlying OpenGL visualization system. | |
![]() | |
void | AttachSystem (ChSystem *system) |
Attach a user-provided Chrono system for rendering. More... | |
void | AddProxyBody (std::shared_ptr< ChBody > body) |
Add additional proxy body to supplemental system. More... | |
Additional Inherited Members | |
![]() | |
ChGpuVisualization (ChSystemGpu *sysGPU) | |
Create a run-time visualization object associated with a given Chrono::Gpu system. More... | |
![]() | |
ChSystemGpu * | m_systemGPU |
associated Chrono::Gpu system | |
ChSystem * | m_system |
internal Chrono system (holds proxy bodies) | |
ChSystem * | m_user_system |
optional user-provided system | |
std::shared_ptr< ChParticleCloud > | m_particles |
particle cloud proxy for particles | |
Member Function Documentation
◆ Initialize()
|
overridevirtual |
Initialize the run-time visualization system.
If the Chrono::OpenGL module is not available, this function is no-op.
Reimplemented from chrono::gpu::ChGpuVisualization.
◆ Render()
|
overridevirtual |
Render the current state of the Chrono::Gpu system.
This function, typically invoked from within the main simulation loop, can only be called after construction of the Gpu system was completed (i.e., the system was initialized). This funtion querries the positions of all particles in the Gpu system in order to update the positions of the proxy bodies. Returns false if the visualization window was closed. If the Chrono::OpenGL module is not available, this function is no-op.
Implements chrono::gpu::ChGpuVisualization.
◆ SetCameraMoveScale()
|
overridevirtual |
Set scale for camera movement increments (default: 0.1).
Must be called before Initialize().
Reimplemented from chrono::gpu::ChGpuVisualization.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_gpu/visualization/ChGpuVisualizationGL.h
- /builds/uwsbel/chrono/src/chrono_gpu/visualization/ChGpuVisualizationGL.cpp