5.4.2.2 World Element Section

This section describes the world element section.

Addon Section

Addons are loader plugins that can be used to extend the loading
capabilities. Like keys, addons can also be loaded from almost any
Crystal Space object. The difference is that the loaded information
is not automatically attached to the object. Instead the object in which
the addon is called is given as a context to the addon loader
so that it can choose to do with it whatever it wants. For example, you
could make an addon plugin for your own game that sets up a physics
object for a mesh object. To do that you would have to create a plugin
that implements the ‘iLoaderPlugin’ interface. In the plugin
implementation you can examine the context and based on that create some
information that you can attach to that context (if it is a mesh object
for example). The addon plugin will also get an XML node that it
can parse for additional parameters.

Mesh Factory Section

In a map file you can define zero or more mesh factories. A mesh factory
itself is not an object that you can see. It only defines a blue-print
for creating mesh objects later. How a mesh factory and mesh object
interact depends on the specific type of mesh object. For some types
factories are required but for others you can just define the object
directly as a mesh object (see section Mesh Object Plug-In System).

In the example above we use the ‘genmesh’ factory loader plugin.
Everything inside the ‘params’ block is specific to that loader. If
you use other loaders you will need other stuff in there.
It is also possible to specify the parameters of a plugin in another
XML file in which case you can use ‘paramsfile’. The use
of ‘paramsfile’ is required if the other file is binary or not
XML.

The example above defines a factory called ‘square’. When you later
define mesh objects you can create them from that factory. In case of
‘genmesh’ which is used here you must use factories.