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

Method createConvex

physx/samples/samplebase/PhysXSample.cpp:2407–2426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2405///////////////////////////////////////////////////////////////////////////////
2406
2407PxRigidDynamic* PhysXSample::createConvex(const PxVec3& pos, const PxVec3* linVel, RenderMaterial* material, PxReal density)
2408{
2409 PxSceneWriteLock scopedLock(*mScene);
2410 PxConvexMesh* convexMesh = GenerateConvex(*mPhysics, *mCooking, getDebugConvexObjectScale(), false, true);
2411 PX_ASSERT(convexMesh);
2412
2413 PxRigidDynamic* convex = PxCreateDynamic(*mPhysics, PxTransform(pos), PxConvexMeshGeometry(convexMesh), *mMaterial, density);
2414 PX_ASSERT(convex);
2415
2416 SetupDefaultRigidDynamic(*convex);
2417 mScene->addActor(*convex);
2418 addPhysicsActors(convex);
2419
2420 if(linVel)
2421 convex->setLinearVelocity(*linVel);
2422
2423 createRenderObjectsFromActor(convex, material);
2424
2425 return convex;
2426}
2427
2428///////////////////////////////////////////////////////////////////////////////
2429

Callers

nothing calls this directly

Calls 7

GenerateConvexFunction · 0.85
PxCreateDynamicFunction · 0.85
SetupDefaultRigidDynamicFunction · 0.85
PxTransformClass · 0.50
addActorMethod · 0.45
setLinearVelocityMethod · 0.45

Tested by

no test coverage detected