DHART
Loading...
Searching...
No Matches
raytracer_C.h
Go to the documentation of this file.
1
9#ifndef RAYTRACER_C_H
10#define RAYTRACER_C_H
11
12#include <vector>
13#include <array>
14
15namespace HF {
16 namespace RayTracer {
17 class EmbreeRayTracer;
18 }
19 namespace Geometry {
20 template<typename T> class MeshInfo;
21 }
22}
23
24#define C_INTERFACE extern "C" __declspec(dllexport) int
25
89struct RayResult {
90 float distance = -1;
91 int meshid = -1;
92
102 template <typename N, typename V>
103 void SetHit(const N& node, const V& direction, float dist, int mid) {
104 distance = dist;
105 meshid = mid;
106 }
107};
108
124 HF::RayTracer::EmbreeRayTracer ** out_raytracer,
125 bool use_precise
126);
127
140 int num_meshes,
141 HF::RayTracer::EmbreeRayTracer** out_raytracer,
142 bool use_precise
143);
144
145
158);
159
160
174 int number_of_meshes
175);
176
177
189
266 float* origins,
267 int num_origins,
268 float* directions,
269 int num_directions,
270 std::vector<RayResult>** out_results,
271 RayResult** results_data
272);
273
316 const float* origin,
317 const float* direction,
318 const float max_distance,
319 float* out_distance,
320 int* out_meshid
321);
322
362C_INTERFACE CastRay(HF::RayTracer::EmbreeRayTracer* ert, float& x, float& y, float& z, float dx, float dy, float dz, float max_distance, bool& result);
363
411C_INTERFACE CastMultipleRays(HF::RayTracer::EmbreeRayTracer* ert, float* origins, const float* directions, int size, float max_distance, bool* result_array);
412
458C_INTERFACE CastMultipleOriginsOneDirection(HF::RayTracer::EmbreeRayTracer* ert, float* origins, const float* direction, int size, float max_distance, bool* result_array);
459
504C_INTERFACE CastMultipleDirectionsOneOrigin(HF::RayTracer::EmbreeRayTracer* ert, const float* origin, float* directions, int size, float max_distance, bool* result_array);
505
556 const float* origins,
557 const float* directions,
558 int origin_size,
559 int direction_size,
560 float max_distance,
561 bool* result_array
562);
563
577 std::vector<RayResult>* analysis
578);
579
580C_INTERFACE PreciseIntersection(HF::RayTracer::EmbreeRayTracer* RT, double x, double y, double z, double dx, double dy, double dz, double * out_distance);
581
584#endif /* RAYTRACER_C_H */
#define C_INTERFACE
Definition: raytracer_C.h:24
C_INTERFACE AddMeshes(HF::RayTracer::EmbreeRayTracer *ERT, HF::Geometry::MeshInfo< float > **MI, int number_of_meshes)
Add a new mesh to a raytracer.
Definition: raytracer_C.cpp:71
C_INTERFACE CastSingleRayDistance(HF::RayTracer::EmbreeRayTracer *ert, const float *origin, const float *direction, const float max_distance, float *out_distance, int *out_meshid)
Cast a single ray and get the distance to its hit and the mesh ID if it hit anything....
Definition: raytracer_C.cpp:98
C_INTERFACE CreateRaytracer(HF::Geometry::MeshInfo< float > *mesh, HF::RayTracer::EmbreeRayTracer **out_raytracer, bool use_precise)
Create a new raytracer using several meshes.
Definition: raytracer_C.cpp:15
C_INTERFACE DestroyRayResultVector(std::vector< RayResult > *analysis)
Destroy a vector of rayresults.
C_INTERFACE CastMultipleRays(HF::RayTracer::EmbreeRayTracer *ert, float *origins, const float *directions, int size, float max_distance, bool *result_array)
Cast multiple rays at once in parallel and receive their hitpoints in return. The number of direction...
C_INTERFACE AddMesh(HF::RayTracer::EmbreeRayTracer *ERT, HF::Geometry::MeshInfo< float > *MI)
Add a new mesh to a raytracer.
Definition: raytracer_C.cpp:84
C_INTERFACE CastRaysDistance(HF::RayTracer::EmbreeRayTracer *ert, float *origins, int num_origins, float *directions, int num_directions, std::vector< RayResult > **out_results, RayResult **results_data)
Cast rays for each node in origins/directions as ordered pairs and get distance back as a result.
C_INTERFACE CastMultipleDirectionsOneOrigin(HF::RayTracer::EmbreeRayTracer *ert, const float *origin, float *directions, int size, float max_distance, bool *result_array)
Cast rays from a single origin point in multiple directions and get a the points where they intersect...
C_INTERFACE CastRay(HF::RayTracer::EmbreeRayTracer *ert, float &x, float &y, float &z, float dx, float dy, float dz, float max_distance, bool &result)
Cast a single ray from the raytracer and receive a point in return.
C_INTERFACE CreateRaytracerMultiMesh(HF::Geometry::MeshInfo< float > **meshes, int num_meshes, HF::RayTracer::EmbreeRayTracer **out_raytracer, bool use_precise)
Create a new raytracer using several meshes.
Definition: raytracer_C.cpp:39
C_INTERFACE DestroyRayTracer(HF::RayTracer::EmbreeRayTracer *rt_to_destroy)
Delete an existing raytracer.
Definition: raytracer_C.cpp:91
C_INTERFACE PreciseIntersection(HF::RayTracer::EmbreeRayTracer *RT, double x, double y, double z, double dx, double dy, double dz, double *out_distance)
C_INTERFACE CastOcclusionRays(HF::RayTracer::EmbreeRayTracer *ert, const float *origins, const float *directions, int origin_size, int direction_size, float max_distance, bool *result_array)
Cast one or more occlusion rays in parallel.
C_INTERFACE CastMultipleOriginsOneDirection(HF::RayTracer::EmbreeRayTracer *ert, float *origins, const float *direction, int size, float max_distance, bool *result_array)
Cast rays from each origin point in the given direction.
Perform human scale analysis on 3D environments.
HF::RayTracer::MultiRT RayTracer
Type of raytracer to be used internally.
A collection of vertices and indices representing geometry.
Definition: meshinfo.h:124
A wrapper for Intel's Embree Library.
The result of casting a ray at an object. Contains distance to the hitpoint and the ID of the mesh.
Definition: raytracer_C.h:89
void SetHit(const N &node, const V &direction, float dist, int mid)
Update this result based on the ray intersection. Similar structures can be created to support differ...
Definition: raytracer_C.h:103
int meshid
Definition: raytracer_C.h:91
float distance
Definition: raytracer_C.h:90