| 861 | } |
| 862 | |
| 863 | bool ConvexShape::buildExportPolyList(ColladaUtils::ExportData* exportData, const Box3F &box, const SphereF &) |
| 864 | { |
| 865 | if (mGeometry.points.empty()) |
| 866 | return false; |
| 867 | |
| 868 | //Get the collision mesh geometry |
| 869 | { |
| 870 | ColladaUtils::ExportData::colMesh* colMesh; |
| 871 | exportData->colMeshes.increment(); |
| 872 | colMesh = &exportData->colMeshes.last(); |
| 873 | |
| 874 | colMesh->mesh.setTransform(&mObjToWorld, mObjScale); |
| 875 | colMesh->mesh.setObject(this); |
| 876 | |
| 877 | //Just get the visible |
| 878 | buildPolyList(PLC_Export, &colMesh->mesh, getWorldBox(), getWorldSphere()); |
| 879 | |
| 880 | colMesh->colMeshName = String::ToString("ColMesh%d-1", exportData->colMeshes.size()); |
| 881 | } |
| 882 | |
| 883 | //Next, process the geometry and materials. |
| 884 | //Convex shapes only have the one 'level', so we'll just rely on the export post-process to back-fill |
| 885 | if (isServerObject() && getClientObject()) |
| 886 | { |
| 887 | exportData->meshData.increment(); |
| 888 | |
| 889 | //Prep a meshData for this shape in particular |
| 890 | ColladaUtils::ExportData::meshLODData* meshData = &exportData->meshData.last(); |
| 891 | |
| 892 | //Fill out the info we'll need later to actually append our mesh data for the detail levels during the processing phase |
| 893 | meshData->shapeInst = nullptr; |
| 894 | meshData->originatingObject = this; |
| 895 | meshData->meshTransform = mObjToWorld; |
| 896 | meshData->scale = mObjScale; |
| 897 | |
| 898 | meshData->meshDetailLevels.increment(); |
| 899 | |
| 900 | ColladaUtils::ExportData::detailLevel* curDetail = &meshData->meshDetailLevels.last(); |
| 901 | |
| 902 | //Make sure we denote the size this detail level has |
| 903 | curDetail->size = getNextPow2(getObjBox().len()); |
| 904 | |
| 905 | } |
| 906 | |
| 907 | return true; |
| 908 | } |
| 909 | |
| 910 | void ConvexShape::_export( OptimizedPolyList *plist, const Box3F &box, const SphereF &sphere ) |
| 911 | { |
nothing calls this directly
no test coverage detected