This is the default visualization system for interactive 3D viewing of Chrono simulations.
If you develop your custom application based on Chrono, you may use other visualization systems (ex. Ogre3D, CryEngine, plain OpenGL or others) and you do not need this module, however this IRRLICHT module is used here in most demos and tutorials because it is lightweight and simple.
Read the introduction to modules for a technical background on the modularity of the Chrono project.
Features
The IRRLICHT module is used to show Chrono::Engine tutorials and demos in an interactive 3D OpenGL view.
Here are the main features:
- Irrlicht shapes and textures can be added as assets to ChBody objects.
- A default lightweight application framework is provided (ChIrrApp) that can be used for default light/camera managements.
- The Irrlicht view of the default application supports some mouse and key interaction:
- mouse left button for camera rotation
- mouse right button for camera x z motion
- mouse wheel rotation for camera forward/backward
- mouse wheel button to pick & drag objects (only if they have a collision shape!)
- press 'i' to see a setting panel,
- press arrows to have x z camera motion, press page up & down for y vertical motion
- press spacebar to stop simulation
- press 'p' to advance one timestep a time.
- press 'print screen' to start saving screenshots to disk
- etc. (see the 'i' panel)
- There are some easy functions to draw grids, lines, springs, plots.
- Contacts can be optionally drawn with vectors in 3D view
- Link coordinate systems can be plotted on the 3D view
- etc.
Requirements
- To run applications based on this module you need the Irrlicht library (i.e. the Irrlicht.dll on Windows)
- To build applications applications based on this module you must have the Irrlicht SDK installed.
Building instructions
Instructions on how to install the required Irrlicht library are already reported in the Chrono installation page. If you followed those instructions, you do not need to do anything. Otherwise do what follows.
- download Irrlicht Engine
- unzip it in whatever directory.
For example, here we suppose that you unzipped it inC:/engine_demos/irrlicht-1.8.4
. - Repeat the instructions for the full installation, but when you see the CMake window, you must add the following steps:
- Set the
ENABLE_MODULE_IRRLICHT
as 'on', then press 'Configure' (to refresh the variable list) - Set the directory in
IRRLICHT_ROOT
: it must contain the path to your unzipped Irrlicht directory.
In our example, browse toC:/engine_demos/irrlicht-1.8.4
- The corresponding
IRRLICHT_LIBRARY
should be found automatically: it must contain the file of the Irrlicht.lib.
In our example, browse toC:/engine_demos/irrlicht-1.8.4/lib/Win64-visualStudio/Irrlicht.lib
. - Press 'Configure' again, then 'Generate', and proceed as usual in the installation instructions.
How to use it
- Look at the API section of this module for documentation about classes and functions.
- Look at the C++ source of demos to learn how to use the functions of this module.