Blender V2.61 - r43446
Classes | Typedefs | Functions

bvhutils.c File Reference

#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 "BLI_linklist.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

float bvhtree_ray_tri_intersection (const BVHTreeRay *ray, const float UNUSED(m_dist), const float v0[3], const float v1[3], const float v2[3])
static float sphereray_tri_intersection (const BVHTreeRay *ray, float radius, 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])
static void mesh_faces_nearest_point (void *userdata, int index, const float co[3], 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[3], BVHTreeNearest *nearest)
BVHTreebvhtree_from_mesh_verts (BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis)
BVHTreebvhtree_from_mesh_faces (BVHTreeFromMesh *data, DerivedMesh *mesh, float epsilon, int tree_type, int axis)
BVHTreebvhtree_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)
BVHTreebvhcache_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)

Detailed Description

Definition in file bvhutils.c.


Typedef Documentation

typedef struct BVHCacheItem BVHCacheItem

Function Documentation

BVHTree* bvhcache_find ( BVHCache cache,
int  type 
)
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 770 of file bvhutils.c.

References NULL.

Referenced by DM_init_funcs().

void bvhcache_insert ( BVHCache cache,
BVHTree tree,
int  type 
)
static void bvhcacheitem_free ( void *  _item) [static]

Definition at line 775 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 732 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 
)
BVHTree* bvhtree_from_mesh_faces ( BVHTreeFromMesh data,
DerivedMesh mesh,
float  epsilon,
int  tree_type,
int  axis 
)
BVHTree* bvhtree_from_mesh_verts ( BVHTreeFromMesh data,
DerivedMesh mesh,
float  epsilon,
int  tree_type,
int  axis 
)
float bvhtree_ray_tri_intersection ( const BVHTreeRay ray,
const float   UNUSEDm_dist,
const float  v0[3],
const float  v1[3],
const float  v2[3] 
)
void free_bvhtree_from_mesh ( struct BVHTreeFromMesh data)
static void mesh_edges_nearest_point ( void *  userdata,
int  index,
const float  co[3],
BVHTreeNearest nearest 
) [static]
static void mesh_faces_nearest_point ( void *  userdata,
int  index,
const float  co[3],
BVHTreeNearest nearest 
) [static]
static void mesh_faces_spherecast ( void *  userdata,
int  index,
const BVHTreeRay ray,
BVHTreeRayHit hit 
) [static]
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] 
)
static float sphereray_tri_intersection ( const BVHTreeRay ray,
float  radius,
const float  m_dist,
const float  v0[3],
const float  v1[3],
const float  v2[3] 
) [static]