Difference between revisions of "Breakable (RW Section)"

From GTAMods Wiki
Jump to navigation Jump to search
m (DK22Pac moved page Mesh Extension (RW Section) to Breakable model (RW Section): "Mesh extension" looks like a very general name. I believe it has it cause it was an unknown section some time.)
m
Line 1: Line 1:
 
{{RW Section|Mesh Extension|0x0253F2FD}}
 
{{RW Section|Mesh Extension|0x0253F2FD}}
  
'''Mesh Extension''' is one of Rockstar's [[List of RW section IDs#Rockstar.27s_Custom_Sections|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]].
+
'''Breakable model''' is one of Rockstar's [[List of RW section IDs#Rockstar.27s_Custom_Sections|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 [[model file|dff]] section hierarchy is ''[[Clump (RW Section)|Clump]] > [[Geometry List (RW Section)|Geometry List]] > [[Geometry (RW Section)|Geometry]] > [[Extension (RW Section)|Extension]] > Mesh Extension.
+
The typical location in a SA [[model file|dff]] section hierarchy is ''[[Clump (RW Section)|Clump]] > [[Geometry List (RW Section)|Geometry List]] > [[Geometry (RW Section)|Geometry]] > [[Extension (RW Section)|Extension]] > Breakable model.
  
 
==Header==
 
==Header==
Line 9: Line 9:
 
There is a ''56 byte'' header which holds information about the amount of data arrays that follow.
 
There is a ''56 byte'' header which holds information about the amount of data arrays that follow.
  
   4b - UINT32  - Offset to this data (zero if ''Mesh Extension'' is not used)
+
   4b - UINT32  - Offset to this data (zero if ''Breakable model'' is not used)
 
   4b - UINT32  - Position rule (if 1 then position is calculated relatively to object collision model, if 0 - to clump position)
 
   4b - UINT32  - Position rule (if 1 then position is calculated relatively to object collision model, if 0 - to clump position)
 
   4b - UINT32  - Vertex Count
 
   4b - UINT32  - Vertex Count
Line 55: Line 55:
  
 
==Tools and Scripts==
 
==Tools and Scripts==
* {{GTAF|269717|Breakable Objects Export Script}} by {{U|Deniska}}. A script for 3dsMax which allows to export MeshExtension information to seperate files.
+
* {{GTAF|269717|Breakable Objects Export Script}} by {{U|Deniska}}. A script for 3dsMax which allows to export Breakable model information to seperate files.

Revision as of 16:43, 15 December 2014

{{{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

Breakable model 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 > Breakable model.

Header

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

 4b - UINT32  - Offset to this data (zero if Breakable model is not used)
 4b - UINT32  - Position rule (if 1 then position is calculated relatively to object collision model, if 0 - to clump position)
 4b - UINT32  - Vertex Count
 4b - UINT32  - Offset to vertices (unused)
 4b - UINT32  - Offset to texture coors (unused)
 4b - UINT32  - Offset to vertex colors (unused)
 4b - UINT32  - Face Count
 4b - UINT32  - Offset to faces (unused)
 4b - UINT32  - Offset to material assignments (unused)
 4b - UINT32  - Material Count (= Fragment Count)
 4b - UINT32  - Offset to textures  (unused)
 4b - UINT32  - Offset to texture names  (unused)
 4b - UINT32  - Offset to mask names  (unused)
 4b - UINT32  - Offset to material properties  (unused)

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
  12b - FLOAT[3]  - ambient/specular/diffuse, often 1.0

Tools and Scripts