Go to the documentation of this file.
6 Octree::Octree(
double size,
double resolution) : offset_(-size / 2, -size / 2, -size / 2),
7 max_(size / 2, size / 2, size / 2), size_(size), root_(new
OctreeNode(size, this)) {
12 max_(orig.max_), size_(orig.size_), root_(new
OctreeNode(*orig.root_, this)) {
Octree(double size, double resolution=0.1)
double setResolution(double resolution)
const Vector3 & getOrigin() const
void add(const Vector3 &p)
void add(const Vector3 &p)
void add(const Mesh &mesh)
const Mesh & getMesh() const
return the mesh defining the shape
double getResolution() const
void raytrace(const Ray &r, float t0, float t1)
void getCubes(std::vector< Box > &cubes) const
void raytrace(const Vector3 &o, const Vector3 &dir, float t0, float t1, const Vector3 &offset)
bool intersect(const Ray &r, float t0, float t1, double &distance) const
intersect: currently always throws a logic error
bool contains(const Vector3 &p) const
Determines whether a point p lies within the shape.
void getCubes(std::vector< Box > &cubes, const Vector3 &offset) const
virtual Octree * clone() const
void filterOverlappingVertices()
double getMaxRadius() const
Calculate the maximum distance from the origin of the shape to any point of the shape.
const Vector3 & getDirection() const
bool intersect(const Ray &r, float t0, float t1, double &distance, const Vector3 &offset) const
bool contains(const Vector3 &p) const