| 2382 | /////////////////////////////////////////////////////////////////////////////// |
| 2383 | |
| 2384 | PxRigidDynamic* PhysXSample::createCapsule(const PxVec3& pos, PxReal radius, PxReal halfHeight, const PxVec3* linVel, RenderMaterial* material, PxReal density) |
| 2385 | { |
| 2386 | PxSceneWriteLock scopedLock(*mScene); |
| 2387 | const PxQuat rot = PxQuat(PxIdentity); |
| 2388 | PX_UNUSED(rot); |
| 2389 | |
| 2390 | PxRigidDynamic* capsule = PxCreateDynamic(*mPhysics, PxTransform(pos), PxCapsuleGeometry(radius, halfHeight), *mMaterial, density); |
| 2391 | PX_ASSERT(capsule); |
| 2392 | |
| 2393 | SetupDefaultRigidDynamic(*capsule); |
| 2394 | mScene->addActor(*capsule); |
| 2395 | addPhysicsActors(capsule); |
| 2396 | |
| 2397 | if(linVel) |
| 2398 | capsule->setLinearVelocity(*linVel); |
| 2399 | |
| 2400 | createRenderObjectsFromActor(capsule, material); |
| 2401 | |
| 2402 | return capsule; |
| 2403 | } |
| 2404 | |
| 2405 | /////////////////////////////////////////////////////////////////////////////// |
| 2406 |
nothing calls this directly
no test coverage detected