void Quad_BestPoint(const Matrix4& local2view, clipcull_t cull, const VertexCb* vertices, SelectionIntersection& best) { Vector4 clipped[9]; { const std::size_t count = local2view.clipTriangle(vertices[0].vertex, vertices[1].vertex, vertices[3].vertex, clipped); BestPoint(count, clipped, best, cull); } { const std::size_t count = local2view.clipTriangle(vertices[1].vertex, vertices[2].vertex, vertices[3].vertex, clipped); BestPoint(count, clipped, best, cull); } }
void Circle_BestPoint(const Matrix4& local2view, clipcull_t cull, const VertexCb* vertices, const std::size_t size, SelectionIntersection& best) { Vector4 clipped[9]; for(std::size_t i=0; i<size; ++i) { const std::size_t count = local2view.clipTriangle(g_vector3_identity, vertices[i].vertex, vertices[(i+1)%size].vertex, clipped); BestPoint(count, clipped, best, cull); } }
void Triangles_BestPoint(const Matrix4& local2view, clipcull_t cull, FlatShadedVertexIterator first, FlatShadedVertexIterator last, SelectionIntersection& best) { for(FlatShadedVertexIterator x(first), y(first+1), z(first+2); x != last; x += 3, y += 3, z +=3) { Vector4 clipped[9]; BestPoint( local2view.clipTriangle( x->vertex, y->vertex, z->vertex, clipped ), clipped, best, cull ); } }