Clustered Mesh: Difference between revisions

what a mess
(Initial documentation)
 
(what a mess)
Line 111:
| 0x4 || 0x2 || uint16_t || mFlags || || List of flags is unknown
|-
| 0x6 || 0x1 || uint8_t || mGroupIdSize || Number of bytes || 1 or 2
|-
| 0x7 || 0x1 || uint8_t || mSurfaceIdSize || Number of bytes || 1 or 2
|}
 
Line 164:
| 0x2 || 0x2 || uint16_t || unitDataSize || ||
|-
| 0x4 || 0x2 || uint16_t || unitDataStart || The index of the vertex array where unit data starts ||
|-
| 0x6 || 0x2 || uint16_t || normalStart || The index of the vertex array where normal data starts ||
|-
| 0x8 || 0x2 || uint16_t || totalSize || ||
Line 174:
| 0xB || 0x1 || uint8_t || normalCount || ||
|-
| 0xC || 0x1 || uint8_t || compressionMode || || 0, 1 or 2
|-
| 0xD || 0x3 || uint8_t[3] || padding || ||
|-
| 0x10 || 0x10 || [[#Vector3|vpu::Vector3]][1] || vertexArray || Variable size data || What format{{Todo|Normals?}}[[# Vertex data|Vertex data]]<br>[[#Unit data|Unit data]]
|}
 
==== Vertex data ====
 
{| class="wikitable"
|+ Compression mode 0 (uncompressed)
|-
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0<br>(repeating) || 0x10 || [[#Vector3|vpu::Vector3]]? || ? || ||
|}
 
{| class="wikitable"
|+ Compression mode 1
|-
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0xC || float[3] || ? || ||
|-
| 0xC<br>(repeating) || 0x6 || ? || ? || || Add this to initial 3-float vector and multiply components by mVertexCompressionGranularity?
|}
 
{| class="wikitable"
|+ Compression mode 2
|-
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0<br>(repeating) || 0xC || ? || ? || || Multiply components by mVertexCompressionGranularity?
|}
 
==== Unit data ====
This is a byte stream. Exact offsets are variable and depends on several factors, as detailed below.
 
{| class="wikitable"
! Length !! Type !! Description !! Comments
|-
| 0x1 || uint8_t || '''Lower nibble''' (type)<br>1 - ?<br>2 - ?<br>3 - ?<br>'''Upper nibble'''<br>Flag 1 - ?<br>Flag 2 - ?<br>Flag 4 - Has a group ID<br>Flag 8 - Has a surface ID ||
|-
| 0x1 || uint8_t || '''Only present if type == 3'''<br>The size of ? ||
|-
| Variable || ? || Size is 1 for type 1, 2 for type 2, and specified by the previous byte for type 3. ||
|-
| 0x2 || ? || ? || ?
|-
| 2 + variable size again || ? || '''Only present with flag 2''' || ?
|-
| Group ID size (see [[#rw::collision::ClusterParams|ClusterParams]]) || uint8_t or uint16_t || '''Only present with flag 4'''<br>Group ID || This is always little endian.
|-
| Surface ID size (see [[#rw::collision::ClusterParams|ClusterParams]]) || uint8_t or uint16_t || '''Only present with flag 8'''<br>Surface ID || This is always little endian.
|}
117

edits