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

Method createBox

physx/samples/samplelargeworld/SampleLargeWorld.cpp:994–1018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992}
993
994PxRigidDynamic* SampleLargeWorld::createBox(const PxVec3& pos, const PxVec3& dims, const PxVec3* linVel, RenderMaterial* material, PxReal density)
995{
996 PxSceneWriteLock scopedLock(*mScene);
997
998 PxRigidDynamic* box = PxCreateDynamic(*mPhysics, PxTransform(pos), PxBoxGeometry(dims), *mMaterial, density);
999 PX_ASSERT(box);
1000
1001 box->setActorFlag(PxActorFlag::eVISUALIZATION, true);
1002 box->setAngularDamping(0.5f);
1003
1004 //Enable ccd of dynamic generated box
1005 PxShape* boxShape = getShape(*box);
1006 setCCDActive(*boxShape);
1007
1008 boxShape->setQueryFilterData(PxFilterData(PICKING_COLLISION_GROUP,0,0,0));
1009
1010 getActiveScene().addActor(*box);
1011
1012 if(linVel)
1013 box->setLinearVelocity(*linVel);
1014
1015 createRenderObjectsFromActor(box, material);
1016
1017 return box;
1018}
1019
1020void SampleLargeWorld::setCollisionGroup(PxRigidActor* actor, PxU32 group)
1021{

Callers

nothing calls this directly

Calls 10

PxCreateDynamicFunction · 0.85
getShapeFunction · 0.85
setQueryFilterDataMethod · 0.80
PxTransformClass · 0.50
PxBoxGeometryClass · 0.50
PxFilterDataClass · 0.50
setActorFlagMethod · 0.45
setAngularDampingMethod · 0.45
addActorMethod · 0.45
setLinearVelocityMethod · 0.45

Tested by

no test coverage detected