Breakable (RW Section)

From GTAMods Wiki
Revision as of 20:59, 1 October 2007 by Steve-m (talk | contribs) (reworked, fixed)
Jump to navigation Jump to search
{{{NAME}}}
RenderWare Stream Section
Vendor {{{VENDORNAME}}}
Module {{{MODULENAME}}}
Module ID 0x{{{MODULEID}}}
Identifier 0x{{{IDENTIFIER}}}
Chunk ID 0x{{{MODULEID}}}{{{IDENTIFIER}}}
Versions All
Hierarchy
Parents:
None
Children:
None
Extensions:
None
File Format

Mesh Extension is one of Rockstar's custom sections used in GTA San Andreas. It contains information on how to split breakable objects when they are hit. An object including this section has to be defined in object.dat.

The typical location in a SA dff section hierarchy is Clump > Geometry List > Geometry > Extension > Mesh Extension.

Header

There is a 56 byte header which holds information about the amount of data arrays that follow.

 4b - BYTE[4] - unknown, same as in the Night Vertex Colors section
 4b - UINT32  - Always 1
 4b - UINT32  - Vertex Count
 4b - UINT32  - Unknown (usually 0)
 4b - UINT32  - Unknown (usually 0)
 4b - UINT32  - Unknown (usually 0)
 4b - UINT32  - Face Count
 4b - UINT32  - Unknown (usually 0)
 4b - UINT32  - Unknown (usually 0)
 4b - UINT32  - Unknown (usually 0)
 4b - UINT32  - Material Count (= Fragment Count)
 4b - UINT32  - Unknown (usually 0)
 4b - UINT32  - Unknown (usually 0)
 4b - UINT32  - Unknown (usually 0)

Geometry Data

Vertices: array of [Vertex Count] elements
  12b - FLOAT[3]  - XYZ

UV Coords: array of [Vertex Count] elements
   8b - FLOAT[2]  - UV

Vertex Colors: array of [Vertex Count] elements
   4b - BYTE[4]   - RGBA

Faces: array of [Face Count] elements
   6b - UINT16[3] - 3 indices into vertex array

Material Assignments: array of [Face Count] elements
   2b - UINT16    - Material ID

Material Data

Each polygon group sharing the same material is treated as a separate fragment when the object is split up.

Texture Names: array of [Material Count] elements
  32b - CHAR[32]  - Texture Name

Alpha Names: array of [Material Count] elements
  32b - CHAR[32]  - Alpha Texture Name

Material Properties: array of [Material Count] elements
   4b - FLOAT[3]  - Unknown, possibly ambient/diffuse/specular, often 1.0

Tools and Scripts