| 103 | } |
| 104 | |
| 105 | void NpShape::requiresObjects(PxProcessPxBaseCallback& c) |
| 106 | { |
| 107 | //meshes |
| 108 | PxBase* mesh = NULL; |
| 109 | switch(mShape.getGeometryType()) |
| 110 | { |
| 111 | case PxGeometryType::eCONVEXMESH: |
| 112 | mesh = static_cast<const PxConvexMeshGeometry&>(mShape.getGeometry()).convexMesh; |
| 113 | break; |
| 114 | case PxGeometryType::eHEIGHTFIELD: |
| 115 | mesh = static_cast<const PxHeightFieldGeometry&>(mShape.getGeometry()).heightField; |
| 116 | break; |
| 117 | case PxGeometryType::eTRIANGLEMESH: |
| 118 | mesh = static_cast<const PxTriangleMeshGeometry&>(mShape.getGeometry()).triangleMesh; |
| 119 | break; |
| 120 | case PxGeometryType::eSPHERE: |
| 121 | case PxGeometryType::ePLANE: |
| 122 | case PxGeometryType::eCAPSULE: |
| 123 | case PxGeometryType::eBOX: |
| 124 | case PxGeometryType::eGEOMETRY_COUNT: |
| 125 | case PxGeometryType::eINVALID: |
| 126 | break; |
| 127 | } |
| 128 | |
| 129 | if(mesh) |
| 130 | c.process(*mesh); |
| 131 | |
| 132 | //material |
| 133 | PxU32 nbMaterials = mShape.getNbMaterials(); |
| 134 | for (PxU32 i=0; i < nbMaterials; i++) |
| 135 | { |
| 136 | NpMaterial* mat = static_cast<NpMaterial*>(mShape.getMaterial(i)); |
| 137 | c.process(*mat); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | void NpShape::resolveReferences(PxDeserializationContext& context) |
| 142 | { |
no test coverage detected