Return the vertex index of a given vertex in a face * @return The index of a vertex (in the array of vertices data) of a given vertex in a face */
| 81 | * @return The index of a vertex (in the array of vertices data) of a given vertex in a face |
| 82 | */ |
| 83 | uint32 PolygonVertexArray::getVertexIndexInFace(uint32 faceIndex32, uint32 noVertexInFace) const { |
| 84 | |
| 85 | assert(faceIndex32 < mNbFaces); |
| 86 | |
| 87 | // Get the face |
| 88 | PolygonFace* face = getPolygonFace(faceIndex32); |
| 89 | |
| 90 | assert(noVertexInFace < face->nbVertices); |
| 91 | |
| 92 | const void* vertexIndexPointer = mIndicesStart + (face->indexBase + noVertexInFace) * mIndicesStride; |
| 93 | |
| 94 | if (mIndexDataType == PolygonVertexArray::IndexDataType::INDEX_INTEGER_TYPE) { |
| 95 | return *((uint*)vertexIndexPointer); |
| 96 | } |
| 97 | else if (mIndexDataType == PolygonVertexArray::IndexDataType::INDEX_SHORT_TYPE) { |
| 98 | return *((unsigned short*)vertexIndexPointer); |
| 99 | } |
| 100 | else { |
| 101 | assert(false); |
| 102 | } |
| 103 | |
| 104 | return 0; |
| 105 | } |
| 106 | |
| 107 | // Return the coordinates of a given vertex |
| 108 | Vector3 PolygonVertexArray::getVertex(uint32 vertexIndex) const { |
no outgoing calls
no test coverage detected