![]() |
OGRE
master
Object-Oriented Graphics Rendering Engine
|
DotScene (aka .scene) is just a standardized XML file format.
This file format is meant to be used to set up a scene or scene-part. It is useful for any type of application/ game. Editors can export to .scene format, and apps can load the format.
Besides Ogre, the jMonkeyEngine also supports loading .scene files.
DotScene file does not contain any mesh data, texture data, etc. It just contains elements that describe a scene.
A simple .scene file example:
To add logic properties to the scene you can use the <userData>
node as following:
On the C++ side, these are acessible via e.g.
To use DotScene it has to be loaded as another OGRE Plugin.
In plugins.cfg
, add the following line:
The Plugin will be then automatically used when you call SceneNode::loadChildren()
like
If there is a TerrainGroup defined in the .scene file, you can get it by:
The type is std::shared_ptr<Ogre::TerrainGroup>
, hence attachmentNode
owns it and will take it down on destruction.
The DotScene Plugin can process the static / instanced attributes of the Entity definition to add them to the scene as either Static Geometry or Instanced meshes.
If your scene has entities with the static property then the name referenced by the property is interpreted by the plugin as the name of the Static Geometry Group For example:
The plugin requires that the Static Geometry group or instance is created before loading the Scene and built afterwards. Continuing with the example above, supose you created a scene with entities belonging to the "Foliage" group.
Any configuration for the StaticGeometry should be done before the build()
call.
If your scene has entities with the instanced property then the name referenced by the property is interpreted by the plugin as the name of the Instance Manager For example:
The plugin requires that the Instance Manager is created before loading the Scene. Continuing with the example above, supose you created a scene with entities that you want to create with the "Foliage" Instance Manager.
Any configuration for the InstanceManager should be done before calling loadChildren()