Sims 3:0x015A1849

From SimsWiki
Revision as of 20:24, 3 June 2009 by WesHowe (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
{rcol header}
long     'GEOM'
long     Version              // 5
long     TailOffset
long     TailSectionSize   // (0x14, 0x44 observed)
long     EmbeddedID     //(0, 0x548394B9 observed)
if(EmbeddedID!=0) {
   long ChunkSize
   byte[ChunkSize]       // starts with 'MTNF'
   }
long   0                      //unknown purpose
long   0                      // unknown purpose
long   NumVerts
long   FCount                            // was named Version, but is number of vertex elements
block  VertexFormat[FCount]      // long, long, byte; documented below 9 bytes/vertex-element-count
struct VertexData[NumVerts]     // follows vertex format block, documented below
block  FaceFmt                         // long ItemCount, byte BytesPerFacepoint
long   NumFacePoints                // means faces*3
word [NumFacePoints][3]         // standard face index (three unsigned words per face) for 2-byte FaceFmt
----------
Tail:
long  flags
long  count1
long  bonehasharray[count1]  // 32-bit hash of used bone names.
long  numtgi
block references[numtgi]  // each is a TGI[sub]64[/sub], a 16-byte quantity, so size is 16*numtgi
                                    // references are to DDS textures and BONE file

==========================
VertexFormat:
(for each vertex count)
long   DataType
long   SubType
byte   BytesPerElement

For DataType:
1  == Position (3 float == 12 bytes)
2  == Normal  (3 float == 12 bytes)
3  == UV       (2 float == 8 bytes)
4  == Bone Assignment (long == 4 bytes)
5  == Weights (4 float == 16 bytes)
6  == Tangent Normal (3 float == 12 bytes)
16 == VertexID (long == 4 bytes)

For SubType
1 == floats
2 == bytes
4 == long

You calculate the offset of each element from the sum of the previous BytesPerElement
==========================
Known Vertex Format Examples:

Format 3 VertexData is:
float Position[3]
float Normal[3]
long VertID
[28 bytes per vertex]

Format 6 VertexData is:
float    Position[3]      // XYZ, Y is UP
float    Normal[3]
float    UV[2]
long    Bone Assignments  // a packed byte array, parsed lo order to high order
float    Weights[4]          // first weight is lowest order byte of assignments, 0.0 (0L) weights are unassigned slots
float    Tangent Normal[3]
[64 bytes per vertex]

Format 7 VertexData is:
float    Position[3]      // XYZ, Y is UP
float    Normal[3]
float    UV[2]
long    Bone Assignments  // packed byte array
float    Weights[4]
long    VertID
float    Tangent Normal[3]
[68 bytes per vertex]

Format 8 VertexData is:
float    Position[3]      // XYZ, Y is UP
float    Normal[3]
float    UV[2]
long    Tagval           // perhaps signed, I saw 0xffffffff (-1) used. Probably opacity data
long    Bone Assignments  // a packed byte array
float    Weights[4]
long    VertID
float   Tangent Normal[3]
[72 bytes per vertex]
Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox