StaticMesh::StaticMesh(const StaticMesh &o) { if( m_faceNormals != 0 ) { delete[] m_faceNormals; } m_faceNormals = new float[3 * o.m_numVertices]; m_vertices = floatArr( new float[3 * o.m_numVertices] ); m_colors = ucharArr( new unsigned char[3 * o.m_numVertices] ); m_faces = uintArr( new unsigned int[3 * o.m_numFaces] ); for ( size_t i(0); i < 3 * o.m_numVertices; i++ ) { m_faceNormals[i] = o.m_faceNormals[i]; m_vertices[i] = o.m_vertices[i]; m_colors[i] = o.m_colors[i]; } for( size_t i = 0; i < 3 * o.m_numFaces; ++i ) { m_faces[i] = o.m_faces[i]; } m_boundingBox = o.m_boundingBox; m_model = o.m_model; }
void MeshBuffer::setVertexIntensityArray(std::vector<float>& array) { m_vertexIntensity = floatArr(new float[array.size()]); for (int i(0); i < array.size(); i++) { m_vertexIntensity[i] = array[i]; } m_numVertexIntensities = array.size(); }
void MeshBuffer::setVertexTextureCoordinateArray(std::vector<float>& array) { m_vertexTextureCoordinates = floatArr(new float[array.size()]); for (int i(0); i < array.size(); i++) { m_vertexTextureCoordinates[i] = array[i]; } m_numVertexTextureCoordinates = array.size() / 3; }
void MeshBuffer::setVertexConfidenceArray(std::vector<float>& array) { m_vertexConfidence = floatArr(new float[array.size()]); for (int i(0); i < array.size(); i++) { m_vertexConfidence[i] = array[i]; } m_numVertexConfidences = array.size(); }
void MeshBuffer::setVertexNormalArray(std::vector<float>& array) { m_vertexNormals = floatArr(new float[array.size()]); for (size_t i(0); i < array.size(); i++) { m_vertexNormals[i] = array[i]; } m_numVertexNormals = array.size() / 3; }
floatArr StaticMesh::getVertices() { return m_finalized ? m_vertices : floatArr(); }