Clustered Mesh: Difference between revisions

m
no edit summary
(what a mess)
mNo edit summary
 
(17 intermediate revisions by 2 users not shown)
Line 1:
{{ParadiseResourceTypeInfobox
| name = ClusteredMesh
| othernames = CollisionMeshData
| example = [[File:Paradise ClusteredMesh Example.png|frameless|220px]]<br />Track unit 203's clustered mesh.
| id = 0x24
| category = Generic
| memdist = Main Memory only
| importedby = [[ID List]]
| editor = Viewer only<br />Use [[Modding/Burnout Paradise|Blender addons]]
}}
 
{{subpage|Development|text=Information on versions of the Clustered Mesh resource type used during development.}}
 
Clustered Mesh resources were used for world collision (WORLDCOL) prior to the introduction of the [[Polygon Soup List]] resource type.
 
Line 7 ⟶ 20:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || [[#rw::collision::VolRef::Volume|Volume]]* || mpCollisionVolume || ||
|-
| 0x4 || 0xC || || || Padding ||
Line 14 ⟶ 27:
|}
 
=== rw::collision::VolRef::Volume ===
==== 32-bit ====
{| class="wikitable"
Line 33 ⟶ 46:
| 0x58 || 0x4 || uint32_t || surfaceID || ||
|-
| 0x5C || 0x4 || uint32_t || m_flags || || ListSee of flags is unknown[[#rw::collision::VolumeFlag|VolumeFlag]]
|}
 
=== 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 57 ⟶ 101:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x30 || [[#rw::collision::Aggregate|Aggregate]] || super_Aggregate || Base class ||
|}
 
Line 67 ⟶ 111:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x30 || [[#rw::collision::Procedural|Procedural]] || super_Procedural || Base class ||
|-
| 0x30 || 0x4 || [[#rw::collision::KDTree|KDTree]]* || mKDTree || ||
Line 107 ⟶ 151:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || float32_t || mVertexCompressionGranularity || || Relevant for cluster compression modes 1 and 2
|-
| 0x4 || 0x2 || uint16_t || mFlags || || ListLikely of flags is unknown[[#rw::collision::CMFlags|CMFlags]]
|-
| 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 174 ⟶ 237:
| 0xB || 0x1 || uint8_t || normalCount || ||
|-
| 0xC || 0x1 || uint8_t || compressionMode || VERTICES_UNCOMPRESSED ||= 0,<br>VERTICES_16BIT_COMPRESSED = 1<br>VERTICES_32BIT_COMPRESSED or= 2 ||
|-
| 0xD || 0x3 || uint8_t[3] || paddingPadding || ||
|-
| 0x10 || 0x10 || [[#Vector3|vpu::Vector3]][1] || vertexArray || Variable size data || {{Todo|Normals?}}[[# Vertex data|Vertex data]]<br>[[#Unit data|Unit data]]
|}
 
==== Vertex data ====
 
 
{| class="wikitable"
|+ VERTICES_UNCOMPRESSED
|+ Compression mode 0 (uncompressed)
|-
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0<br>(repeating) || 0x10 || [[#Vector3|vpu::Vector3]]? || ? || Raw ||vector (mVertexCompressionGranularity unused)
|}
 
{| class="wikitable"
|+ VERTICES_16BIT_COMPRESSED
|+ Compression mode 1
|-
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0xC || floatint32_t[3] || ?vertexOffsetData || Component || base
|-
| 0xC<br>(repeating) || 0x6 || ? |[[#rw::collision::ClusteredMeshCluster::Vertex16| ?Vertex16]][3] || vertData || Add this to initial 3-floatint32_t vectorcomponents and then multiply components by mVertexCompressionGranularity? to get coordinate
|}
 
{| class="wikitable"
|+ VERTICES_32BIT_COMPRESSED
|+ Compression mode 2
|-
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0<br>(repeating) || 0xC || ? |[[#rw::collision::ClusteredMeshCluster::Vertex32| ?Vertex32]][3] || vertData || Multiply components by mVertexCompressionGranularity? to get coordinate
|}
 
===== rw::collision::ClusteredMeshCluster::Vertex16 =====
 
{| class="wikitable"
! Offset !! Length !! Type !! Name
|-
| 0x20x0 || ?0x2 || ?uint16_t || ?x
|-
| 0x2 || 0x2 || uint16_t || y
|-
| 0x4 || 0x2 || uint16_t || z
|}
 
===== rw::collision::ClusteredMeshCluster::Vertex32 =====
 
{| class="wikitable"
! Offset !! Length !! Type !! Name
|-
| 0x0 || 0x4 || int32_t || x
|-
| 0x4 || 0x4 || int32_t || y
|-
| 0x8 || 0x4 || int32_t || z
| 0x0<br>(repeating) || 0xC || ? || ? || || Multiply components by mVertexCompressionGranularity?
|}
 
Line 215 ⟶ 303:
! Length !! Type !! Description !! Comments
|-
| 0x1 || uint8_t || '''Lower nibble''' (type)<br>1''[unused]'' -UNITTYPE_OLDTRIANGLE ?= 0<br>2UNITTYPE_TRIANGLE -= ?1<br>3UNITTYPE_QUAD -= ?2<br>UNITTYPE_TRILIST = 3<br>'''Upper nibble''' (flags)<br>FlagUNITFLAG_NORMAL = 1<br>UNITFLAG_EDGEANGLE -= ?2<br>FlagUNITFLAG_GROUPID 2= - ?4<br>FlagUNITFLAG_SURFACEID 4 - Has= a group ID8<br>Flag''[unused]'' 8UNITFLAG_USEOLDTRI = -all Hasbits aset surface(including IDtype) ||
|-
| 0x1 || uint8_t || '''Only present if type == 3UNITTYPE_TRILIST'''<br>TheTriangle size of ?count || For UNITTYPE_OLDTRIANGLE/UNITTYPE_TRIANGLE this is implicitly 1 and for UNITTYPE_QUAD this is implicitly 2
|-
| Vertex count<br>(triangle count + 2) || uint8_t || Vertex index ||
| Variable || ? || Size is 1 for type 1, 2 for type 2, and specified by the previous byte for type 3. ||
|-
| 0x1 || uint8_t || '''Only present with UNITFLAG_NORMAL'''<br>Normal index probably ||
| 0x2 || ? || ? || ?
|-
| 2Edge +count<br>(triangle variablecount size+ again2) || ?uint8_t || '''Only present with flag 2UNITFLAG_EDGEANGLE''' ||Edge cosines? Mask with 0x1F and flags above that? rw::colison::UnitEdgeFlags is likely relevant ||
|-
| Group ID size (see [[#rw::collision::ClusterParams|ClusterParams]]) || uint8_t or uint16_t || '''Only present with flag 4UNITFLAG_GROUPID'''<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 8UNITFLAG_SURFACEID'''<br>Surface ID || This is always little endian.
|}
117

edits