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

Method createBox

physx/samples/samplebase/PhysXSample.cpp:2344–2360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2342///////////////////////////////////////////////////////////////////////////////
2343
2344PxRigidDynamic* PhysXSample::createBox(const PxVec3& pos, const PxVec3& dims, const PxVec3* linVel, RenderMaterial* material, PxReal density)
2345{
2346 PxSceneWriteLock scopedLock(*mScene);
2347 PxRigidDynamic* box = PxCreateDynamic(*mPhysics, PxTransform(pos), PxBoxGeometry(dims), *mMaterial, density);
2348 PX_ASSERT(box);
2349
2350 SetupDefaultRigidDynamic(*box);
2351 mScene->addActor(*box);
2352 addPhysicsActors(box);
2353
2354 if(linVel)
2355 box->setLinearVelocity(*linVel);
2356
2357 createRenderObjectsFromActor(box, material);
2358
2359 return box;
2360}
2361
2362///////////////////////////////////////////////////////////////////////////////
2363

Callers 2

createMethod · 0.45
createLegMethod · 0.45

Calls 6

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

Tested by

no test coverage detected