Skip to content

Clipping Geometry

shartte edited this page Oct 21, 2015 · 5 revisions

Overview

The clipping geometry is organized into three types of files:

  • An index file called clipping.cgf in the map directory, which defines the actual geometry mesh files used by the map.
  • An instance file called clipping.cif in the map directory, which instantiates the geometry defined in clipping.cgf.
  • The actual geometry files referenced by clipping.cgf.

clipping.cgf

Has a very simple structure.

struct CgfFile {
  uint32_t count;
  char filename[260][count];
}

clipping.cif

Instantiates the meshes found in clipping.cgf and places them around the map.

struct CifObj {
  int meshIdx; // Index of the mesh, correlate with CGF file
  float posX;
  float posY;
  float posZ;
  float scaleX;
  float scaleY;
  float scaleZ;
  float rotation;
}

struct CifFile {
  uint32_t count;
  CifObj obj[count];
}

Geometry Files

These are a bit odd...

struct DagFile {
  float boundingSphereX;
  float boundingSphereY;
  float boundingSphereZ;
  float boundingSphereRadius;
  int objCount;
  int dataStart; // Offset relative to start of file where 
                 // the first DagFileObj is
}

struct DagFileObj {
  int vertexCount;
  int primCount;
  int vertexDataStart; // Offset relative to start of file,
                       // where vertexCount vertices of
                       // type DagFileVertex reside
  int indexDataStart;  // Offset relative to start of file,
                       // where 3 * primCount indices of 
                       // type uint16_t reside
}

struct DagFileVertex {
  float x;
  float y;
  float z;
}

Clone this wiki locally