本文整理汇总了C++中Octree::IntersectRay方法的典型用法代码示例。如果您正苦于以下问题:C++ Octree::IntersectRay方法的具体用法?C++ Octree::IntersectRay怎么用?C++ Octree::IntersectRay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Octree
的用法示例。
在下文中一共展示了Octree::IntersectRay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestOctree
void TestOctree()
{
std::vector<vgl_point_3d<double> > Points;
Points.push_back(vgl_point_3d<double>(1.0, 0.0, 0.0));
Points.push_back(vgl_point_3d<double>(0.0, 0.0, 0.0));
Points.push_back(vgl_point_3d<double>(0.0, 1.0, 0.0));
std::vector<std::vector<unsigned int> > VertexLists;
std::vector<unsigned int> VertexList;
VertexList.push_back(0);
VertexList.push_back(1);
VertexList.push_back(2);
VertexLists.push_back(VertexList);
Octree Tree;
Tree.Build(Points, VertexLists);
OrientedPoint Intersection;
Ray R(vgl_point_3d<double>(0.5, 0.5, -1.0), vgl_vector_3d<double> (0.0, 0.0, 1.0));
bool intersect = Tree.IntersectRay(R, Intersection);
std::cout << "Intersect? " << intersect << std::endl;
if(intersect)
std::cout << "Intersection: " << Intersection << std::endl;
}