Skip to content

Collision surfaces

GameBox (Nadeo)Collision and physicsApplies toTMNF

A tree’s collision shape is a CPlugSurfaceGeom: a box, an ellipsoid or a triangle mesh, the mesh stored cooked, with a plane per triangle and an octree over them. Observed · the install’s packs and three TMUnlimiter maps

Order Field Type Confidence
1 Ident ident Observed
2 Bounding box BoxAligned: centre, then half-size (six f32) Observed
3 Surface kind i32 Observed
4 The shape by kind, below Observed
5 Material ID i16 Observed

This is the order in the surfaces TMUnlimiter maps embed. Observed · three maps The packs’ 812 surfaces are of surface version 0 and store no surface index; their kinds are 801 meshes, 8 ellipsoids and 3 boxes. Observed · 812 nodes of the packs

Kind Shape Confidence
1 Ellipsoid: a vec3 Observed
6 Box: a BoxAligned Observed
7 Mesh Observed

The box reads as centre and half-size: in the 77 meshes of three TMUnlimiter maps it equals the vertices’ bounds that way. Observed · 77 meshes

Order Field Type Confidence
1 Vertices counted vec3 Observed
2 Triangles counted 32-byte records: a vec4 plane, three i32 vertex indices, an i16 surface index and two u8 Observed
3 Octree version 3, counted 32-byte cells Observed

Observed · the 77 meshes of three maps

Reading this chunk in a pack also makes a dummy write of f32(centreX − halfSizeX), little-endian, right after the box: in GBX.NET’s terms the box’s X − X2, its first and fourth floats. Observed · the writes GBX.NET makes over the install’s packs

What are the triangle’s two bytes and the octree’s cells?

The triangle record’s last two bytes and the 32-byte octree cells are read and accounted for; their meaning is not established. Nor is it written down here how the packs’ surface version 0 differs from the order above.

Sources

  • GBX.NET — version 2.5.0; CPlugSurfaceGeom and its surface readers