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

4.10.11 Portal Container Mesh Object

Written by Jorrit Tyberghein, ([email protected]).

This is a special type of mesh object which basically represents a collection of portals. The portal container is not implemented as a seperate plugin but is built-in into the engine plugin. There is no type or factory interface for portal containers. They are created by the engine directly as mesh objects.

Object State Interface

`iPortalContainer' (residing in `CS/include/iengine/portalcontainer.h') is the SCF interface that you can use to manipulate settings for a portal container. By using this interface you can access the portals contained in this portal container.

To create a portal container you need to use API calls in the engine: iEngine::CreatePortalContainer() and iEngine::CreatePortal(). Portal containers are normal mesh objects otherwise. They implement iMeshObject and are put in a sector like other mesh objects.

Object Loader

With normal mesh objects you have a specific loader plugin to load the mesh. Portal containers are loaded by the standard map loader instead. There are two basic ways to add a portal container to a sector. Either you use `portals' to define multiple portals at once (in one portal container) or else you use a single `portal' statement to create a portal container with one portal. In both cases you place it in a sector (it becomes a normal mesh object). In the case of `portals' you can also add many regular mesh object statement like `move' to move the portal and others. Here is an example:

 
<portals name="myPortal">
  <portal>
    <v x="0.2" y="2.8" z="-0.8" />
    <v x="0.2" y="2.8" z="0.8" />
    <v x="0.2" y="-1" z="0.8" />
    <v x="0.2" y="-1" z="-0.8" />
    <sector>destSector</sector>
    <float />
    <clip />
  </portal>
  <hardmove>
    <v x="13" y="0" z="12" />
  </hardmove>
  <priority>object</priority>
</portals>

Here you see how a portal container with a single portal is created. The destination sector is `destSector'.

When you use the short-hand `portal' statement you can't set mesh parameters like the position of the portal (you'll have to encode position in the vertices) and render priority.

Here is a list of all the tags supported by a portal object and their meaning (these tags are for usage inside the `portal' statement and not directly inside `portals'):


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated using texi2html 1.76.