Scene Effects Plugin¶
Overview¶
The scene effects plugin (SceneEffectsPlugin) is a plugin that makes it possible to render effects such as fire and smoke in the scene. The effects are rendered with particle systems and can be used by describing them as devices of body models.
The effect devices can also be turned on and off from controllers like other devices, so they can be utilized, for example, for building simulation environments that simulate disaster sites.
How to Build¶
This plugin can be built by turning ON the CMake option BUILD_SCENE_EFFECTS_PLUGIN. No external libraries are required.
Effect Devices¶
This plugin makes the following effect devices available. Each of them is described as a device node under the elements of a link in body-format model files (specify the following node type names for type).
FireDevice : A fire effect. It gives a fire-like representation in which particles blow upward while attenuating.
SmokeDevice : A smoke effect. It represents smoke rising while spreading.
FountainDevice : A fountain effect. It represents particles spouting out and falling by gravity, which can also be used for representing water discharge.
RainDevice : A rain effect. It represents raindrops falling.
SnowDevice : A snow effect. It represents snow falling.
Parameters¶
Each effect device is based on a common particle system, and the following parameters can be set in the device node. Appropriate default values are set for each type of effect, so you usually only need to describe the parameters you want to adjust.
Parameter |
Meaning |
|---|---|
|
The offset that skips the time from the start of the effect until the particle states reach a steady state [s]. |
|
The lifetime of each particle [s]. |
|
The rendering size of the particles. |
|
The number of particles. Larger values result in denser representations, but increase the rendering cost. |
|
The average of the initial speeds of the particles. |
|
The variation of the initial speeds of the particles. |
|
The angle range in which the particles are emitted. |
|
The acceleration vector applied to the particles. For example, a downward acceleration corresponding to gravity is set for fountains. |
|
The color (RGB) multiplied to the particles. The color tone of the effect can be adjusted. |
How to Use¶
By loading a body model in which effect devices are described, the effects are rendered on the scene view. The on/off state of the devices can be controlled from controllers, and the generation and stop of the effects can be switched during simulation.
A sample project is provided as sample/SceneEffects/PlantAccident.cnoid. This is a sample of an environment simulating a plant accident, in which fire and smoke effects are used. Refer to the models used in this sample for how to describe the devices.