Col files store the collision model of the game. It's made up of a header, multiple groups (info about a collision type), multiple vertices, and the vertex indexes to create triangles.
File Structure
* Header
* Group List
* Vertex List
* Triangle Variables
Intro part of the file, holds info about the future sections of the file
Section Offset
|
Byte Length
|
Description
|
0x00
|
4
|
Vertex Count: uint32
|
0x04
|
4
|
Vertex Offset: uint32
|
0x08
|
4
|
Group Count: uint32
|
0x0c
|
4
|
Group Offset: uint32
|
A group holds the information about a specific collision type. Each group has a vertex index offset, which specifies which vertex to start making triangles from (uses 3 and move to the next 3). Reminder that the order of vertices calculate the normal of the face.
Section Offset
|
Byte Length
|
Description
|
0x00
|
2
|
Collision Type: uint16
|
0x02
|
2
|
Triangle Count: uint16
|
0x04
|
1
|
Group Flags (Padding): bool
|
0x05
|
1
|
Has Col Parameter: bool
|
0x06
|
2
|
Padding: Always 0xFFFF
|
0x08
|
4
|
Vertex Index Offset: uint32
|
0x0C
|
4
|
Terrain Type Offset: uint32
|
0x10
|
4
|
Unknown Offset: uint32
|
0x14
|
4
|
Col Parameter Offset: uint32
|
Vertex Data
Section Offset
|
Byte Length
|
Description
|
0x00
|
4
|
X Pos: float32
|
0x04
|
4
|
Y Pos: float32
|
0x08
|
4
|
Z Pos: float32
|
The information held for each triangle
Section Offset
|
Byte Length
|
Description
|
0x00
|
1 uint8
|
Terrain Type
|
0x01
|
1 uint8
|
????
|
0x02
|
2 uint16
|
Parameter (if yes)
|