Blender V2.61 - r43446
|
#include "BLI_kdopbvh.h"
Go to the source code of this file.
Classes | |
struct | BVHTreeFromMesh |
Defines | |
#define | BVHTREE_FROM_FACES 0 |
#define | BVHTREE_FROM_VERTICES 1 |
#define | BVHTREE_FROM_EDGES 2 |
Typedefs | |
typedef struct BVHTreeFromMesh | BVHTreeFromMesh |
typedef struct LinkNode * | BVHCache |
Functions | |
BVHTree * | bvhtree_from_mesh_verts (struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis) |
BVHTree * | bvhtree_from_mesh_faces (struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis) |
BVHTree * | bvhtree_from_mesh_edges (struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis) |
void | free_bvhtree_from_mesh (struct BVHTreeFromMesh *data) |
float | bvhtree_ray_tri_intersection (const BVHTreeRay *ray, const float m_dist, const float v0[3], const float v1[3], const float v2[3]) |
float | nearest_point_in_tri_surface (const float v0[3], const float v1[3], const float v2[3], const float p[3], int *v, int *e, float nearest[3]) |
BVHTree * | bvhcache_find (BVHCache *cache, int type) |
void | bvhcache_insert (BVHCache *cache, BVHTree *tree, int type) |
void | bvhcache_init (BVHCache *cache) |
void | bvhcache_free (BVHCache *cache) |
Definition in file BKE_bvhutils.h.
#define BVHTREE_FROM_EDGES 2 |
Definition at line 121 of file BKE_bvhutils.h.
Referenced by bvhtree_from_mesh_edges().
#define BVHTREE_FROM_FACES 0 |
Definition at line 119 of file BKE_bvhutils.h.
Referenced by bvhtree_from_mesh_faces().
#define BVHTREE_FROM_VERTICES 1 |
Definition at line 120 of file BKE_bvhutils.h.
Referenced by bvhtree_from_mesh_verts().
Definition at line 123 of file BKE_bvhutils.h.
typedef struct BVHTreeFromMesh BVHTreeFromMesh |
Definition at line 743 of file bvhutils.c.
References BLI_linklist_apply(), bvhcacheitem_set_if_match(), NULL, BVHCacheItem::tree, and BVHCacheItem::type.
Referenced by bvhcache_insert(), bvhtree_from_mesh_edges(), bvhtree_from_mesh_faces(), and bvhtree_from_mesh_verts().
void bvhcache_free | ( | BVHCache * | cache | ) |
Definition at line 784 of file bvhutils.c.
References BLI_linklist_free(), bvhcacheitem_free(), and NULL.
Referenced by DM_release().
void bvhcache_init | ( | BVHCache * | cache | ) |
Definition at line 753 of file bvhutils.c.
References assert, BLI_linklist_prepend(), bvhcache_find(), MEM_mallocN(), NULL, BVHCacheItem::tree, and BVHCacheItem::type.
Referenced by bvhtree_from_mesh_edges(), bvhtree_from_mesh_faces(), and bvhtree_from_mesh_verts().
BVHTree* bvhtree_from_mesh_edges | ( | struct BVHTreeFromMesh * | data, |
struct DerivedMesh * | mesh, | ||
float | epsilon, | ||
int | tree_type, | ||
int | axis | ||
) |
Definition at line 650 of file bvhutils.c.
References BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), DerivedMesh::bvhCache, bvhcache_find(), bvhcache_insert(), BVHTREE_FROM_EDGES, BVHTreeFromMesh::cached, CD_MEDGE, CD_MVERT, co, copy_v3_v3(), BVHTreeFromMesh::edge, KDL::epsilon, DerivedMesh::getEdgeDataArray, DerivedMesh::getNumEdges, DerivedMesh::getVertDataArray, i, BVHTreeFromMesh::mesh, mesh_edges_nearest_point(), BVHTreeFromMesh::nearest_callback, NULL, BVHTreeFromMesh::raycast_callback, BVHTreeFromMesh::sphere_radius, BVHTreeFromMesh::tree, TRUE, and BVHTreeFromMesh::vert.
Referenced by deformVerts(), and get_vert2geom_distance().
BVHTree* bvhtree_from_mesh_faces | ( | struct BVHTreeFromMesh * | data, |
struct DerivedMesh * | mesh, | ||
float | epsilon, | ||
int | tree_type, | ||
int | axis | ||
) |
Definition at line 567 of file bvhutils.c.
References BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), DerivedMesh::bvhCache, bvhcache_find(), bvhcache_insert(), BVHTREE_FROM_FACES, BVHTreeFromMesh::cached, CD_MFACE, CD_MVERT, co, copy_v3_v3(), BVHTreeFromMesh::em_evil, KDL::epsilon, BVHTreeFromMesh::face, EditMesh::faces, ListBase::first, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getVertDataArray, i, BVHTreeFromMesh::mesh, mesh_faces_nearest_point(), mesh_faces_spherecast(), BVHTreeFromMesh::nearest_callback, EditFace::next, NULL, BVHTreeFromMesh::raycast_callback, BVHTreeFromMesh::sphere_radius, BVHTreeFromMesh::tree, TRUE, and BVHTreeFromMesh::vert.
Referenced by connect_hair(), deformVerts(), dynamicPaint_paintMesh(), followtrack_evaluate(), get_vert2geom_distance(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_normal_projection(), shrinkwrap_get_tarmat(), and snapDerivedMesh().
BVHTree* bvhtree_from_mesh_verts | ( | struct BVHTreeFromMesh * | data, |
struct DerivedMesh * | mesh, | ||
float | epsilon, | ||
int | tree_type, | ||
int | axis | ||
) |
Definition at line 509 of file bvhutils.c.
References BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), DerivedMesh::bvhCache, bvhcache_find(), bvhcache_insert(), BVHTREE_FROM_VERTICES, BVHTreeFromMesh::cached, CD_MFACE, CD_MVERT, co, KDL::epsilon, BVHTreeFromMesh::face, DerivedMesh::getFaceDataArray, DerivedMesh::getNumVerts, DerivedMesh::getVertDataArray, i, BVHTreeFromMesh::mesh, BVHTreeFromMesh::nearest_callback, NULL, BVHTreeFromMesh::raycast_callback, BVHTreeFromMesh::sphere_radius, BVHTreeFromMesh::tree, TRUE, and BVHTreeFromMesh::vert.
Referenced by get_vert2geom_distance(), shrinkwrap_calc_nearest_vertex(), and shrinkwrap_get_tarmat().
float bvhtree_ray_tri_intersection | ( | const BVHTreeRay * | ray, |
const float | m_dist, | ||
const float | v0[3], | ||
const float | v1[3], | ||
const float | v2[3] | ||
) |
Referenced by mesh_faces_spherecast(), and mesh_faces_spherecast_dp().
void free_bvhtree_from_mesh | ( | struct BVHTreeFromMesh * | data | ) |
Definition at line 712 of file bvhutils.c.
References BLI_bvhtree_free(), BVHTreeFromMesh::cached, and BVHTreeFromMesh::tree.
Referenced by connect_hair(), deformVerts(), dynamicPaint_paintMesh(), followtrack_evaluate(), freeData(), get_vert2geom_distance(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_nearest_vertex(), shrinkwrap_calc_normal_projection(), and shrinkwrap_get_tarmat().
float nearest_point_in_tri_surface | ( | const float | v0[3], |
const float | v1[3], | ||
const float | v2[3], | ||
const float | p[3], | ||
int * | v, | ||
int * | e, | ||
float | nearest[3] | ||
) |
Definition at line 84 of file bvhutils.c.
References add_v3_v3v3(), C, copy_v3_v3(), KDL::diff(), dot_v3v3(), fabs(), fabsf, mul_v3_fl(), sub_v3_v3v3(), T, and simple_enum_gen::w.
Referenced by mesh_faces_nearest_point(), and mesh_faces_nearest_point_dp().