Ogre is choosen for the new visualisation.
The OgreVis encapsulates the Ogre root to manage the visualisation.
To create the ogre root, the simulated object OgreVis needs three files, to find the plugins, to know the configuration and to get the resources.
Ogre needs a set of plugins to work. To find them, it reads a file which defines the path and the set of those plugins. The user has two ways to tell which configuration file the Ogre root has to use. Either he defines the Ogre root path, or he defines the complet path to the configuration file. In its UserParams, the OgreVis object must find one of this two fields:
- OgreHome which defines the Ogre root path
- or PluginsCfg which defines the complet path to the configuration file
visuOgre
{
Class OgreVis
Scheduling
{
Frequency 60
}
UserParams
{
OgreHome "${OGRE_HOME}"
...
}
...
}
where ${OGRE_HOME} is a environment variable set by the user.
or
visuOgre
{
Class OgreVis
Scheduling
{
Frequency 60
}
UserParams
{
PluginsCfg "${OGRE_HOME}/bin/debug/Plugins.cfg"
...
}
...
}
When the OgreHome parameter is used, the plugins configuration file is looking in the following folders:
- for Windows in debug mode: OgreHome + "\bin\debug\Plugins.cfg"
- for Windows in release mode: OgreHome + "\bin\release\Plugins.cfg"
- for Linux: OgreHome + "/lib/OGRE/plugins.cfg"
- What to put in the plugin configuration file ?
The standard configuration file for plugins is this one (for Windows):
Plugins.cfg
# Defines plugins to load
# Define plugin folder
PluginFolder=. (1)
# Define plugins
Plugin=RenderSystem_Direct3D9 (2)
Plugin=RenderSystem_GL
Plugin=Plugin_ParticleFX
Plugin=Plugin_BSPSceneManager
Plugin=Plugin_OctreeSceneManager
Plugin=Plugin_CgProgramManager
It must be put in the same folder as the Ogre plugins.
- (1) the plugin folder must be set with the complete path for linux: /usr/local/lib/OGRE and with a relative path for Windows: .
- (2) Direct3D is not available for Linux so in this case the line must be deleted or comment
The user does not have to define the configuration, at the first run, Ogre opens a dialog to help the user to define the configuration. According to his choices, Ogre creates the configuration file.
Nevertheless there are two ways to define the location of the configuration file:
- The default way, Ogre will use the file ogre.cfg in the current folder
- The user way, Ogre will use the file define by ConfigFile in the user parameters of the OgreVis object.
visuOgre
{
Class OgreVis
Scheduling
{
Frequency 60
}
UserParams
{
OgreHome "${OGRE_HOME}"
ConfigFile "myOwnOgre.cfg"
...
}
...
}
By default the file is resources.cfg in the current folder, but the user can change that by setting the field ResourcesFile in the user parameters of the OgreVis object.
In this file the resources are set in the [General] by default, the user can change that by setting the field ResourceGroup.
visuOgre
{
Class OgreVis
Scheduling
{
Frequency 60
}
UserParams
{
OgreHome "${OGRE_HOME}"
ResourcesFile "myOwnResources.cfg"
ResourceGroup "NotTheGeneral"
...
}
...
}
By default there is no scene file, but the user can change that by setting the field SceneFile in the user parameters of the OgreVis object. visuOgre
{
Class OgreVis
Scheduling
{
Frequency 60
}
UserParams
{
OgreHome "${OGRE_HOME}"
SceneFile "myOwnSceneFile"
...
}
...
}