| 417 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 418 | |
| 419 | bool 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 |
nothing calls this directly
no test coverage detected