| 2265 | /////////////////////////////////////////////////////////////////////////////// |
| 2266 | |
| 2267 | PxRigidActor* 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 |
nothing calls this directly
no test coverage detected