14 delete[] m_presenterName;
22 if (fread(&len,
sizeof(len), 1, p_file) != 1) {
37 if (fread(&len,
sizeof(len), 1, p_file) != 1) {
52 if (fread(&
m_up,
sizeof(*
m_up), 3, p_file) != 3) {
68 if (fread(&len,
sizeof(len), 1, p_file) != 1) {
73 if (fread(buff, len, 1, p_file) != 1) {
96 if (fread(&numWorlds,
sizeof(numWorlds), 1, p_file) != 1) {
101 MxS32 worldNameLen, numParts, i, j;
103 for (i = 0; i < numWorlds; i++) {
104 if (fread(&worldNameLen,
sizeof(worldNameLen), 1, p_file) != 1) {
109 if (fread(worlds[i].m_worldName, worldNameLen, 1, p_file) != 1) {
113 if (fread(&numParts,
sizeof(numParts), 1, p_file) != 1) {
119 for (j = 0; j < numParts; j++) {
129 if (fread(&worlds[i].m_numModels,
sizeof(worlds[i].m_numModels), 1, p_file) != 1) {
135 for (j = 0; j < worlds[i].m_numModels; j++) {
136 if (worlds[i].m_models[j].Read(p_file) !=
SUCCESS) {
143 p_numWorlds = numWorlds;
153 for (
MxS32 i = 0; i < p_numWorlds; i++) {
159 while (cursor.
Next(part)) {
[AI] Iterator for traversing ModelDbPartList contents (ModelDbPart pointers).
[AI] Collection class representing a list of ModelDbPart pointers with custom comparison logic.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
MxResult ReadModelDbWorlds(FILE *p_file, ModelDbWorld *&p_worlds, MxS32 &p_numWorlds)
[AI] Reads the collection of worlds (ModelDbWorld) from a model database file.
void FreeModelDbWorlds(ModelDbWorld *&p_worlds, MxS32 p_numWorlds)
[AI] Frees all resources related to ModelDbWorlds previously allocated by ReadModelDbWorlds.
[AI] Represents a 3D model entry in a model database, including metadata and spatial transform info.
char * m_presenterName
[AI] Name of the presenter/handler class used for this model, dynamically allocated....
MxU32 m_modelDataLength
[AI] Length of the model's raw data in the file, in bytes. [AI]
undefined m_unk0x34
[AI] Unknown field, possibly additional flags or type (purpose currently unknown)....
char * m_modelName
[AI] Name of the model, dynamically allocated. [AI]
float m_location[3]
[AI] World-space position of the model origin (as a 3D vector). [AI]
float m_up[3]
[AI] World-space up vector (indicates model "up" orientation). [AI]
MxU32 m_modelDataOffset
[AI] File offset to the model's raw data. [AI]
float m_direction[3]
[AI] World-space direction vector (indicates model "forward" direction). [AI]
MxResult Read(FILE *p_file)
[AI] Loads a ModelDbModel from the current file pointer.
void Free()
[AI] Frees dynamically allocated memory in the model (model name and presenter name).
[AI] Represents a single part within a 3D model database entry, including its name and data offsets i...
MxString m_roiName
[AI] Name of the part/ROI this entry represents. [AI]
undefined4 m_partDataOffset
[AI] Offset within the file to the part's data. [AI]
undefined4 m_partDataLength
[AI] Length of binary part data in the file (in bytes). [AI]
MxResult Read(FILE *p_file)
[AI] Reads a ModelDbPart object from a binary file.
[AI] Represents a world/scene in the model database, containing its parts and models.
MxS32 m_numModels
[AI] Number of models in the array m_models. [AI]
ModelDbModel * m_models
[AI] Array of models within this world. [AI]
char * m_worldName
[AI] Name of the world (scene); dynamically allocated on read. [AI]
ModelDbPartList * m_partList
[AI] List of model parts belonging to this world. [AI]