Clustered Mesh: Difference between revisions
m
no edit summary
m (typo) |
mNo edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 20:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || [[#rw::collision
|-
| 0x4 || 0xC || || || Padding ||
Line 27:
|}
=== rw::collision
==== 32-bit ====
{| class="wikitable"
Line 46:
| 0x58 || 0x4 || uint32_t || surfaceID || ||
|-
| 0x5C || 0x4 || uint32_t || m_flags || ||
|}
=== rw::collision::VolumeFlag ===
Note that this is sourced from February 2007 data and may or may not have changed in later versions.
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
| VOLUMEFLAG_ISENABLED || 1 ||
|-
| VOLUMEFLAG_TRIANGLENORMALISDIRTY || 2 ||
|-
| VOLUMEFLAG_TRIANGLEONESIDED || 16 ||rowspan=8|These precise values (but not the existence of the flags themselves) are technically platform-specific and is documented for PS3. It may or may not be actually different on other platforms.
|-
| VOLUMEFLAG_TRIANGLEEDGE0CONVEX || 32
|-
| VOLUMEFLAG_TRIANGLEEDGE1CONVEX || 64
|-
| VOLUMEFLAG_TRIANGLEEDGE2CONVEX || 128
|-
| VOLUMEFLAG_TRIANGLEUSEEDGECOS || 256
|-
| VOLUMEFLAG_TRIANGLEVERT0DISABLE || 512
|-
| VOLUMEFLAG_TRIANGLEVERT1DISABLE || 1024
|-
| VOLUMEFLAG_TRIANGLEVERT2DISABLE || 2048
|-
| VOLUMEFLAG_FORCEENUMSIZEINT || 0x7FFFFFFF ||
|}
Line 122 ⟶ 153:
| 0x0 || 0x4 || float32_t || mVertexCompressionGranularity || || Relevant for cluster compression modes 1 and 2
|-
| 0x4 || 0x2 || uint16_t || mFlags || ||
|-
| 0x6 || 0x1 || uint8_t || mGroupIdSize || Number of bytes || 1 or 2
|-
| 0x7 || 0x1 || uint8_t || mSurfaceIdSize || Number of bytes || 1 or 2
|}
=== rw::collision::CMFlags ===
Note that this is sourced from February 2007 data and may or may not have changed in later versions.
{| class="wikitable"
|-
! Name !! Value !! Comments
|-
| CMFLAG_INT16VERTEX || 1 ||
|-
| CMFLAG_INT16NORMAL || 2 ||
|-
| CMFLAG_20BITCLUSTERINDEX || 4 ||
|-
| CMFLAG_ONESIDED || 16 ||
|-
| CMFLAG_FORCEENUMSIZEINT || 0x7FFFFFFF ||
|}
Line 253 ⟶ 303:
! Length !! Type !! Description !! Comments
|-
| 0x1 || uint8_t || '''Lower nibble''' (type)<br>''[unused]'' UNITTYPE_OLDTRIANGLE = 0<br>UNITTYPE_TRIANGLE = 1<br>UNITTYPE_QUAD = 2<br>UNITTYPE_TRILIST = 3<br>'''Upper nibble''' (flags)<br>UNITFLAG_NORMAL = 1<br>UNITFLAG_EDGEANGLE = 2<br>UNITFLAG_GROUPID = 4<br>UNITFLAG_SURFACEID = 8<br>''[unused]'' UNITFLAG_USEOLDTRI = all bits set (including type) ||
|-
| 0x1 || uint8_t || '''Only present if type == UNITTYPE_TRILIST'''<br>Triangle count || For UNITTYPE_OLDTRIANGLE/UNITTYPE_TRIANGLE this is implicitly 1 and for UNITTYPE_QUAD this is implicitly 2
Line 259 ⟶ 309:
| Vertex count<br>(triangle count + 2) || uint8_t || Vertex index ||
|-
| 0x1 || uint8_t || '''Only present with UNITFLAG_NORMAL'''<br>Normal index probably ||
|-
| Edge count<br>(triangle count + 2) || uint8_t || '''Only present with UNITFLAG_EDGEANGLE''' Edge cosines? Mask with 0x1F and flags above that? rw::colison::UnitEdgeFlags is likely relevant ||
|