comparison Indoor.cpp @ 830:08d90b633131

some BLV floor collisions
author Nomad
date Wed, 27 Mar 2013 11:59:37 +0200
parents e95389c8680a
children 9c3f28b31b4a
comparison
equal deleted inserted replaced
829:d5b1870df3ab 830:08d90b633131
1289 //v5 = &pIndoor->pFaces[uFaceID]; 1289 //v5 = &pIndoor->pFaces[uFaceID];
1290 nodes[num_nodes].viewing_portal_id = -1; 1290 nodes[num_nodes].viewing_portal_id = -1;
1291 //v39 = &pIndoor->pFaces[uFaceID]; 1291 //v39 = &pIndoor->pFaces[uFaceID];
1292 1292
1293 auto pFace = &pIndoor->pFaces[uFaceID]; 1293 auto pFace = &pIndoor->pFaces[uFaceID];
1294 auto p = &nodes[node_id];
1294 1295
1295 if (!pFace->Portal()) 1296 if (!pFace->Portal())
1296 { 1297 {
1297 if (num_faces < 1000) 1298 if (num_faces < 1000)
1298 { 1299 {
1300 faces[num_faces++].uNodeID = node_id; 1301 faces[num_faces++].uNodeID = node_id;
1301 } 1302 }
1302 return; 1303 return;
1303 } 1304 }
1304 1305
1305 auto p = &nodes[node_id]; 1306
1306 //v6 = (int)((char *)this + 2252 * a2); 1307
1307 //a0 = v6;
1308 if (p->uFaceID == uFaceID) 1308 if (p->uFaceID == uFaceID)
1309 return; 1309 return;
1310 if (!node_id && 1310 if (!node_id &&
1311 pBLVRenderParams->vPartyPos.x >= pFace->pBounding.x1 - 16 && // we are probably standing at the portal plane 1311 pBLVRenderParams->vPartyPos.x >= pFace->pBounding.x1 - 16 && // we are probably standing at the portal plane
1312 pBLVRenderParams->vPartyPos.x <= pFace->pBounding.x2 + 16 && 1312 pBLVRenderParams->vPartyPos.x <= pFace->pBounding.x2 + 16 &&
1314 pBLVRenderParams->vPartyPos.y <= pFace->pBounding.y2 + 16 && 1314 pBLVRenderParams->vPartyPos.y <= pFace->pBounding.y2 + 16 &&
1315 pBLVRenderParams->vPartyPos.z >= pFace->pBounding.z1 - 16 && 1315 pBLVRenderParams->vPartyPos.z >= pFace->pBounding.z1 - 16 &&
1316 pBLVRenderParams->vPartyPos.z <= pFace->pBounding.z2 + 16 ) 1316 pBLVRenderParams->vPartyPos.z <= pFace->pBounding.z2 + 16 )
1317 { 1317 {
1318 if ( abs(pFace->pFacePlane_old.dist + pBLVRenderParams->vPartyPos.x * pFace->pFacePlane_old.vNormal.x 1318 if ( abs(pFace->pFacePlane_old.dist + pBLVRenderParams->vPartyPos.x * pFace->pFacePlane_old.vNormal.x
1319 + pBLVRenderParams->vPartyPos.y * pFace->pFacePlane_old.vNormal.y 1319 + pBLVRenderParams->vPartyPos.y * pFace->pFacePlane_old.vNormal.y
1320 + pBLVRenderParams->vPartyPos.z * pFace->pFacePlane_old.vNormal.z) <= 589824 ) // we sure are standing at the portal plane 1320 + pBLVRenderParams->vPartyPos.z * pFace->pFacePlane_old.vNormal.z) <= 589824 ) // we sure are standing at the portal plane
1321 { 1321 {
1322 v7 = pFace->uSectorID; 1322 v7 = pFace->uSectorID;
1323 if ( nodes[0].uSectorID == v7 ) // draw back sector 1323 if ( nodes[0].uSectorID == v7 ) // draw back sector
1324 v7 = pFace->uBackSectorID; 1324 v7 = pFace->uBackSectorID;
1325 nodes[num_nodes].uSectorID = v7; 1325 nodes[num_nodes].uSectorID = v7;
1326 nodes[num_nodes].uFaceID = uFaceID; 1326 nodes[num_nodes].uFaceID = uFaceID;
1327 nodes[num_nodes].uViewportX = pBLVRenderParams->uViewportX; 1327 nodes[num_nodes].uViewportX = pBLVRenderParams->uViewportX;
1328 nodes[num_nodes].uViewportZ = pBLVRenderParams->uViewportZ; 1328 nodes[num_nodes].uViewportZ = pBLVRenderParams->uViewportZ;
1329 nodes[num_nodes].uViewportY = pBLVRenderParams->uViewportY; 1329 nodes[num_nodes].uViewportY = pBLVRenderParams->uViewportY;
1330 nodes[num_nodes].uViewportW = pBLVRenderParams->uViewportW; 1330 nodes[num_nodes].uViewportW = pBLVRenderParams->uViewportW;
1331 nodes[num_nodes++].field_C._43F9E1(pBLVRenderParams->uViewportX, 1331 nodes[num_nodes].field_C._43F9E1(pBLVRenderParams->uViewportX,
1332 pBLVRenderParams->uViewportY, 1332 pBLVRenderParams->uViewportY,
1333 pBLVRenderParams->uViewportZ, 1333 pBLVRenderParams->uViewportZ,
1334 pBLVRenderParams->uViewportW); 1334 pBLVRenderParams->uViewportW);
1335 AddBspNodeToRenderList(num_nodes - 1); 1335 AddBspNodeToRenderList(++num_nodes - 1);
1336 return; 1336 return;
1337 } 1337 }
1338 //v5 = v39; 1338 //v5 = v39;
1339 //v6 = a0; 1339 //v6 = a0;
1340 } 1340 }
1366 if (face_min_screenspace_y > _50B9D8_screen_space_y[i]) 1366 if (face_min_screenspace_y > _50B9D8_screen_space_y[i])
1367 face_min_screenspace_y = _50B9D8_screen_space_y[i]; 1367 face_min_screenspace_y = _50B9D8_screen_space_y[i];
1368 if (face_max_screenspace_y < _50B9D8_screen_space_y[i]) 1368 if (face_max_screenspace_y < _50B9D8_screen_space_y[i])
1369 face_max_screenspace_y = _50B9D8_screen_space_y[i]; 1369 face_max_screenspace_y = _50B9D8_screen_space_y[i];
1370 } 1370 }
1371 //v10 = sub_423B5D(uFaceID); 1371
1372 //v34 = v10;
1373 //if ( v10 )
1374 //{
1375 /* v11 = _50BAC8_screen_space_x[0];
1376 v12 = _50B9D8_screen_space_y[0];
1377 a2 = _50BAC8_screen_space_x[0];
1378 v13 = 1;
1379 v37 = _50B9D8_screen_space_y[0];
1380 if ( v10 > 1 )
1381 {
1382 do
1383 {
1384 v14 = _50BAC8_screen_space_x[v13];
1385 if ( v14 < a2 )
1386 a2 = _50BAC8_screen_space_x[v13];
1387 if ( v14 > v11 )
1388 v11 = v14;
1389 v15 = _50B9D8_screen_space_y[v13];
1390 if ( v15 < v37 )
1391 v37 = _50B9D8_screen_space_y[v13];
1392 if ( v15 > v12 )
1393 v12 = _50B9D8_screen_space_y[v13];
1394 v10 = v34;
1395 ++v13;
1396 }
1397 while ( v13 < v34 );
1398 }
1399 //v16 = a0;
1400 if (v11 >= p->uViewportX &&
1401 a2 <= p->uViewportZ &&
1402 v12 >= p->uViewportY &&
1403 v37 <= p->uViewportW &&
1404 sub_424829(v10, &nodes[num_nodes].field_C, &p->field_C, uFaceID))*/
1405 if (face_max_screenspace_x >= p->uViewportX && 1372 if (face_max_screenspace_x >= p->uViewportX &&
1406 face_min_screenspace_x <= p->uViewportZ && 1373 face_min_screenspace_x <= p->uViewportZ &&
1407 face_max_screenspace_y >= p->uViewportY && 1374 face_max_screenspace_y >= p->uViewportY &&
1408 face_min_screenspace_y <= p->uViewportW && 1375 face_min_screenspace_y <= p->uViewportW &&
1409 sub_424829(num_vertices, &nodes[num_nodes].field_C, &p->field_C, uFaceID)) 1376 sub_424829(num_vertices, &nodes[num_nodes].field_C, &p->field_C, uFaceID))