| 779 | } |
| 780 | |
| 781 | PxVec3 PhysXController::getMeshScaleForShape(const PxShape* shape) |
| 782 | { |
| 783 | switch (shape->getGeometryType()) |
| 784 | { |
| 785 | case PxGeometryType::eBOX: |
| 786 | { |
| 787 | PxBoxGeometry boxGeom; |
| 788 | shape->getBoxGeometry(boxGeom); |
| 789 | return boxGeom.halfExtents; |
| 790 | } |
| 791 | case PxGeometryType::ePLANE: |
| 792 | { |
| 793 | return PxVec3(1, 2000, 2000); |
| 794 | } |
| 795 | case PxGeometryType::eSPHERE: |
| 796 | { |
| 797 | PxSphereGeometry sphereGeom; |
| 798 | shape->getSphereGeometry(sphereGeom); |
| 799 | return PxVec3(sphereGeom.radius, sphereGeom.radius, sphereGeom.radius); |
| 800 | } |
| 801 | case PxGeometryType::eCONVEXMESH: |
| 802 | { |
| 803 | PxConvexMeshGeometry convexGeom; |
| 804 | shape->getConvexMeshGeometry(convexGeom); |
| 805 | return convexGeom.scale.scale; // maybe incorrect because of rotation not used |
| 806 | } |
| 807 | default: |
| 808 | return PxVec3(1, 1, 1); |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | |
| 813 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |