Crystal Space 2.0.0: 5.4.2.3 World Definition Section

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

#### 5.4.2.3 World Definition Section

This section describes the world definition section.

#### Sector Section

A map file usually contains at least one sector. A sector is an infinite area of space which you can populate with mesh objects and lights. Using portals you can connect different sectors.

Note that while a sector is in fact infinite, in practice it is usually bounded by some geometry. For an outside level there is usually a sky box or sky dome which marks the outermost geometry. In case of indoor type levels there are usually sector walls.

Here is an example sector:

    <sector name="room">
      <meshobj name="walls">
        <plugin>crystalspace.mesh.loader.genmesh</plugin>
        <zfill />
        <params>
          ...
        </params>
      </meshobj>
      <light>
        <center x="0" y="3" z="0"/>
        <radius>40</radius>
        <color red="1" green="1" blue="1"/>
      </light>
    </sector>

In the above example we create a sector called `‘room’` which contains one mesh object (the outer walls of the sector) and one light. Any type of mesh object can be placed in a sector. In this example we use the `‘genmesh’` mesh object.

There are some other things you can specify in a sector. By default a sector will use the `‘frustvis’` visibility culler. This visibility culler will only do frustum culling. For small sectors (i.e. a small number of objects) this is usually sufficient. If you have a large sector with lots of objects then you should probably use `‘dynavis’` instead. Like this:

    <cullerp>crystalspace.culling.dynavis</cullerp>

In addition to using `‘meshobj’` for specifying mesh objects in a sector there are also some other techniques that you can use.

A sector can also contain fog like this:

    <fog red=".5" green=".5" blue=".5" density=".01" />

Finally a sector can contain nodes. A node represents something that has a position. In addition a node can contain keys and addons. Crystal Space itself doesn't use nodes but an application using Crystal Space can use them for whatever purpose it needs. Here is an example:

    <node name="monster">
        <position x="10" y="3" z="12" />
        <key name="spawn" value="100" />
    </node>

Sectors can contain keys and addons.

#### Collection Specification

With collections it is possible to group related objects (like textures, materials, mesh objects, mesh factories, sectors, sequences, triggers, shared variables, ...). Collections are not a geometrical concept. It is possible to define a collection which contains all wall geometry and a collection which contains all moving geometry. Usually though, collections represent some area in the world. You can use collections to dynamically load/unload parts of the world. This is useful if you have really big worlds that don't fit in memory at once.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated using texi2html 1.76.