mirror of
https://github.com/GTAmodding/re3.git
synced 2025-07-17 05:15:30 +00:00
CCollision done and fixes
This commit is contained in:
parent
5d266ace64
commit
6b7a8f96a6
7 changed files with 272 additions and 200 deletions
|
@ -326,13 +326,13 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname)
|
|||
int32 numVertices = *(int16*)buf;
|
||||
buf += 4;
|
||||
if(numVertices > 0){
|
||||
model.vertices = (CVector*)RwMalloc(numVertices*sizeof(CVector));
|
||||
model.vertices = (CompressedVector*)RwMalloc(numVertices*sizeof(CompressedVector));
|
||||
for(i = 0; i < numVertices; i++){
|
||||
model.vertices[i] = *(CVector*)buf;
|
||||
model.vertices[i].Set(*(float*)buf, *(float*)(buf+4), *(float*)(buf+8));
|
||||
#if 0
|
||||
if(Abs(model.vertices[i].x) >= 256.0f ||
|
||||
Abs(model.vertices[i].y) >= 256.0f ||
|
||||
Abs(model.vertices[i].z) >= 256.0f)
|
||||
if(Abs(*(float*)buf) >= 256.0f ||
|
||||
Abs(*(float*)(buf+4)) >= 256.0f ||
|
||||
Abs(*(float*)(buf+8)) >= 256.0f)
|
||||
printf("%s:Collision volume too big\n", modelname);
|
||||
#endif
|
||||
buf += 12;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue