The .csm file format
Darkened
cells indicate stacked data, i.e. “for 1 to groups read the group structure”.
The
basic structure looks like this:
Groups
Lightmaps
Pixels
Meshes
Surfaces
Vertices
Triangles
Lines
Entities
Data type |
Variable |
Explanation |
long |
version |
Should be 4 |
long |
groups |
Number of groups |
long |
flags |
|
long |
group |
This group’s group (if applicable) |
string |
properties |
Entity properties |
long |
red |
Object color |
long |
green |
Object color |
long |
blue |
Object color |
long |
lightmaps |
Number of lightmaps |
long |
width |
|
long |
height |
|
long |
RGBA |
Pixel color |
long |
meshes |
Number of meshes |
long |
flags |
|
long |
group |
|
string |
properties |
Entity properties |
long |
red |
Object color |
long |
green |
Object color |
long |
blue |
Object color |
float |
x |
Center position |
float |
y |
Center position |
float |
z |
Center position |
long |
surfaces |
Number of surfaces |
long |
flags |
|
string |
texturename |
Texture name in the format “subdirectory\texture.jpg” |
long |
lightmap |
Lightmap index |
float |
U offset |
Texture mapping parameters |
float |
V offset |
Texture mapping parameters |
float |
U scale |
Texture mapping parameters |
float |
V scale |
Texture mapping parameters |
float |
rotation |
Texture mapping parameters |
long |
vertices |
Number of vertices |
long |
triangles |
Number of triangles |
long |
lines |
Number of lines |
float |
x |
Position |
float |
y |
|
float |
z |
|
float |
nx |
Normal |
float |
ny |
|
float |
nz |
|
long |
red |
Color |
long |
green |
|
long |
blue |
|
float |
U |
Texture coordinates |
float |
V |
|
float |
W |
|
float |
U |
Lightmap coordinates |
float |
V |
|
float |
W |
|
long |
a |
Triangle vertices |
long |
b |
|
long |
c |
|
long |
a |
Line vertices |
long |
b |
|
long |
entities |
Number of entities |
long |
flags |
|
long |
group |
|
string |
properties |
Entity properties |
float |
x |
Position |
float |
y |
|
float |
z |
|
float |
x |
Camera position |
float |
y |
|
float |
z |
|
float |
pitch |
Camera rotation |
float |
yaw |
|