| 177 | |
| 178 | |
| 179 | static btScalar |
| 180 | getGridHeight |
| 181 | ( |
| 182 | byte_t * grid, |
| 183 | int i, |
| 184 | int j, |
| 185 | PHY_ScalarType type |
| 186 | ) |
| 187 | { |
| 188 | btAssert(grid); |
| 189 | btAssert(i >= 0 && i < s_gridSize); |
| 190 | btAssert(j >= 0 && j < s_gridSize); |
| 191 | |
| 192 | int bpe = getByteSize(type); |
| 193 | btAssert(bpe > 0 && "bad bytes per element"); |
| 194 | |
| 195 | int idx = (j * s_gridSize) + i; |
| 196 | long offset = ((long)bpe) * idx; |
| 197 | |
| 198 | byte_t * p = grid + offset; |
| 199 | |
| 200 | return convertToFloat(p, type); |
| 201 | } |
| 202 | |
| 203 | |
| 204 |
no test coverage detected