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

Method createCapsule

physx/samples/samplebase/PhysXSample.cpp:2384–2403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2382///////////////////////////////////////////////////////////////////////////////
2383
2384PxRigidDynamic* 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

Callers

nothing calls this directly

Calls 8

PX_UNUSEDFunction · 0.85
PxCreateDynamicFunction · 0.85
SetupDefaultRigidDynamicFunction · 0.85
PxCapsuleGeometryClass · 0.70
PxQuatClass · 0.50
PxTransformClass · 0.50
addActorMethod · 0.45
setLinearVelocityMethod · 0.45

Tested by

no test coverage detected