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

Method createMaterial

physx/source/physx/src/NpFactory.cpp:432–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430///////////////////////////////////////////////////////////////////////////////
431
432PxMaterial* 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
451void NpFactory::releaseMaterialToPool(NpMaterial& material)
452{

Callers 15

createPhysicsAndSceneFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
createCollectionsFunction · 0.45
generateExampleFilesFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45
initPhysicsFunction · 0.45

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected