我正在使用的是:
错误信息如下:
BOOST_GEOMETRY_REGISTER_POINT_3D(glm::vec3, float, boost::geometry::cs::cartesian, x, y, z);
使用定义如下的R树:
using IndexedPoint = std::pair<glm::vec3, uint32_t>;
using RTree = boost::geometry::index::rtree<IndexedPoint, boost::geometry::index::rstar<8>>;
当我尝试使用最近邻查询时,它无法编译:
auto it = rtree.qbegin(boost::geometry::index::nearest(glm::vec3(), 3))
错误信息如下:
error C2664: 'int boost::mpl::assertion_failed<false>(boost::mpl::assert<false>::type)': cannot convert argument 1 from 'boost::mpl::failed ************(__cdecl boost::geometry::strategy::distance::services::default_strategy<boost::geometry::point_tag,boost::geometry::box_tag,glm::vec<3,float,0>,boost::geometry::model::point<float,3,boost::geometry::cs::cartesian>,boost::geometry::cartesian_tag,boost::geometry::cartesian_tag,void>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE_COMBINATION::* ***********)(boost::mpl::assert_::types<Point1,Point2,CsTag1,CsTag2>)' to 'boost::mpl::assert<false>::type'
with
[
Point1=glm::vec<3,float,0>,
Point2=boost::geometry::model::point<float,3,boost::geometry::cs::cartesian>,
CsTag1=boost::geometry::cartesian_tag,
CsTag2=boost::geometry::cartesian_tag
]
看起来comparable_distance_result在vec3与boost::geometry::model::point和boost::geometry::model::box之间缺少专业化。我尝试手动添加它们,但无法使其正常工作。我该如何添加所需的距离类型专业化?
请注意,我可以成功地使用相同的设置进行空间查询,因此它似乎基本上是正确的。
namespace glm { struct vec3 { double x, y, z; vec3(double x_, double y_, double z_) { x = x_; y = y_; z = z_; } }; }
- dvorak4tzx