KeyFrame::KeyFrame(const KeyFrame &keyframe) { const vector<Mesh*> &m = keyframe.getMeshes(); for(vector<Mesh*>::const_iterator i = m.begin(); i != m.end(); ++i) { Mesh *mesh = new Mesh(*i); meshes.push_back(mesh); } }
void ModelLoaderSingle::setPolygonWinding(KeyFrame &keyFrame, const string &polygonWinding) { vector<Mesh*> &meshes = keyFrame.getMeshes(); for(vector<Mesh*>::iterator i=meshes.begin(); i!=meshes.end(); ++i) { (*i)->polygonWinding = polygonWinding=="CCW" ? GL_CCW : GL_CW; } }
bool KeyFrame::merge(const KeyFrame &o) { if(getMeshes().size() == 0) { meshes = o.getMeshes(); } else { if(getMeshes().size() != o.getMeshes().size()) return false; for(vector<Mesh*>::const_iterator iter=o.getMeshes().begin(); iter != o.getMeshes().end(); ++iter) { meshes.push_back(*iter); } } return true; }