MKAGP BIN (File Format)
From Wexos's Wiki
MKAGP BIN is a collision format used in Mario Kart Arcade GP and Mario Kart Arcade GP 2.
File Format
The file byte order is always big endian.
Header
The file starts with the following header:
| Offset | Type | Description |
|---|---|---|
| 0x00 | Int32 | Grid width (W). |
| 0x04 | Int32 | Grid length (L). |
| 0x10 | Float | Grid cell X size. |
| 0x14 | Float | Grid cell Y size. |
| 0x18 | Float[3] | AABB minimum coordinate. |
| 0x24 | Float[3] | AABB maximal coordinate. |
Grid
At the end of the file, the grid cell headers are stored in 0x10 byte blocks, starting at EOF - (W * L * 0x10) - 0x10.
Cell
All offsets are absolute.
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Triangles offset. Garbage data if none for this cell. |
| 0x04 | Int32 | Number of Triangles. |
| 0x08 | UInt32 | Cubes offset. Garbage data if none for this cell. |
| 0x0C | Int32 | Number of Quads. |
Triangle
| Offset | Type | Description |
|---|---|---|
| 0x00 | Float[2] | Minimul coordinate for this triangle. |
| 0x08 | Float[2] | Maximal coordinate for this triangle. |
| 0x10 | Float[3][3] | Triangle vertices XYZ position. |
| 0x34 | Float[3][3] | Triangle edges XYZ position. |
| 0x58 | UInt32 | Neighbour triangle flag, used to determine which edges connect to other triangles. |
| 0x5C | UInt32 | MKAGP BIN flag. |
| 0x60 | Float[3] | Triangle normal. |
| 0x6C | Float | Negative dot product between triangle center and triangle normal. |
Quad
These seem to be used for the wall collision.
| Offset | Type | Description |
|---|---|---|
| 0x00 | Float[2][4] | Quad XZ positions. |
Tools
The following tools can handle MKAGP BIN files:
- (none)