| 431 | /////////////////////////////////////////////////////////////////////////////// |
| 432 | |
| 433 | PxMaterial* NpFactory::createMaterial(PxReal staticFriction, PxReal dynamicFriction, PxReal restitution) |
| 434 | { |
| 435 | PX_CHECK_AND_RETURN_NULL(dynamicFriction >= 0.0f, "createMaterial: dynamicFriction must be >= 0."); |
| 436 | PX_CHECK_AND_RETURN_NULL(staticFriction >= 0.0f, "createMaterial: staticFriction must be >= 0."); |
| 437 | PX_CHECK_AND_RETURN_NULL(restitution >= 0.0f || restitution <= 1.0f, "createMaterial: restitution must be between 0 and 1."); |
| 438 | |
| 439 | Sc::MaterialData materialData; |
| 440 | materialData.staticFriction = staticFriction; |
| 441 | materialData.dynamicFriction = dynamicFriction; |
| 442 | materialData.restitution = restitution; |
| 443 | |
| 444 | NpMaterial* npMaterial; |
| 445 | { |
| 446 | Ps::Mutex::ScopedLock lock(mMaterialPoolLock); |
| 447 | npMaterial = mMaterialPool.construct(materialData); |
| 448 | } |
| 449 | return npMaterial; |
| 450 | } |
| 451 | |
| 452 | void NpFactory::releaseMaterialToPool(NpMaterial& material) |
| 453 | { |
no test coverage detected