18 #include <osg/Geometry>
41 unsigned int _numVerticesProcessed;
42 unsigned int _targetNumTrianglesPerLeaf;
43 unsigned int _maxNumLevels;
49 virtual bool build(BuildOptions& buildOptions,
osg::Geometry* geometry);
86 virtual bool intersect(
const osg::Vec3d& start,
const osg::Vec3d& end, LineSegmentIntersections& intersections)
const;
112 Triangle(
unsigned int ip0,
unsigned int ip1,
unsigned int ip2):
113 p0(ip0), p1(ip1), p2(ip2) {}
117 if (p0<rhs.
p0)
return true;
118 if (p0>rhs.
p0)
return false;
119 if (p1<rhs.
p1)
return true;
120 if (p1>rhs.
p1)
return false;
134 int num =
static_cast<int>(_kdNodes.size());
135 _kdNodes.push_back(node);
143 const KdNodeList&
getNodes()
const {
return _kdNodes; }
150 unsigned int num =
static_cast<unsigned int>(_triangles.size());
151 _triangles.push_back(tri);
META_Shape(osg, KdTree) struct OSG_EXPORT BuildOptions
osg::ref_ptr< osg::Vec3Array > _vertices
std::vector< unsigned int > IndexList
std::vector< Triangle > TriangleList
Triangle(unsigned int ip0, unsigned int ip1, unsigned int ip2)
TriangleList & getTriangles()
Triangle & getTriangle(unsigned int i)
KdNode(value_type f, value_type s)
osg::ref_ptr< osg::KdTree > _kdTreePrototype
const KdNode & getNode(int nodeNum) const
osg::Vec3d intersectionPoint
T * clone(const T *t, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
void setVertices(osg::Vec3Array *vertices)
int addNode(const KdNode &node)
KdNode & getNode(int nodeNum)
std::vector< double > RatioList
const Triangle & getTriangle(unsigned int i) const
unsigned int primitiveIndex
LineSegmentIntersection()
unsigned int addTriangle(const Triangle &tri)
osg::Vec3 intersectionNormal
META_NodeVisitor(osg, KdTreeBuilder) virtual KdTreeBuilder *clone()
std::vector< LineSegmentIntersection > LineSegmentIntersections
std::vector< KdNode > KdNodeList
const KdNodeList & getNodes() const
const TriangleList & getTriangles() const
const osg::Vec3Array * getVertices() const
KdTree::BuildOptions _buildOptions