MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / getGridHeight

Function getGridHeight

examples/Heightfield/HeightfieldExample.cpp:179–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178
179static btScalar
180getGridHeight
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

Callers 1

getRawHeightfieldDataFunction · 0.85

Calls 2

getByteSizeFunction · 0.85
convertToFloatFunction · 0.85

Tested by

no test coverage detected