Extract the points from the array
| 1055 | |
| 1056 | // Extract the points from the array |
| 1057 | void QuickHull::extractPoints(const VertexArray& vertexArray, Array<Vector3>& outArray) { |
| 1058 | |
| 1059 | const unsigned char* pointsStartPointer = reinterpret_cast<const unsigned char*>(vertexArray.getStart()); |
| 1060 | |
| 1061 | if (vertexArray.getDataType() == VertexArray::DataType::VERTEX_FLOAT_TYPE) { |
| 1062 | for (uint32 p=0; p < vertexArray.getNbVertices(); p++) { |
| 1063 | const float* points = (float*)(pointsStartPointer + p * vertexArray.getStride()); |
| 1064 | outArray.add(Vector3(points[0], points[1], points[2])); |
| 1065 | } |
| 1066 | } |
| 1067 | else if (vertexArray.getDataType() == VertexArray::DataType::VERTEX_DOUBLE_TYPE) { |
| 1068 | for (uint32 p=0; p < vertexArray.getNbVertices(); p++) { |
| 1069 | const double* points = (double*)(pointsStartPointer + p * vertexArray.getStride()); |
| 1070 | outArray.add(Vector3(points[0], points[1], points[2])); |
| 1071 | } |
| 1072 | } |
| 1073 | else { |
| 1074 | assert(false); |
| 1075 | } |
| 1076 | } |
nothing calls this directly
no test coverage detected