Return the coordinates of a given vertex
| 106 | |
| 107 | // Return the coordinates of a given vertex |
| 108 | Vector3 PolygonVertexArray::getVertex(uint32 vertexIndex) const { |
| 109 | |
| 110 | Vector3 vertex; |
| 111 | |
| 112 | if (mVertexDataType == PolygonVertexArray::VertexDataType::VERTEX_FLOAT_TYPE) { |
| 113 | const float* vertices = (float*)(mVerticesStart + vertexIndex * mVerticesStride); |
| 114 | vertex.x = decimal(vertices[0]); |
| 115 | vertex.y = decimal(vertices[1]); |
| 116 | vertex.z = decimal(vertices[2]); |
| 117 | } |
| 118 | else if (mVertexDataType == PolygonVertexArray::VertexDataType::VERTEX_DOUBLE_TYPE) { |
| 119 | const double* vertices = (double*)(mVerticesStart + vertexIndex * mVerticesStride); |
| 120 | vertex.x = decimal(vertices[0]); |
| 121 | vertex.y = decimal(vertices[1]); |
| 122 | vertex.z = decimal(vertices[2]); |
| 123 | } |
| 124 | else { |
| 125 | assert(false); |
| 126 | } |
| 127 | |
| 128 | return vertex; |
| 129 | } |
nothing calls this directly
no outgoing calls
no test coverage detected