Polygon Soup List/Need for Speed
(Redirected from Polygon Soup List/Need for Speed Most Wanted)
Structures
Header
CgsGeometric::PolygonSoupList
32-bit
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x20 | AxisAlignedBox | mOverallAabb | Bounding box | |
0x20 | 0x4 | PolygonSoup** | mpapPolySoups | Polygon soups | Structures aligned 0x80 relative to end of last real soup box |
0x24 | 0x4 | AxisAlignedBox4* | mpaPolySoupBoxes | Polygon soup bounding boxes | "Fake" boxes exist at end if num soups not multiple of 4 "Fake" box indices match padding in soup pointer table |
0x28 | 0x4 | int32_t | miNumPolySoups | Number of polygon soups | |
0x2C | 0x4 | int32_t | miDataSize | Resource data length |
64-bit
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x20 | AxisAlignedBox | mOverallAabb | Bounding box | |
0x20 | 0x8 | PolygonSoup** | mpapPolySoups | Polygon soups | Structures aligned 0x80 relative to end of last real soup box |
0x28 | 0x8 | AxisAlignedBox4* | mpaPolySoupBoxes | Polygon soup bounding boxes | "Fake" boxes exist at end if num soups not multiple of 4 "Fake" box indices match padding in soup pointer table |
0x30 | 0x4 | int32_t | miNumPolySoups | Number of polygon soups | |
0x34 | 0x4 | int32_t | miDataSize | Resource data length |
Polygon soup
CgsGeometric::PolygonSoup
32-bit
Offset | Length | Type | Name | Description | Comments | ||
---|---|---|---|---|---|---|---|
0x0 | 0x4 | PolygonSoupPoly* | mpaPolygons | Polygons | |||
0x4 | 0x4 | PolygonSoupVertex* | mpaVertices | Packed vertices | Hardcoded to always be at 0x10 relative to start of PolygonSoup. To unpack, multiply each field by the vertex scale, 0.0152587890625. The game also uses the two bytes after the vertex as a 4th element, to which 500 * mu8NumQuads is added after applying the vertex scale (where 500 is the offset scale). The reason for this is unclear.
| ||
0x8 | 0x2 | uint16_t | mu16DataSize | Data length | Counted from end of prior data, not start of structure | ||
0xA | 0x1 | int8_t | mn8OffsetX |
| |||
0xB | 0x1 | int8_t | mn8OffsetY | ||||
0xC | 0x1 | int8_t | mn8OffsetZ | ||||
0xD | 0x1 | uint8_t | mu8NumQuads | Number of quads | |||
0xE | 0x1 | uint8_t | mu8TotalNumPolys | Number of polygons | |||
0xF | 0x1 | uint8_t | mu8NumVertices | Number of vertices |
64-bit
Offset | Length | Type | Name | Description | Comments | ||
---|---|---|---|---|---|---|---|
0x0 | 0x8 | PolygonSoupPoly* | mpaPolygons | Polygons | |||
0x8 | 0x8 | PolygonSoupVertex* | mpaVertices | Packed vertices | Hardcoded to always be at 0x20 relative to start of PolygonSoup. To unpack, multiply each field by the vertex scale, 0.0152587890625. The game also uses the two bytes after the vertex as a 4th element, to which 500 * mu8NumQuads is added after applying the vertex scale (where 500 is the offset scale). The reason for this is unclear.
| ||
0x10 | 0x2 | uint16_t | mu16DataSize | Data length | Counted from end of prior data, not start of structure | ||
0x12 | 0x1 | int8_t | mn8OffsetX |
| |||
0x13 | 0x1 | int8_t | mn8OffsetY | ||||
0x14 | 0x1 | int8_t | mn8OffsetZ | ||||
0x15 | 0x1 | uint8_t | mu8NumQuads | Number of quads | |||
0x16 | 0x1 | uint8_t | mu8TotalNumPolys | Number of polygons | |||
0x17 | 0x1 | uint8_t | mu8NumVertices | Number of vertices |
CgsGeometric::PolygonSoupPoly
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | uint32_t | muCollisionTag | Collision tag | See CollisionTag |
0x4 | 0x4 | uint8_t[4] | mau8VertexIndices | Vertex indices | |
0x8 | 0x4 | uint8_t[4] | mau8EdgeCosines | Compressed edge cosines | To get radians: value / 255 * π Sine of radians is uncompressed edge cosine |
CgsGeometric::PolygonSoupVertex
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x2 | uint16_t | mu16X | ||
0x2 | 0x2 | uint16_t | mu16Y | ||
0x4 | 0x2 | uint16_t | mu16Z |
Collision tag
World::CollisionTag
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | uint32_t | muCollisionTag | Collision tag | See bit fields below |
Bit fields
Offset (bits) | Length (bits) | Name | Description | Comments |
---|---|---|---|---|
0 | 12 | ? | Track unit index | |
12 | 4 | ? | Reserved? | Reserved/unused space? |
16 | 8 | ? | Surface index | From surface list |
24 | 2 | ? | Reserved | Reserved/unused space |
26 | 6 | ? | Flags | See EFlags Enum values are bit shifts (flag = (tag >> value) & 1) |
Offset (bits) | Length (bits) | Name | Description | Comments |
---|---|---|---|---|
0 | 12 | ? | Track unit index | |
12 | 7 | ? | Surface index | From surface list |
19 | 3 | ? | Reserved | Reserved/unused space |
22 | 10 | ? | Flags | See EFlags Enum values are bit shifts (flag = (tag >> value) & 1) |
Example collision tag
From Most Wanted.
Bit value | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parsed value | 626 | 9 | N/A | 0x7 (flags: 0x1|0x2|0x4) | ||||||||||||||||||||||||||||
Description | Track unit 626 | Surface 9 (ID 276035) | Reserved | E_FLAG_DRIVABLE E_FLAG_ROAD E_FLAG_KERB |
Boxes
CgsGeometric::AxisAlignedBox
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x10 | Vector3 | mMin | ||
0x10 | 0x10 | Vector3 | mMax |
CgsGeometric::AxisAlignedBox4
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x10 | Vector4 | mAabbMinX | ||
0x10 | 0x10 | Vector4 | mAabbMinY | ||
0x20 | 0x10 | Vector4 | mAabbMinZ | ||
0x30 | 0x10 | Vector4 | mAabbMaxX | ||
0x40 | 0x10 | Vector4 | mAabbMaxY | ||
0x50 | 0x10 | Vector4 | mAabbMaxZ | ||
0x60 | 0x10 | Mask4 | mValidMasks |
Enumerations
World::CollisionTag::EFlags
Need for Speed Hot Pursuit
Name | Value | Comments |
---|---|---|
E_FLAG_DRIVABLE | 0 | 0x1 |
E_FLAG_ROAD | 1 | 0x2 |
E_FLAG_KERB | 2 | 0x4 |
E_FLAG_REMOVABLE | 3 | 0x8 |
E_FLAG_FATAL | 4 | 0x10 |
E_FLAG_SUPER_FATAL | 5 | 0x20 |
E_FLAG_COUNT | 6 |
Need for Speed Most Wanted
Name | Value | Comments |
---|---|---|
E_FLAG_DRIVABLE | 0 | 0x1 |
E_FLAG_ROAD | 1 | 0x2 |
E_FLAG_KERB | 2 | 0x4 |
E_FLAG_DECAL | 3 | 0x8 |
E_FLAG_SOLID_DECAL | 4 | 0x10 |
E_FLAG_REMOVABLE | 5 | 0x20 |
E_FLAG_FATAL | 6 | 0x40 |
E_FLAG_SUPER_FATAL | 7 | 0x80 |
E_FLAG_FATAL_FIELD | 8 | 0x100 |
E_FLAG_LOCAL_PLAYER_ONLY | 9 | 0x200 |
E_FLAG_COUNT | 10 |