1#define NANORT_USE_CPP11_FEATURE
12 (m->vertices, m->faces, sizeof(
double) * 3)
42 std::cout <<
"Destroyed" << std::endl;
65 bool hit = accel.
Traverse(ray, triangle_intersector, &isect);
86 ret = accel.
Build(mesh.
num_faces, triangle_mesh, triangle_pred, build_options);
105 bool hit = accel.
Traverse(intersector.
ray, intersector, &intersector.
hit);
125 vertices.resize(mi_vertices.size());
126 for (
int i = 0; i < mi_vertices.size(); i++)
131 indices.resize(mi_indices.size());
132 for (
int i = 0; i < mi_indices.size(); i++)
133 indices[i] =
static_cast<unsigned int>(mi_indices[i]);
146 vertices.resize(mi_vertices.size());
147 for (
int i = 0; i < mi_vertices.size(); i++)
152 indices.resize(mi_indices.size());
153 for (
int i = 0; i < mi_indices.size(); i++)
154 indices[i] =
static_cast<unsigned int>(mi_indices[i]);
Contains definitions for the MeshInfo class.
Cast rays to determine if and where they intersect geometry.
unsigned int * faces
[xyz] * 3(triangle) * num_faces
nanort::BVHAccel< double > nanoRT_BVH(Mesh &mesh)
bool nanoRT_Intersect(Mesh &mesh, nanort::BVHAccel< double > &accel, nanoRT_Data &intersector)
bool nanoRT_RayCast(nanort::BVHAccel< double > &accel, nanort::TriangleIntersector< double, nanort::TriangleIntersection< double > > &triangle_intersector, nanort::Ray< double > &ray, nanort::TriangleIntersection< double > &isect)
A collection of vertices and indices representing geometry.
const array_and_size< int > GetIndexPointer() const
Get a pointer to the index array of this mesh.
const array_and_size< numeric_type > GetVertexPointer() const
Get a pointer to the vertex array of this mesh.
Bounding Volume Hierarchy acceleration.
bool Traverse(const Ray< T > &ray, const I &intersector, H *isect, const BVHTraceOptions &options=BVHTraceOptions()) const
Traverse into BVH along ray and find closest hit point & primitive if found.
bool Build(const unsigned int num_primitives, const Prim &p, const Pred &pred, const BVHBuildOptions< T > &options=BVHBuildOptions< T >())
Build BVH for input primitives.
HF::nanoGeom::Mesh * mesh
nanort::Ray< double > ray
nanort::TriangleIntersection< double > hit
NanoRTRayTracer(const HF::Geometry::MeshInfo< float > &MI)
Construct a new raytracer with an instance of meshinfo.
std::unique_ptr< Intersector > intersector
Triangle Intersector.
std::vector< real_t > vertices
nanort::TriangleIntersector< vertex_t, Intersection > Intersector
std::vector< unsigned int > indices