[IXModel] Correctly load coll surfs
This commit is contained in:
parent
2c7b7f6d87
commit
45c49d4171
@ -166,9 +166,9 @@ namespace Assets
|
||||
|
||||
for (int i = 0; i < model->numColSurfs; ++i)
|
||||
{
|
||||
if (model->colSurf[i].tris)
|
||||
if (model->colSurf[i].collTris)
|
||||
{
|
||||
model->colSurf[i].tris = reader.read(48, model->colSurf[i].count);
|
||||
model->colSurf[i].collTris = reader.readArray<Game::XModelCollTri_s>(model->colSurf[i].numCollTris);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -355,12 +355,12 @@ namespace Assets
|
||||
Game::XModelCollSurf* destColSurf = &destColSurfs[i];
|
||||
Game::XModelCollSurf* colSurf = &asset->colSurf[i];
|
||||
|
||||
if (colSurf->tris)
|
||||
if (colSurf->collTris)
|
||||
{
|
||||
buffer->align(Utils::Stream::ALIGN_4);
|
||||
|
||||
buffer->save(colSurf->tris, 48, colSurf->count);
|
||||
Utils::Stream::ClearPointer(&destColSurf->tris);
|
||||
buffer->save(colSurf->collTris, 48, colSurf->numCollTris);
|
||||
Utils::Stream::ClearPointer(&destColSurf->collTris);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1676,12 +1676,23 @@ namespace Game
|
||||
float transWeight;
|
||||
};
|
||||
|
||||
struct XModelCollTri_s
|
||||
{
|
||||
float plane[4];
|
||||
float svec[4];
|
||||
float tvec[4];
|
||||
};
|
||||
|
||||
struct XModelCollSurf
|
||||
{
|
||||
void* tris; // +0, sizeof 48
|
||||
int count; // +4
|
||||
char pad[36]; // +8
|
||||
}; // +44
|
||||
XModelCollTri_s *collTris;
|
||||
int numCollTris;
|
||||
float mins[3];
|
||||
float maxs[3];
|
||||
int boneIdx;
|
||||
int contents;
|
||||
int surfFlags;
|
||||
};
|
||||
|
||||
struct PhysPreset
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user