MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / cookHeightField

Method cookHeightField

physx/source/physxcooking/src/Cooking.cpp:419–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
418
419bool Cooking::cookHeightField(const PxHeightFieldDesc& desc, PxOutputStream& stream) const
420{
421 PX_FPU_GUARD;
422
423 if(!desc.isValid())
424 {
425 #if PX_CHECKED
426 Ps::getFoundation().error(PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__, "Cooking::createHeightField: user-provided heightfield descriptor is invalid!");
427 #endif
428 return false;
429 }
430
431 Gu::HeightField hf(NULL);
432
433 if(!hf.loadFromDesc(desc))
434 {
435 hf.releaseMemory();
436 return false;
437 }
438
439 if (!saveHeightField(hf, stream, platformMismatch()))
440 {
441 hf.releaseMemory();
442 return false;
443 }
444
445 hf.releaseMemory();
446
447 return true;
448}
449
450///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
451

Callers

nothing calls this directly

Calls 5

saveHeightFieldFunction · 0.85
errorMethod · 0.80
isValidMethod · 0.45
loadFromDescMethod · 0.45
releaseMemoryMethod · 0.45

Tested by

no test coverage detected