|
Blender
V2.59
|
#include <stdio.h>#include <string.h>#include <math.h>#include <assert.h>#include "DNA_meshdata_types.h"#include "BLI_editVert.h"#include "BLI_utildefines.h"#include "BKE_DerivedMesh.h"#include "BLI_math.h"#include "MEM_guardedalloc.h"Go to the source code of this file.
Classes | |
| struct | BVHCacheItem |
Typedefs | |
| typedef struct BVHCacheItem | BVHCacheItem |
Functions | |
| static float | ray_tri_intersection (const BVHTreeRay *ray, const float UNUSED(m_dist), const float *v0, const float *v1, const float *v2) |
| static float | sphereray_tri_intersection (const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2) |
| static float | nearest_point_in_tri_surface (const float *v0, const float *v1, const float *v2, const float *p, int *v, int *e, float *nearest) |
| static void | mesh_faces_nearest_point (void *userdata, int index, const float *co, BVHTreeNearest *nearest) |
| static void | mesh_faces_spherecast (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) |
| static void | mesh_edges_nearest_point (void *userdata, int index, const float *co, BVHTreeNearest *nearest) |
| BVHTree * | bvhtree_from_mesh_verts (BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) |
| BVHTree * | bvhtree_from_mesh_faces (BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) |
| BVHTree * | bvhtree_from_mesh_edges (BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis) |
| void | free_bvhtree_from_mesh (struct BVHTreeFromMesh *data) |
| static void | bvhcacheitem_set_if_match (void *_cached, void *_search) |
| BVHTree * | bvhcache_find (BVHCache *cache, int type) |
| void | bvhcache_insert (BVHCache *cache, BVHTree *tree, int type) |
| void | bvhcache_init (BVHCache *cache) |
| static void | bvhcacheitem_free (void *_item) |
| void | bvhcache_free (BVHCache *cache) |
Definition in file bvhutils.c.
| typedef struct BVHCacheItem BVHCacheItem |
Definition at line 746 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 787 of file bvhutils.c.
References BLI_linklist_free(), bvhcacheitem_free(), and NULL.
Referenced by DM_release().
| void bvhcache_init | ( | BVHCache * | cache | ) |
Definition at line 756 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().
| static void bvhcacheitem_free | ( | void * | _item | ) | [static] |
Definition at line 778 of file bvhutils.c.
References BLI_bvhtree_free(), MEM_freeN(), and BVHCacheItem::tree.
Referenced by bvhcache_free().
| static void bvhcacheitem_set_if_match | ( | void * | _cached, |
| void * | _search | ||
| ) | [static] |
Definition at line 735 of file bvhutils.c.
References BVHCacheItem::tree, and BVHCacheItem::type.
Referenced by bvhcache_find().
| BVHTree* bvhtree_from_mesh_edges | ( | BVHTreeFromMesh * | data, |
| DerivedMesh * | mesh, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis | ||
| ) |
Definition at line 653 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, 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, VECCOPY, and BVHTreeFromMesh::vert.
Referenced by deformVerts().
| BVHTree* bvhtree_from_mesh_faces | ( | BVHTreeFromMesh * | data, |
| DerivedMesh * | mesh, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis | ||
| ) |
Definition at line 570 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, 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, VECCOPY, and BVHTreeFromMesh::vert.
Referenced by connect_hair(), deformVerts(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_normal_projection(), shrinkwrap_get_tarmat(), and snapDerivedMesh().
| BVHTree* bvhtree_from_mesh_verts | ( | BVHTreeFromMesh * | data, |
| DerivedMesh * | mesh, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis | ||
| ) |
Definition at line 512 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 shrinkwrap_calc_nearest_vertex(), and shrinkwrap_get_tarmat().
| void free_bvhtree_from_mesh | ( | struct BVHTreeFromMesh * | data | ) |
Definition at line 715 of file bvhutils.c.
References BLI_bvhtree_free(), BVHTreeFromMesh::cached, and BVHTreeFromMesh::tree.
Referenced by connect_hair(), deformVerts(), freeData(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_nearest_vertex(), shrinkwrap_calc_normal_projection(), and shrinkwrap_get_tarmat().
| static void mesh_edges_nearest_point | ( | void * | userdata, |
| int | index, | ||
| const float * | co, | ||
| BVHTreeNearest * | nearest | ||
| ) | [static] |
Definition at line 483 of file bvhutils.c.
References closest_to_line_segment_v3(), BVHTreeNearest::co, MVert::co, BVHTreeNearest::dist, BVHTreeFromMesh::edge, BVHTreeNearest::index, len_squared_v3v3(), BVHTreeNearest::no, normalize_v3(), sub_v3_v3v3(), MEdge::v1, MEdge::v2, VECCOPY, and BVHTreeFromMesh::vert.
Referenced by bvhtree_from_mesh_edges().
| static void mesh_faces_nearest_point | ( | void * | userdata, |
| int | index, | ||
| const float * | co, | ||
| BVHTreeNearest * | nearest | ||
| ) | [static] |
Definition at line 408 of file bvhutils.c.
References BVHTreeNearest::co, MVert::co, BVHTreeNearest::dist, BVHTreeFromMesh::face, BVHTreeNearest::index, nearest_point_in_tri_surface(), BVHTreeNearest::no, normal_tri_v3(), NULL, MFace::v1, MFace::v2, MFace::v3, MFace::v4, VECCOPY, and BVHTreeFromMesh::vert.
Referenced by bvhtree_from_mesh_faces().
| static void mesh_faces_spherecast | ( | void * | userdata, |
| int | index, | ||
| const BVHTreeRay * | ray, | ||
| BVHTreeRayHit * | hit | ||
| ) | [static] |
Definition at line 444 of file bvhutils.c.
References MVert::co, BVHTreeRayHit::co, BVHTreeRay::direction, BVHTreeRayHit::dist, BVHTreeFromMesh::face, BVHTreeRayHit::index, BVHTreeRayHit::no, normal_tri_v3(), NULL, BVHTreeRay::origin, ray_tri_intersection(), BVHTreeFromMesh::sphere_radius, sphereray_tri_intersection(), MFace::v1, MFace::v2, MFace::v3, MFace::v4, VECADDFAC, and BVHTreeFromMesh::vert.
Referenced by bvhtree_from_mesh_faces().
| static float nearest_point_in_tri_surface | ( | const float * | v0, |
| const float * | v1, | ||
| const float * | v2, | ||
| const float * | p, | ||
| int * | v, | ||
| int * | e, | ||
| float * | nearest | ||
| ) | [static] |
Definition at line 86 of file bvhutils.c.
References C, KDL::diff(), fabs(), fabsf, INPR, mul_v3_fl(), T, VECADD, VECCOPY, VECSUB, and simple_enum_gen::w.
Referenced by mesh_faces_nearest_point().
| static float ray_tri_intersection | ( | const BVHTreeRay * | ray, |
| const float | UNUSEDm_dist, | ||
| const float * | v0, | ||
| const float * | v1, | ||
| const float * | v2 | ||
| ) | [static] |
Definition at line 53 of file bvhutils.c.
References BVHTreeRay::direction, FLT_MAX, isect_ray_tri_v3(), NULL, and BVHTreeRay::origin.
Referenced by mesh_faces_spherecast().
| static float sphereray_tri_intersection | ( | const BVHTreeRay * | ray, |
| float | radius, | ||
| const float | m_dist, | ||
| const float * | v0, | ||
| const float * | v1, | ||
| const float * | v2 | ||
| ) | [static] |
Definition at line 63 of file bvhutils.c.
References BVHTreeRay::direction, FLT_MAX, isect_sweeping_sphere_tri_v3(), normal_tri_v3(), BVHTreeRay::origin, and VECADDFAC.
Referenced by mesh_faces_spherecast().