Forum Discussion

CmarNYC's avatar
8 years ago

bt request: MLOD (0x01D10F34)

@SimGuruModSquad

I see there's a new version of the MLOD chunk in this resource with City Living. Any chance of a bt? Thanks.
  • Hi @cmarinetti,

    Yes that is the bounding box information. Here is a quick and dirty bt for that block, I haven't tested it extensively but I think it's correct:



    //
    // MLOD block
    //

    typedef struct
    {
    UINT32 mState;
    UINT32 mStartIndex;
    UINT32 mMinVertexIndex;
    UINT32 mVertexCount;
    UINT32 mPrimitiveCount;
    } PrimitiveInfoForState;

    typedef struct
    {
    FLOAT min;
    FLOAT max;
    } BoundingBox;

    typedef struct(int version)
    {
    UINT32 mMeshLength;
    local int nextBlock = FTell() + mMeshLength;

    UINT32 mHashedName ;
    UINT32 mMaterialRef ;
    UINT32 mVertexFormatRef ;
    UINT32 mVertexBufferRef ;
    UINT32 mIndexBufferRef ;
    UINT32 mPrimitiveType : 8 ;
    UINT32 mMeshFlags : 24 ;
    UINT32 mStreamOffset;
    UINT32 mStartVertex;
    UINT32 mStartIndex;
    UINT32 mMinVertexIndex;
    UINT32 mVertexCount;
    UINT32 mPrimitiveCount;
    BoundingBox mBoundingBox;
    INT32 mSkinRef;
    UINT32 mBoneCount;

    if (mBoneCount>0)
    {
    UINT32 mBoneHash;
    }

    UINT32 mMeshMaterial ;

    UINT32 mNumPrimInfo;
    if ( mNumPrimInfo > 0 )
    {
    PrimitiveInfoForState mPrimitiveInfoForState;
    }
    UINT32 mParentBone ;
    float mMirrorPlane;
    UINT32 mSortOrderHint;

    if (version >= 0x206 && (mMeshFlags & 0x4000) && mBoneCount > 0)
    {
    // Bone local bounding boxes
    BoundingBox mBoundingBoxBones;
    }

    if (FTell()!= nextBlock)
    {
    Warning("Not all data read from MLOD.");
    return -1;
    }

    } MeshDiskFormat;

    typedef struct
    {
    BlockSignature mMLODSignature; // MLOD
    UINT32 mVersion ;
    UINT32 mMeshCount;
    MeshDiskFormat mMeshData(mVersion) ;
    } MLOD;



    -SGMS
  • Hi @cmarinetti,

    We actually have not updated this resource for some time, but in order to avoid patching all these resources way back on EP01 we made it such that the version of the resource is only bumped if the model uses a particular feature (which adds some extra bounding box information). By default, this resource is exported at version 0x205 but if the new feature is used the version will be 0x206 - does that match what you are seeing?

    -SGMS
  • @SimGuruModSquad

    Hi, yes, I'm finding a set of 12 extra floats in some meshes in MLODs with version 0x206, thanks for letting me know they're extra bounding info and only appear with that version. My issue is among different meshes in an MLOD some may have the extra data and others don't, but I noticed it only seems to happen in meshes with more than one joint reference. Anyway, I'm using the mesh length to determine whether there's extra data, so I guess I'm set. Thanks!