Static World Structure
Static World Structure:
The static world structure is composed of two primary parts: the geometry
and the collision map. The geometry contains all of the data structures
necessary to render scenes, while the collision map consists of a simplified
geometry that contains only the information necessary to test for agent to
static world collision. The reason for this dichotomy is twofold: the first
reason is that having a separate collision map simplifies the calculations
involved in collision detection; the second is that non-rendering clients only
require only the collision map.
World Partitioning:
The static world structures (both geometry and collision maps) are
partitioned into "areas," each of which contains a cubic subset of the world.
The areas overlap by a fixed amount at their borders, and each of them
contains references to the geometric primitives that are wholly or partially
contained in its bounds.
The impetus behind this structure is effeciency, which it provides in two
ways. The primary gain is that when rendering a scene, the system need only
consider the primitives referenced by the "current" area (the one the camera
currently resides in). The second efficiency gain enables the first. The
fact that the areas overlap allows the system to ignore all areas other than
the current one, even at the borders. This is contingent upon the fact that
the areas overlap by the diameter of the camera's view sphere.
Geometry:
The geometry of the world consists of triangle meshes, texture maps, and
surface attributes. The triangles reference the surface attributes, which in
turn reference the texture maps (and include texture coordinates as well). The
textures themselves are stored as separate resources, to be referenced by
filename within the geometry resource.
Collision Map:
The collision map is similar to the mesh geometry, but greatly simplified.
It will consist of simplified triangle meshes (much like the geometry, but with
no surface attributes or texture data) and plane definitions (that greatly
simplify collision calculations).
As the collision system is implemented, it may be necessary to build a more
efficient structured representation. The most likely candidate for this is a
modified BSP-Tree style representation. The benefit of such a structure is
that it allows for very efficient classification of points within the world's
space. However, it would add complexity to the system, and building the tree
requires a fairly significant pre-processing step.