Mercurial > mm7
comparison mm7_1.cpp @ 1283:2a1ca27945e1
m
author | Ritor1 |
---|---|
date | Sat, 15 Jun 2013 17:39:01 +0600 |
parents | 8a196c858180 |
children | 2767980b98bb |
comparison
equal
deleted
inserted
replaced
1282:8a196c858180 | 1283:2a1ca27945e1 |
---|---|
1593 if ( !pFace->Portal() ) | 1593 if ( !pFace->Portal() ) |
1594 return 0; | 1594 return 0; |
1595 } | 1595 } |
1596 for (uint i = 0; i < pFace->uNumVertices; ++i) | 1596 for (uint i = 0; i < pFace->uNumVertices; ++i) |
1597 { | 1597 { |
1598 //перенос вершины в пространство камеры(перед камерой), определяет находятся ли она после этого в её поле зрения | |
1599 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(pIndoor->pVertices[pFace->pVertexIDs[i]].x, | 1598 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(pIndoor->pVertices[pFace->pVertexIDs[i]].x, |
1600 pIndoor->pVertices[pFace->pVertexIDs[i]].y, pIndoor->pVertices[pFace->pVertexIDs[i]].z, | 1599 pIndoor->pVertices[pFace->pVertexIDs[i]].y, pIndoor->pVertices[pFace->pVertexIDs[i]].z, |
1601 &stru_50B700._view_transformed_xs[i], &stru_50B700._view_transformed_zs[i], &stru_50B700._view_transformed_ys[i], 0); | 1600 &stru_50B700._view_transformed_xs[i], &stru_50B700._view_transformed_zs[i], &stru_50B700._view_transformed_ys[i], 0); |
1602 } | 1601 } |
1603 | 1602 |
1604 if (pFace->uNumVertices <= 0) | 1603 if (pFace->uNumVertices <= 0) |
1605 return 0; | 1604 return 0; |
1606 | 1605 |
1607 bool bFound = false; | 1606 bool bFound = false; |
1608 for (uint i = 0; i < pFace->uNumVertices; ++i) | 1607 for (uint i = 0; i < pFace->uNumVertices; ++i) |
1609 if (stru_50B700._view_transformed_xs[i] >= 0x80000u)//отбраковывание по задней границе(cull for near clip plane) по z координате | 1608 if (stru_50B700._view_transformed_xs[i] >= 0x80000u)//find vertices > near clip plane |
1610 { | 1609 { |
1611 bFound = true; | 1610 bFound = true; |
1612 break; | 1611 break; |
1613 } | 1612 } |
1614 if (!bFound) | 1613 if (!bFound) |
1635 stru_50B700.field_38[depth_num_vertices] = (unsigned __int64)((stru_50B700._view_transformed_ys[i] - stru_50B700._view_transformed_ys[i - 1]) | 1634 stru_50B700.field_38[depth_num_vertices] = (unsigned __int64)((stru_50B700._view_transformed_ys[i] - stru_50B700._view_transformed_ys[i - 1]) |
1636 * t) + stru_50B700._view_transformed_ys[i]; | 1635 * t) + stru_50B700._view_transformed_ys[i]; |
1637 //y = (v1.y - v0.y)*t + v0.y | 1636 //y = (v1.y - v0.y)*t + v0.y |
1638 stru_50B700.field_128[depth_num_vertices] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i] - stru_50B700._view_transformed_zs[i - 1]) | 1637 stru_50B700.field_128[depth_num_vertices] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i] - stru_50B700._view_transformed_zs[i - 1]) |
1639 * t)) + stru_50B700._view_transformed_zs[i - 1]; | 1638 * t)) + stru_50B700._view_transformed_zs[i - 1]; |
1640 stru_50B700.field_218[depth_num_vertices] = 0x80000u;//z = 8.0 | |
1641 } | 1639 } |
1642 else | 1640 else |
1643 { | 1641 { |
1644 t = (0x80000 - stru_50B700._view_transformed_xs[i]) / (stru_50B700._view_transformed_xs[i - 1] - stru_50B700._view_transformed_xs[i]); | 1642 t = (0x80000 - stru_50B700._view_transformed_xs[i]) / (stru_50B700._view_transformed_xs[i - 1] - stru_50B700._view_transformed_xs[i]); |
1645 //x = (v0.x - v1.x)*t + v1.x | 1643 //x = (v0.x - v1.x)*t + v1.x |
1646 stru_50B700.field_38[depth_num_vertices] = (unsigned __int64)((stru_50B700._view_transformed_ys[i - 1] - stru_50B700._view_transformed_ys[i]) | 1644 stru_50B700.field_38[depth_num_vertices] = (unsigned __int64)((stru_50B700._view_transformed_ys[i - 1] - stru_50B700._view_transformed_ys[i]) |
1647 * t) + stru_50B700._view_transformed_ys[i]; | 1645 * t) + stru_50B700._view_transformed_ys[i]; |
1648 //y = (v0.y - v1.y)*t + v1.y | 1646 //y = (v0.y - v1.y)*t + v1.y |
1649 stru_50B700.field_128[depth_num_vertices] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i - 1] - stru_50B700._view_transformed_zs[i]) | 1647 stru_50B700.field_128[depth_num_vertices] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i - 1] - stru_50B700._view_transformed_zs[i]) |
1650 * t)) + stru_50B700._view_transformed_zs[i]; | 1648 * t)) + stru_50B700._view_transformed_zs[i]; |
1651 stru_50B700.field_218[depth_num_vertices] = 0x80000u;//z = 8.0 | 1649 } |
1652 } | 1650 stru_50B700.field_218[depth_num_vertices] = 0x80000u;//z = 8.0 |
1653 depth_num_vertices++; | 1651 depth_num_vertices++; |
1654 } | 1652 } |
1655 if ( next_vertices_flag ) | 1653 if ( next_vertices_flag ) |
1656 { | 1654 { |
1657 stru_50B700.field_38[depth_num_vertices] = stru_50B700._view_transformed_ys[i]; | 1655 stru_50B700.field_38[depth_num_vertices] = stru_50B700._view_transformed_ys[i]; |