diff options
| author | Sheikh Dawood Abdul Ajees <[email protected]> | 2018-09-25 11:33:48 -0500 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <[email protected]> | 2018-09-25 11:33:48 -0500 |
| commit | ad993f2926db6fe4ba2c75e17c4f099d9d853038 (patch) | |
| tree | 426f831e7aa870a4704b8dd082538ff292e751f9 /PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h | |
| parent | PhysX 3.4, APEX 1.4 patch release @24698370 (diff) | |
| download | physx-3.4-ad993f2926db6fe4ba2c75e17c4f099d9d853038.tar.xz physx-3.4-ad993f2926db6fe4ba2c75e17c4f099d9d853038.zip | |
PhysX 3.4, APEX 1.4 patch release @24990349
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h')
| -rw-r--r-- | PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h b/PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h index 64487852..f31d3ec1 100644 --- a/PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h +++ b/PhysX_3.4/Source/GeomUtils/src/hf/GuHeightField.h @@ -852,7 +852,8 @@ PX_INLINE void Gu::HeightField::getTriangleAdjacencyIndices(PxU32 triangleIndex, if((cell / mData.columns != mData.rows - 2)) { - adjacencyIndex2 = ((cell + mData.columns) * 2) + 1; + const PxU32 tMod = isZerothVertexShared(cell + mData.columns) ? 1u : 0u; + adjacencyIndex2 = ((cell + mData.columns) * 2) + tMod; } } else @@ -868,7 +869,8 @@ PX_INLINE void Gu::HeightField::getTriangleAdjacencyIndices(PxU32 triangleIndex, if(cell >= mData.columns - 1) { - adjacencyIndex2 = (cell - mData.columns) * 2; + const PxU32 tMod = isZerothVertexShared(cell - mData.columns) ? 0u : 1u; + adjacencyIndex2 = ((cell - mData.columns) * 2) + tMod; } } } @@ -890,7 +892,8 @@ PX_INLINE void Gu::HeightField::getTriangleAdjacencyIndices(PxU32 triangleIndex, if(cell >= mData.columns - 1) { - adjacencyIndex0 = ((cell - (mData.columns)) * 2) + 1; + const PxU32 tMod = isZerothVertexShared(cell - mData.columns) ? 0u : 1u; + adjacencyIndex0 = ((cell - (mData.columns)) * 2) + tMod; } if((cell % (mData.columns) != 0)) @@ -906,7 +909,8 @@ PX_INLINE void Gu::HeightField::getTriangleAdjacencyIndices(PxU32 triangleIndex, if((cell / mData.columns != mData.rows - 2)) { - adjacencyIndex0 = (cell + (mData.columns)) * 2; + const PxU32 tMod = isZerothVertexShared(cell + mData.columns) ? 1u : 0u; + adjacencyIndex0 = (cell + (mData.columns)) * 2 + tMod; } if(cell % (mData.columns) < (mData.columns - 2)) |