DHART
|
Functions | |
C_INTERFACE | GenerateGraph (HF::RayTracer::EmbreeRayTracer *ray_tracer, const float *start_point, const float *spacing, int MaxNodes, float UpStep, float UpSlope, float DownStep, float DownSlope, int max_step_connection, int min_connections, int core_count, HF::SpatialStructures::Graph **out_graph) |
Construct a graph by performing a breadth-first search of accessible space. More... | |
C_INTERFACE | GenerateGraphObstacles (HF::RayTracer::EmbreeRayTracer *ray_tracer, const float *start_point, const float *spacing, int MaxNodes, float UpStep, float UpSlope, float DownStep, float DownSlope, int max_step_connection, int min_connections, int core_count, const int *obstacle_ids, const int *walkable_ids, int num_obstacles, int num_walkables, HF::SpatialStructures::Graph **out_graph) |
Construct a graph by performing a breadth-first search of accessible space, seperating obstacles from walkable geometry. More... | |
Perform a breadth-first search on a mesh to find accessible space.
C_INTERFACE GenerateGraph | ( | HF::RayTracer::EmbreeRayTracer * | ray_tracer, |
const float * | start_point, | ||
const float * | spacing, | ||
int | MaxNodes, | ||
float | UpStep, | ||
float | UpSlope, | ||
float | DownStep, | ||
float | DownSlope, | ||
int | max_step_connection, | ||
int | min_connections, | ||
int | core_count, | ||
HF::SpatialStructures::Graph ** | out_graph | ||
) |
#include <Cinterface/analysis_C.h>
Construct a graph by performing a breadth-first search of accessible space.
ray_tracer | Raytracer containing the geometry to use for graph generation. |
start_point | The starting point for the graph generator to begin searching from. If this isn't above solid ground, no nodes will be generated. |
spacing | Space between nodes for each step of the search. Lower values will yield more nodes for a higher resolution graph. |
MaxNodes | Stop generation after this many nodes. A value of -1 will generate an infinite amount of nodes. Note that the final node count may be greater than this value. |
UpStep | Maximum height of a step the graph can traverse. Any steps higher this will be considered inaccessible. |
UpSlope | Maximum upward slope the graph can traverse in degrees. Any slopes steeper than this will be considered inaccessible. |
DownStep | Maximum step down the graph can traverse. Any steps steeper than this will be considered inaccessible. |
DownSlope | The maximum downward slope the graph can traverse. Any slopes steeper than this will be considered inaccessible. |
max_step_connection | Multiplier for number of children to generate for each node. Increasing this value will increase the number of edges in the graph, and as a result the amount of memory the algorithm requires. |
min_connections | The required out-degree for a node to be valid and stored. This must be greater than 0 and equal or less than the total connections created from max_step_connections. Default is 1. A value of 8 when max_step_connections=1 would be a grid. |
core_count | Number of cores to use. -1 will use all available cores, and 0 or 1 will run a serialized version of the algorithm. |
out_graph | Address of a (HF::SpatialStructures::Graph *); out_graph will address heap-allocated memory to an initialized HF::SpatialStructures::Graph on success. |
You must load an .obj file and create a BVH first.
Begin by reviewing the example at Raytracer setup before proceeding below.
First, determine the start point, spacing of nodes for each axis, and maximum nodes to generate.
Then, determine the remainder of the values required by GenerateGraph before calling it.
Very important! Compress the graph after generating a graph or adding edges.
To output the graph to the console, we must retrieve its nodes.
We are now ready to output the generated graph to the console.
When we are finished, we must destroy node_vector and graph.
From here, please review the example at Raytracer teardown for instructions
on how to free the remainder of the resources used by the graph –
which are the (vector<HF::Geometry::MeshInfo> *) and (HF::Raytracer::EmbreeRayTracer *) instances.
>>> LoadOBJ loaded mesh successfully into loaded_obj at address 000002468EEBBEB0, code: 1
>>> CreateRaytracer created EmbreeRayTracer successfully into bvh at address 00000246849C59B0, code: 1
>>> Node count: 594
>>> [(-1, -6, 0, 0) (-1.5, -6.5, -0, 1) (-1.5, -6, -0, 2)]
Definition at line 22 of file analysis_C.cpp.
References HF::GraphGenerator::GraphGenerator::BuildNetwork(), HF::SpatialStructures::Graph::Nodes(), and HF::Exceptions::OK.
C_INTERFACE GenerateGraphObstacles | ( | HF::RayTracer::EmbreeRayTracer * | ray_tracer, |
const float * | start_point, | ||
const float * | spacing, | ||
int | MaxNodes, | ||
float | UpStep, | ||
float | UpSlope, | ||
float | DownStep, | ||
float | DownSlope, | ||
int | max_step_connection, | ||
int | min_connections, | ||
int | core_count, | ||
const int * | obstacle_ids, | ||
const int * | walkable_ids, | ||
int | num_obstacles, | ||
int | num_walkables, | ||
HF::SpatialStructures::Graph ** | out_graph | ||
) |
#include <Cinterface/analysis_C.h>
Construct a graph by performing a breadth-first search of accessible space, seperating obstacles from walkable geometry.
ray_tracer | Raytracer containing the geometry to use for graph generation. |
start_point | The starting point for the graph generator to begin searching from. If this isn't above solid ground, no nodes will be generated. |
spacing | Space between nodes for each step of the search. Lower values will yield more nodes for a higher resolution graph. |
MaxNodes | Stop generation after this many nodes. A value of -1 will generate an infinite amount of nodes. Note that the final node count may be greater than this value. |
UpStep | Maximum height of a step the graph can traverse. Any steps higher this will be considered inaccessible. |
UpSlope | Maximum upward slope the graph can traverse in degrees. Any slopes steeper than this will be considered inaccessible. |
DownStep | Maximum step down the graph can traverse. Any steps steeper than this will be considered inaccessible. |
DownSlope | The maximum downward slope the graph can traverse. Any slopes steeper than this will be considered inaccessible. |
max_step_connection | Multiplier for number of children to generate for each node. Increasing this value will increase the number of edges in the graph, and as a result the amount of memory the algorithm requires. |
min_connections | The required out-degree for a node to be valid and stored. This must be greater than 0 and equal or less than the total connections created from max_step_connections. Default is 1. A value of 8 when max_step_connections=1 would be a grid. |
core_count | Number of cores to use. -1 will use all available cores, and 0 or 1 will run a serialized version of the algorithm. |
obstacle_ids | Array of geometry IDs to consider obstacles |
walkable_ids | Array of geometry IDs to consider as walkable surfaces |
num_obstacles | number of elements in obstacle_ids |
num_walkables | number of elements in walkable_ids |
out_graph | Address of a (HF::SpatialStructures::Graph *); out_graph will address heap-allocated memory to an initialized HF::SpatialStructures::Graph on success. |
You must load an .obj file and create a BVH first.
Begin by reviewing the example at Raytracer setup before proceeding below.
First, determine the start point, spacing of nodes for each axis, and maximum nodes to generate.
Then, determine the remainder of the values required by GenerateGraph before calling it.
Very important! Compress the graph after generating a graph or adding edges.
To output the graph to the console, we must retrieve its nodes.
We are now ready to output the generated graph to the console.
When we are finished, we must destroy node_vector and graph.
From here, please review the example at Raytracer teardown for instructions
on how to free the remainder of the resources used by the graph –
which are the (vector<HF::Geometry::MeshInfo> *) and (HF::Raytracer::EmbreeRayTracer *) instances.
>>> LoadOBJ loaded mesh successfully into loaded_obj at address 000002468EEBBEB0, code: 1
>>> CreateRaytracer created EmbreeRayTracer successfully into bvh at address 00000246849C59B0, code: 1
>>> Node count: 594
>>> [(-1, -6, 0, 0) (-1.5, -6.5, -0, 1) (-1.5, -6, -0, 2)]
Definition at line 62 of file analysis_C.cpp.
References HF::GraphGenerator::GraphGenerator::BuildNetwork(), MapToVector(), HF::SpatialStructures::Graph::Nodes(), and HF::Exceptions::OK.