use different variables to store the data. The aim is to handle even not triangulated mesh files.
At the moment there is a problem with the UV using the new method
This commit is contained in:
@@ -373,23 +373,6 @@ void Object::analyseSegmChunks(Modl * dataDestination, std::list<ChunkHeader*>&
|
||||
|
||||
for (std::list<ChunkHeader*>::iterator it = chunkList.begin(); it != chunkList.end(); it++)
|
||||
{
|
||||
/*if (!strcmp("SHDW", (*it)->name))
|
||||
{
|
||||
fsMesh.seekg((*it)->position);
|
||||
/* shadow mesh geometry
|
||||
|
||||
long int - 4 - number of vertex positions
|
||||
float[3][] - 12 each - vertex positions (XYZ)
|
||||
long int - 4 - number of edges
|
||||
short int[4][] - 8 each - edge the following 4 entries from one edge
|
||||
> short int - 2 - vertex index of this edge, referes to the vertex list
|
||||
> short int - 2 - Reference into an edge. Defines the target vertex (the local edge vertex of the referenced edge) to which the edge should be dran from the local vertex
|
||||
> short int - 2 - Second reference into an edge. In all example .msh files I've seen this always refers to the same vertex as the first edge reference
|
||||
> short int - 2 - MAX_VALUE of short integers (65535). Indicates the end of this edge
|
||||
* /
|
||||
continue;
|
||||
}*/
|
||||
|
||||
if (!strcmp("MATI", (*it)->name))
|
||||
{
|
||||
fsMesh.seekg((*it)->position);
|
||||
@@ -418,7 +401,7 @@ void Object::analyseSegmChunks(Modl * dataDestination, std::list<ChunkHeader*>&
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!strcmp("STRP", (*it)->name))
|
||||
/*if (!strcmp("STRP", (*it)->name))
|
||||
{
|
||||
// jump to the data section and read the size;
|
||||
fsMesh.seekg((*it)->position);
|
||||
@@ -452,15 +435,19 @@ void Object::analyseSegmChunks(Modl * dataDestination, std::list<ChunkHeader*>&
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////DEV ZONE
|
||||
|
||||
if (!strcmp("STRP", (*it)->name))
|
||||
{
|
||||
// this needs to be a member
|
||||
std::vector<std::vector<std::uint32_t>*> tempVector;
|
||||
// don't get null, bone, shadowMesh and hidden mesh indices
|
||||
if (dataDestination->type == null ||
|
||||
dataDestination->type == bone ||
|
||||
dataDestination->type == shadowMesh ||
|
||||
dataDestination->renderFlags == 1)
|
||||
continue;
|
||||
|
||||
// jump to the data section and read the size;
|
||||
fsMesh.seekg((*it)->position);
|
||||
@@ -484,6 +471,7 @@ void Object::analyseSegmChunks(Modl * dataDestination, std::list<ChunkHeader*>&
|
||||
|
||||
tempPoly->push_back((std::uint32_t)tempValue);
|
||||
|
||||
// new Polygon found
|
||||
if (highBitCount == 2)
|
||||
{
|
||||
// reset highBitCount
|
||||
@@ -493,7 +481,7 @@ void Object::analyseSegmChunks(Modl * dataDestination, std::list<ChunkHeader*>&
|
||||
std::uint32_t saveData[2];
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
saveData[0] = tempPoly->back();
|
||||
saveData[i] = tempPoly->back();
|
||||
tempPoly->pop_back();
|
||||
}
|
||||
|
||||
@@ -503,13 +491,17 @@ void Object::analyseSegmChunks(Modl * dataDestination, std::list<ChunkHeader*>&
|
||||
newPointer->push_back(saveData[i]);
|
||||
|
||||
// save the old vector and set the pointer to the new one
|
||||
tempVector.push_back(tempPoly);
|
||||
tempData->meshIndices.push_back(tempPoly);
|
||||
tempPoly = newPointer;
|
||||
} // if high bit set
|
||||
|
||||
} // for all values
|
||||
|
||||
// save the last values (where no 2 high bits follow);
|
||||
tempVector.push_back(tempPoly);
|
||||
tempData->meshIndices.push_back(tempPoly);
|
||||
|
||||
// kick the first element, it's empty as a reason of the algo above;
|
||||
tempData->meshIndices.erase(tempData->meshIndices.begin());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user