| 69 | } |
| 70 | |
| 71 | static PxVec3 getShapeCenter(PxShape* shape, const PxTransform& pose) |
| 72 | { |
| 73 | PxVec3 offset(0.0f); |
| 74 | if(shape->getGeometryType()==PxGeometryType::eCONVEXMESH) |
| 75 | { |
| 76 | PxConvexMeshGeometry geometry; |
| 77 | bool status = shape->getConvexMeshGeometry(geometry); |
| 78 | PX_UNUSED(status); |
| 79 | PX_ASSERT(status); |
| 80 | |
| 81 | PxReal mass; |
| 82 | PxMat33 localInertia; |
| 83 | PxVec3 localCenterOfMass; |
| 84 | geometry.convexMesh->getMassInformation(mass, localInertia, localCenterOfMass); |
| 85 | |
| 86 | offset += localCenterOfMass; |
| 87 | } |
| 88 | return pose.transform(offset); |
| 89 | } |
| 90 | |
| 91 | static PX_FORCE_INLINE PxVec3 getShapeCenter(PxRigidActor* actor, PxShape* shape) |
| 92 | { |
no test coverage detected