| 370 | } |
| 371 | |
| 372 | PxConstraint* NpFactory::createConstraint(PxRigidActor* actor0, PxRigidActor* actor1, PxConstraintConnector& connector, const PxConstraintShaderTable& shaders, PxU32 dataSize) |
| 373 | { |
| 374 | PX_CHECK_AND_RETURN_NULL((actor0 && !actor0->is<PxRigidStatic>()) || (actor1 && !actor1->is<PxRigidStatic>()), "createConstraint: At least one actor must be dynamic or an articulation link"); |
| 375 | |
| 376 | NpConstraint* npConstraint; |
| 377 | { |
| 378 | Ps::Mutex::ScopedLock lock(mConstraintPoolLock); |
| 379 | npConstraint = mConstraintPool.construct(actor0, actor1, connector, shaders, dataSize); |
| 380 | } |
| 381 | addConstraint(npConstraint); |
| 382 | return npConstraint; |
| 383 | } |
| 384 | |
| 385 | void NpFactory::releaseConstraintToPool(NpConstraint& constraint) |
| 386 | { |