Example #1
0
 void Bsp::readVertices(char*& cursor, unsigned int count, Vec3f::List& vertices) {
     using namespace IO;
     
     vertices.reserve(count);
     for (unsigned int i = 0; i < count; i++) {
         Vec3f vertex = readVec3f(cursor);
         vertices.push_back(vertex);
     }
 }
        void VertexHandleManager::renderFaceHighlight(Renderer::RenderContext& renderContext, Renderer::RenderBatch& renderBatch, const Vec3& handlePosition) {
            Renderer::RenderService renderService(renderContext, renderBatch);
            renderService.setForegroundColor(pref(Preferences::HandleColor));
            
            Model::VertexToFacesMap::const_iterator it = m_unselectedFaceHandles.find(handlePosition);
            if (it != m_unselectedFaceHandles.end()) {
                const Model::BrushFaceSet& faces = it->second;
                assert(!faces.empty());
                
                const Model::BrushFace* face = *faces.begin();
                const Model::BrushFace::VertexList& vertices = face->vertices();

                Vec3f::List vertexPositions;
                vertexPositions.reserve(vertices.size());
                Vec3f::toList(vertices.begin(), vertices.end(), Model::BrushGeometry::GetVertexPosition(), vertexPositions);
                
                renderService.renderPolygonOutline(vertexPositions);
            }
        }