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

Method createGrid

physx/samples/samplebase/PhysXSample.cpp:2267–2288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2265///////////////////////////////////////////////////////////////////////////////
2266
2267PxRigidActor* PhysXSample::createGrid(RenderMaterial* material)
2268{
2269 PxSceneWriteLock scopedLock(*mScene);
2270 Renderer* renderer = getRenderer();
2271 PX_ASSERT(renderer);
2272
2273 PxRigidStatic* plane = PxCreatePlane(*mPhysics, PxPlane(PxVec3(0,1,0), 0), *mMaterial);
2274 if(!plane)
2275 fatalError("create plane failed!");
2276
2277 mScene->addActor(*plane);
2278
2279 PxShape* shape;
2280 plane->getShapes(&shape, 1);
2281
2282 RenderGridActor* actor = SAMPLE_NEW(RenderGridActor)(*renderer, 20, 10.0f);
2283 link(actor, shape, plane);
2284 actor->setTransform(PxTransform(PxIdentity));
2285 mRenderActors.push_back(actor);
2286 actor->setRenderMaterial(material);
2287 return plane;
2288}
2289
2290///////////////////////////////////////////////////////////////////////////////
2291

Callers

nothing calls this directly

Calls 8

PxCreatePlaneFunction · 0.85
setTransformMethod · 0.80
setRenderMaterialMethod · 0.80
PxPlaneClass · 0.50
PxVec3Class · 0.50
PxTransformClass · 0.50
addActorMethod · 0.45
getShapesMethod · 0.45

Tested by

no test coverage detected