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

Method createSphere

physx/samples/samplebase/PhysXSample.cpp:2364–2380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2362///////////////////////////////////////////////////////////////////////////////
2363
2364PxRigidDynamic* PhysXSample::createSphere(const PxVec3& pos, PxReal radius, const PxVec3* linVel, RenderMaterial* material, PxReal density)
2365{
2366 PxSceneWriteLock scopedLock(*mScene);
2367 PxRigidDynamic* sphere = PxCreateDynamic(*mPhysics, PxTransform(pos), PxSphereGeometry(radius), *mMaterial, density);
2368 PX_ASSERT(sphere);
2369
2370 SetupDefaultRigidDynamic(*sphere);
2371 mScene->addActor(*sphere);
2372 addPhysicsActors(sphere);
2373
2374 if(linVel)
2375 sphere->setLinearVelocity(*linVel);
2376
2377 createRenderObjectsFromActor(sphere, material);
2378
2379 return sphere;
2380}
2381
2382///////////////////////////////////////////////////////////////////////////////
2383

Callers

nothing calls this directly

Calls 6

PxCreateDynamicFunction · 0.85
SetupDefaultRigidDynamicFunction · 0.85
PxSphereGeometryClass · 0.70
PxTransformClass · 0.50
addActorMethod · 0.45
setLinearVelocityMethod · 0.45

Tested by

no test coverage detected