| 43 | //#define RAYCAST_CCD_PRINT_DEBUG |
| 44 | |
| 45 | PxVec3 getShapeCenter(PxRigidActor* actor, PxShape* shape, const PxVec3& localOffset) |
| 46 | { |
| 47 | PxVec3 offset = localOffset; |
| 48 | |
| 49 | switch(shape->getGeometryType()) |
| 50 | { |
| 51 | case PxGeometryType::eCONVEXMESH: |
| 52 | { |
| 53 | PxConvexMeshGeometry geometry; |
| 54 | bool status = shape->getConvexMeshGeometry(geometry); |
| 55 | PX_UNUSED(status); |
| 56 | PX_ASSERT(status); |
| 57 | |
| 58 | PxReal mass; |
| 59 | PxMat33 localInertia; |
| 60 | PxVec3 localCenterOfMass; |
| 61 | geometry.convexMesh->getMassInformation(mass, localInertia, localCenterOfMass); |
| 62 | |
| 63 | offset += localCenterOfMass; |
| 64 | } |
| 65 | break; |
| 66 | default: |
| 67 | break; |
| 68 | } |
| 69 | const PxTransform pose = PxShapeExt::getGlobalPose(*shape, *actor); |
| 70 | return pose.transform(offset); |
| 71 | } |
| 72 | |
| 73 | static PxReal computeInternalRadius(PxRigidActor* actor, PxShape* shape, const PxVec3& dir, /*PxVec3& offset,*/ const PxVec3& centerOffset) |
| 74 | { |
no test coverage detected