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