Library and Version
PhysX v5.1.0
Release 104.0
Issue
Hi,
There is a precision issue in the computation of the vertex index in Gu::HeightField::computeCellCoordinates.
|
const PxU32 vertexIndex = PxU32(PxU32(x) * (mData.nbColumns) + PxU32(z)); |
mData.nbColumns is of type PxReal so the index computation is done in PxReal and only then cast to PxU32. This leads to problems when x, z and nbColumns have large values (~4k x 4k).
A suggested fix is to either use mData.columns like the line below or cast mData.nbColumns directly using PxU32(mData.nbColumns).
A pull request for the same issue was submitted for PhysX 4.1 ( NVIDIAGameWorks/PhysX#574 ) but the modifications that were applied for PhysX 5.1 (the final cast to PxU32) do not fix the problem.