void RigidBody::CreateList() { m_RigidBodyList = glGenLists(1); glNewList(m_RigidBodyList, GL_COMPILE); // glColor3f(1.0,1.0,0.0); typedef map<FaceId, Face> FaceMap; FaceMap faces = m_Geom.GetFaces(); FaceMap::const_iterator itFaceEnd = faces.end(); for (FaceMap::const_iterator itFace = faces.begin(); itFace != itFaceEnd; ++itFace) { // glBegin(GL_POLYGON); glBegin(GL_LINE_LOOP); vector<VertexId> vertexIds = (*itFace).second.GetVertexIds(); vector<VertexId>::iterator vItEnd = vertexIds.end(); for(vector<VertexId>::iterator vIt = vertexIds.begin() ; vIt != vItEnd ; vIt++) { Vertex vertex = m_Geom.GetVertex((*vIt)); glPushMatrix(); glVertex3f(vertex.GetPos().GetX(), vertex.GetPos().GetY(), vertex.GetPos().GetZ()); glPopMatrix(); } glEnd(); } glEndList(); }
inline FaceTable::const_iterator FaceTable::begin() const { return const_iterator(m_faces.begin()); }