MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / rcCreateHeightfield

Function rcCreateHeightfield

Source/ThirdParty/recastnavigation/Recast.cpp:306–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306bool rcCreateHeightfield(rcContext* context, rcHeightfield& heightfield, int sizeX, int sizeZ,
307 const float* minBounds, const float* maxBounds,
308 float cellSize, float cellHeight)
309{
310 rcIgnoreUnused(context);
311
312 heightfield.width = sizeX;
313 heightfield.height = sizeZ;
314 rcVcopy(heightfield.bmin, minBounds);
315 rcVcopy(heightfield.bmax, maxBounds);
316 heightfield.cs = cellSize;
317 heightfield.ch = cellHeight;
318 heightfield.spans = (rcSpan**)rcAlloc(sizeof(rcSpan*) * heightfield.width * heightfield.height, RC_ALLOC_PERM);
319 if (!heightfield.spans)
320 {
321 return false;
322 }
323 memset(heightfield.spans, 0, sizeof(rcSpan*) * heightfield.width * heightfield.height);
324 return true;
325}
326
327static void calcTriNormal(const float* v0, const float* v1, const float* v2, float* faceNormal)
328{

Callers 1

GenerateTileFunction · 0.85

Calls 4

rcIgnoreUnusedFunction · 0.85
rcVcopyFunction · 0.85
rcAllocFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected