physx3.4中怎么判断两个物体碰撞
//生成两个box1,box2
box1 = gPhysics->createShape(PxBoxGeometry(2, 2, 2), *gMaterial);
PxTransform t1 = PxTransform(PxVec3(0, 0, 10));
box2 = gPhysics->createShape(PxBoxGeometry(2, 2, 2), *gMaterial);
PxTransform t2 = PxTransform(PxVec3(0, 50, 10));
PxShape* shape = gPhysics->createShape(PxBoxGeometry(2, 2, 2), *gMaterial);
PxTransform localTm(PxVec3(0, 1, 0) * 2);
PxRigidDynamic* body1 = gPhysics->createRigidDynamic(t1.transform(localTm));
body1->attachShape(*box1);
PxRigidBodyExt::updateMassAndInertia(*body1, 10.0f);
gScene->addActor(*body1);
PxRigidDynamic* body2 = gPhysics->createRigidDynamic(t2.transform(localTm));
body2->attachShape(*box1);
PxRigidBodyExt::updateMassAndInertia(*body2, 10.0f);
gScene->addActor(*body2);
shape->release();
![图片说明](https://img-ask.csdn.net/upload/201810/12/1539337155_924661.png)
运行起来两个box,上面的会落下砸中下面的,在碰撞的时候printf“发生碰撞”