Voxvision  1
Creating and manipulating voxel octrees
Functions
search.h File Reference

Algorithms for searching in tree. More...

#include "tree.h"

Go to the source code of this file.

Functions

VOX_EXPORT const struct vox_nodevox_ray_tree_intersection (const struct vox_node *tree, const vox_dot origin, const vox_dot dir, vox_dot res)
 Find intersection of a tree and a ray. More...
 
VOX_EXPORT int vox_tree_ball_collidep (const struct vox_node *tree, const vox_dot center, float radius)
 Find out if a ball collides with voxels in a tree. More...
 

Detailed Description

Algorithms for searching in tree.

Searching for intersection with a ray and a tree and (maybe) other

Function Documentation

◆ vox_ray_tree_intersection()

VOX_EXPORT const struct vox_node* vox_ray_tree_intersection ( const struct vox_node tree,
const vox_dot  origin,
const vox_dot  dir,
vox_dot  res 
)

Find intersection of a tree and a ray.

Parameters
treea tree
originstarting point of the ray
dirdirection of the ray
reswhere result is stored
Returns
leaf where the intersection is found or NULL if there is no intersection.

◆ vox_tree_ball_collidep()

VOX_EXPORT int vox_tree_ball_collidep ( const struct vox_node tree,
const vox_dot  center,
float  radius 
)

Find out if a ball collides with voxels in a tree.

Parameters
treethe tree
centercenter of the ball
radiusradius of the ball
Returns
1 if collision was found, 0 otherwise