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

Function getShapeCenter

physx/source/physxextensions/src/ExtRaycastCCD.cpp:71–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static 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
91static PX_FORCE_INLINE PxVec3 getShapeCenter(PxRigidActor* actor, PxShape* shape)
92{

Callers 3

computeInternalRadiusFunction · 0.70
doRaycastCCDMethod · 0.70

Calls 5

PX_UNUSEDFunction · 0.85
getConvexMeshGeometryMethod · 0.80
getMassInformationMethod · 0.80
getGeometryTypeMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected