Blender V2.61 - r43446
|
#include "DNA_meshdata_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_pbvh.h"
#include "BKE_DerivedMesh.h"
#include "BKE_mesh.h"
#include "BKE_global.h"
#include "GPU_buffers.h"
Go to the source code of this file.
Classes | |
struct | BB |
struct | BBC |
struct | PBVHNode |
struct | PBVH |
struct | PBVHStack |
struct | PBVHIter |
struct | node_tree |
struct | RaycastData |
Defines | |
#define | LEAF_LIMIT 10000 |
#define | STACK_FIXED_DEPTH 100 |
Typedefs | |
typedef char * | BLI_bitmap |
typedef struct PBVHStack | PBVHStack |
typedef struct PBVHIter | PBVHIter |
typedef struct node_tree | node_tree |
Functions | |
static BLI_bitmap | BLI_bitmap_new (int tot) |
static int | BLI_bitmap_get (BLI_bitmap b, int index) |
static void | BLI_bitmap_set (BLI_bitmap b, int index) |
static void | BB_reset (BB *bb) |
static void | BB_expand (BB *bb, float co[3]) |
static void | BB_expand_with_bb (BB *bb, BB *bb2) |
static int | BB_widest_axis (BB *bb) |
static void | BBC_update_centroid (BBC *bbc) |
static void | update_node_vb (PBVH *bvh, PBVHNode *node) |
static int | partition_indices (int *prim_indices, int lo, int hi, int axis, float mid, BBC *prim_bbc) |
static void | check_partitioning (int *prim_indices, int lo, int hi, int axis, float mid, BBC *prim_bbc, int index_of_2nd_partition) |
static void | grow_nodes (PBVH *bvh, int totnode) |
static int | map_insert_vert (PBVH *bvh, GHash *map, unsigned int *face_verts, unsigned int *uniq_verts, int vertex) |
static void | build_mesh_leaf_node (PBVH *bvh, PBVHNode *node) |
static void | build_grids_leaf_node (PBVH *bvh, PBVHNode *node) |
static void | build_sub (PBVH *bvh, int node_index, BB *cb, BBC *prim_bbc, int offset, int count) |
static void | pbvh_build (PBVH *bvh, BB *cb, BBC *prim_bbc, int totprim) |
void | BLI_pbvh_build_mesh (PBVH *bvh, MFace *faces, MVert *verts, int totface, int totvert) |
void | BLI_pbvh_build_grids (PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridadj, int totgrid, int gridsize, void **gridfaces) |
PBVH * | BLI_pbvh_new (void) |
void | BLI_pbvh_free (PBVH *bvh) |
static void | pbvh_iter_begin (PBVHIter *iter, PBVH *bvh, BLI_pbvh_SearchCallback scb, void *search_data) |
static void | pbvh_iter_end (PBVHIter *iter) |
static void | pbvh_stack_push (PBVHIter *iter, PBVHNode *node, int revisiting) |
static PBVHNode * | pbvh_iter_next (PBVHIter *iter) |
static PBVHNode * | pbvh_iter_next_occluded (PBVHIter *iter) |
void | BLI_pbvh_search_gather (PBVH *bvh, BLI_pbvh_SearchCallback scb, void *search_data, PBVHNode ***r_array, int *r_tot) |
void | BLI_pbvh_search_callback (PBVH *bvh, BLI_pbvh_SearchCallback scb, void *search_data, BLI_pbvh_HitCallback hcb, void *hit_data) |
static void | node_tree_insert (node_tree *tree, node_tree *new_node) |
static void | traverse_tree (node_tree *tree, BLI_pbvh_HitOccludedCallback hcb, void *hit_data, float *tmin) |
static void | free_tree (node_tree *tree) |
float | BLI_pbvh_node_get_tmin (PBVHNode *node) |
static void | BLI_pbvh_search_callback_occluded (PBVH *bvh, BLI_pbvh_SearchCallback scb, void *search_data, BLI_pbvh_HitOccludedCallback hcb, void *hit_data) |
static int | update_search_cb (PBVHNode *node, void *data_v) |
static void | pbvh_update_normals (PBVH *bvh, PBVHNode **nodes, int totnode, float(*face_nors)[3]) |
static void | pbvh_update_BB_redraw (PBVH *bvh, PBVHNode **nodes, int totnode, int flag) |
static void | pbvh_update_draw_buffers (PBVH *bvh, PBVHNode **nodes, int totnode, int smooth) |
static int | pbvh_flush_bb (PBVH *bvh, PBVHNode *node, int flag) |
void | BLI_pbvh_update (PBVH *bvh, int flag, float(*face_nors)[3]) |
void | BLI_pbvh_redraw_BB (PBVH *bvh, float bb_min[3], float bb_max[3]) |
void | BLI_pbvh_get_grid_updates (PBVH *bvh, int clear, void ***gridfaces, int *totface) |
void | BLI_pbvh_node_mark_update (PBVHNode *node) |
void | BLI_pbvh_node_get_verts (PBVH *bvh, PBVHNode *node, int **vert_indices, MVert **verts) |
void | BLI_pbvh_node_num_verts (PBVH *bvh, PBVHNode *node, int *uniquevert, int *totvert) |
void | BLI_pbvh_node_get_grids (PBVH *bvh, PBVHNode *node, int **grid_indices, int *totgrid, int *maxgrid, int *gridsize, DMGridData ***griddata, DMGridAdjacency **gridadj) |
void | BLI_pbvh_node_get_BB (PBVHNode *node, float bb_min[3], float bb_max[3]) |
void | BLI_pbvh_node_get_original_BB (PBVHNode *node, float bb_min[3], float bb_max[3]) |
void | BLI_pbvh_node_get_proxies (PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count) |
static int | ray_aabb_intersect (PBVHNode *node, void *data_v) |
void | BLI_pbvh_raycast (PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data, float ray_start[3], float ray_normal[3], int original) |
static int | ray_face_intersection (float ray_start[3], float ray_normal[3], float *t0, float *t1, float *t2, float *t3, float *fdist) |
int | BLI_pbvh_node_raycast (PBVH *bvh, PBVHNode *node, float(*origco)[3], float ray_start[3], float ray_normal[3], float *dist) |
void | BLI_pbvh_node_draw (PBVHNode *node, void *UNUSED(data)) |
int | BLI_pbvh_node_planes_contain_AABB (PBVHNode *node, void *data) |
void | BLI_pbvh_draw (PBVH *bvh, float(*planes)[4], float(*face_nors)[3], int smooth) |
void | BLI_pbvh_grids_update (PBVH *bvh, DMGridData **grids, DMGridAdjacency *gridadj, void **gridfaces) |
float(* | BLI_pbvh_get_vertCos (PBVH *pbvh))[3] |
void | BLI_pbvh_apply_vertCos (PBVH *pbvh, float(*vertCos)[3]) |
int | BLI_pbvh_isDeformed (PBVH *pbvh) |
PBVHProxyNode * | BLI_pbvh_node_add_proxy (PBVH *bvh, PBVHNode *node) |
void | BLI_pbvh_node_free_proxies (PBVHNode *node) |
void | BLI_pbvh_gather_proxies (PBVH *pbvh, PBVHNode ***r_array, int *r_tot) |
Definition in file pbvh.c.
#define LEAF_LIMIT 10000 |
Definition at line 42 of file pbvh.c.
Referenced by BLI_pbvh_build_grids(), and BLI_pbvh_build_mesh().
#define STACK_FIXED_DEPTH 100 |
Definition at line 178 of file pbvh.c.
Referenced by pbvh_iter_begin(), pbvh_iter_end(), and pbvh_stack_push().
typedef char* BLI_bitmap |
static void BB_expand | ( | BB * | bb, |
float | co[3] | ||
) | [static] |
Definition at line 204 of file pbvh.c.
References BB::bmax, BB::bmin, i, MAX2, and MIN2.
Referenced by BLI_pbvh_build_grids(), BLI_pbvh_build_mesh(), build_sub(), and update_node_vb().
Definition at line 214 of file pbvh.c.
References BB::bmax, BB::bmin, i, MAX2, and MIN2.
Referenced by BLI_pbvh_redraw_BB(), build_sub(), and update_node_vb().
static void BB_reset | ( | BB * | bb | ) | [static] |
Definition at line 197 of file pbvh.c.
References BB::bmax, BB::bmin, and FLT_MAX.
Referenced by BLI_pbvh_build_grids(), BLI_pbvh_build_mesh(), BLI_pbvh_redraw_BB(), build_sub(), and update_node_vb().
static int BB_widest_axis | ( | BB * | bb | ) | [static] |
static void BBC_update_centroid | ( | BBC * | bbc | ) | [static] |
Definition at line 246 of file pbvh.c.
References BBC::bcentroid, BBC::bmax, BBC::bmin, and i.
Referenced by BLI_pbvh_build_grids(), and BLI_pbvh_build_mesh().
static int BLI_bitmap_get | ( | BLI_bitmap | b, |
int | index | ||
) | [static] |
Definition at line 54 of file pbvh.c.
Referenced by map_insert_vert().
static BLI_bitmap BLI_bitmap_new | ( | int | tot | ) | [static] |
Definition at line 49 of file pbvh.c.
References MEM_callocN().
Referenced by BLI_pbvh_build_mesh().
static void BLI_bitmap_set | ( | BLI_bitmap | b, |
int | index | ||
) | [static] |
Definition at line 59 of file pbvh.c.
Referenced by map_insert_vert().
void BLI_pbvh_apply_vertCos | ( | PBVH * | pbvh, |
float(*) | vertCos[3] | ||
) |
Definition at line 1562 of file pbvh.c.
References BLI_pbvh_node_mark_update(), BLI_pbvh_update(), MVert::co, copy_v3_v3(), PBVH::deformed, PBVH::faces, MVert::flag, ME_VERT_PBVH_UPDATE, MEM_dupallocN(), mesh_calc_normals(), PBVH::nodes, NULL, PBVH_UpdateBB, PBVH_UpdateOriginalBB, PBVH::totnode, PBVH::totprim, PBVH::totvert, and PBVH::verts.
Referenced by cdDM_getPBVH(), sculpt_undo_restore(), and sculpt_update_mesh_elements().
void BLI_pbvh_build_grids | ( | PBVH * | bvh, |
DMGridData ** | grids, | ||
DMGridAdjacency * | gridadj, | ||
int | totgrid, | ||
int | gridsize, | ||
void ** | gridfaces | ||
) |
Definition at line 590 of file pbvh.c.
References BB_expand(), BB_reset(), BBC_update_centroid(), co, PBVH::gridadj, PBVH::gridfaces, PBVH::grids, PBVH::gridsize, i, LEAF_LIMIT, PBVH::leaf_limit, MAX2, MEM_freeN(), MEM_mallocN(), NULL, pbvh_build(), and PBVH::totgrid.
Referenced by ccgDM_getPBVH().
Definition at line 550 of file pbvh.c.
References BB_expand(), BB_reset(), BBC_update_centroid(), BLI_bitmap_new(), MVert::co, PBVH::faces, i, LEAF_LIMIT, PBVH::leaf_limit, MEM_freeN(), MEM_mallocN(), NULL, pbvh_build(), PBVH::totvert, MFace::v1, MFace::v4, PBVH::vert_bitmap, and PBVH::verts.
Referenced by ccgDM_getPBVH(), and cdDM_getPBVH().
void BLI_pbvh_draw | ( | PBVH * | bvh, |
float(*) | planes[4], | ||
float(*) | face_nors[3], | ||
int | smooth | ||
) |
Definition at line 1513 of file pbvh.c.
References BLI_pbvh_node_draw(), BLI_pbvh_node_planes_contain_AABB(), BLI_pbvh_search_callback(), BLI_pbvh_search_gather(), MEM_freeN(), nodes, NULL, pbvh_update_draw_buffers(), pbvh_update_normals(), PBVH_UpdateDrawBuffers, PBVH_UpdateNormals, SET_INT_IN_POINTER, and update_search_cb().
Referenced by ccgDM_drawFacesSolid(), and cdDM_drawFacesSolid().
void BLI_pbvh_free | ( | PBVH * | bvh | ) |
Definition at line 636 of file pbvh.c.
References PBVH::deformed, PBVHNode::draw_buffers, PBVHNode::face_vert_indices, PBVH::faces, PBVHNode::flag, GPU_free_buffers(), i, MEM_freeN(), PBVH::nodes, PBVH_Leaf, PBVH::prim_indices, PBVH::totnode, PBVHNode::vert_indices, and PBVH::verts.
Referenced by free_sculptsession(), multires_force_update(), and object_sculpt_modifiers_changed().
Definition at line 1650 of file pbvh.c.
References MEM_callocN(), MEM_freeN(), PBVH::nodes, NULL, and PBVH::totnode.
Referenced by sculpt_combine_proxies().
void BLI_pbvh_get_grid_updates | ( | PBVH * | bvh, |
int | clear, | ||
void *** | gridfaces, | ||
int * | totface | ||
) |
Definition at line 1173 of file pbvh.c.
References BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghash_size(), BLI_ghashIterator_free(), BLI_ghashIterator_getKey(), BLI_ghashIterator_isDone(), BLI_ghashIterator_new(), BLI_ghashIterator_step(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), PBVHNode::flag, PBVH::gridfaces, i, MEM_callocN(), NULL, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), PBVH_UpdateNormals, PBVHNode::prim_indices, and PBVHNode::totprim.
Referenced by ccgdm_pbvh_update(), and multires_stitch_grids().
float(* BLI_pbvh_get_vertCos | ( | PBVH * | pbvh | ) | )[3] |
Definition at line 1542 of file pbvh.c.
References co, copy_v3_v3(), MEM_callocN(), and NULL.
Referenced by sculpt_update_keyblock().
void BLI_pbvh_grids_update | ( | PBVH * | bvh, |
DMGridData ** | grids, | ||
DMGridAdjacency * | gridadj, | ||
void ** | gridfaces | ||
) |
Definition at line 1535 of file pbvh.c.
References PBVH::gridadj, PBVH::gridfaces, and PBVH::grids.
Referenced by ccgDM_getPBVH().
int BLI_pbvh_isDeformed | ( | PBVH * | pbvh | ) |
Definition at line 1599 of file pbvh.c.
References PBVH::deformed.
Referenced by sculpt_update_mesh_elements().
PBVH* BLI_pbvh_new | ( | void | ) |
Definition at line 629 of file pbvh.c.
References MEM_callocN().
Referenced by ccgDM_getPBVH(), and cdDM_getPBVH().
PBVHProxyNode* BLI_pbvh_node_add_proxy | ( | PBVH * | bvh, |
PBVHNode * | node | ||
) |
Definition at line 1605 of file pbvh.c.
References PBVHProxyNode::co, PBVH::grids, PBVH::gridsize, MEM_callocN(), MEM_mallocN(), MEM_reallocN(), PBVHNode::proxies, PBVHNode::proxy_count, PBVHNode::totprim, and PBVHNode::uniq_verts.
Referenced by do_clay_brush(), do_clay_tubes_brush(), do_crease_brush(), do_draw_brush(), do_fill_brush(), do_flatten_brush(), do_grab_brush(), do_inflate_brush(), do_nudge_brush(), do_pinch_brush(), do_rotate_brush(), do_scrape_brush(), do_snake_hook_brush(), and do_thumb_brush().
void BLI_pbvh_node_draw | ( | PBVHNode * | node, |
void * | UNUSEDdata | ||
) |
Definition at line 1460 of file pbvh.c.
References PBVHNode::draw_buffers, GPU_draw_buffers(), and i.
void BLI_pbvh_node_free_proxies | ( | PBVHNode * | node | ) |
Definition at line 1632 of file pbvh.c.
References PBVHProxyNode::co, MEM_freeN(), p, PBVHNode::proxies, and PBVHNode::proxy_count.
Referenced by sculpt_combine_proxies().
void BLI_pbvh_node_get_BB | ( | PBVHNode * | node, |
float | bb_min[3], | ||
float | bb_max[3] | ||
) |
Definition at line 1271 of file pbvh.c.
References BB::bmax, BB::bmin, copy_v3_v3(), and PBVHNode::vb.
Referenced by BLI_pbvh_node_planes_contain_AABB(), ray_aabb_intersect(), and sculpt_search_sphere_cb().
void BLI_pbvh_node_get_grids | ( | PBVH * | bvh, |
PBVHNode * | node, | ||
int ** | grid_indices, | ||
int * | totgrid, | ||
int * | maxgrid, | ||
int * | gridsize, | ||
DMGridData *** | griddata, | ||
DMGridAdjacency ** | gridadj | ||
) |
Definition at line 1251 of file pbvh.c.
References PBVH::gridadj, PBVH::grids, PBVH::gridsize, NULL, PBVHNode::prim_indices, PBVH::totgrid, and PBVHNode::totprim.
Referenced by do_multires_smooth_brush(), and sculpt_undo_push_node().
void BLI_pbvh_node_get_original_BB | ( | PBVHNode * | node, |
float | bb_min[3], | ||
float | bb_max[3] | ||
) |
Definition at line 1277 of file pbvh.c.
References BB::bmax, BB::bmin, copy_v3_v3(), and PBVHNode::orig_vb.
Referenced by ray_aabb_intersect(), and sculpt_search_sphere_cb().
void BLI_pbvh_node_get_proxies | ( | PBVHNode * | node, |
PBVHProxyNode ** | proxies, | ||
int * | proxy_count | ||
) |
Definition at line 1283 of file pbvh.c.
References PBVHNode::proxies, and PBVHNode::proxy_count.
Referenced by sculpt_combine_proxies().
float BLI_pbvh_node_get_tmin | ( | PBVHNode * | node | ) |
Definition at line 892 of file pbvh.c.
References PBVHNode::tmin.
Referenced by sculpt_raycast_cb().
Definition at line 1232 of file pbvh.c.
References PBVHNode::vert_indices, and PBVH::verts.
void BLI_pbvh_node_mark_update | ( | PBVHNode * | node | ) |
Definition at line 1227 of file pbvh.c.
References PBVHNode::flag, PBVH_UpdateBB, PBVH_UpdateDrawBuffers, PBVH_UpdateNormals, PBVH_UpdateOriginalBB, and PBVH_UpdateRedraw.
Referenced by BLI_pbvh_apply_vertCos(), do_brush_action(), object_sculpt_modifiers_changed(), sculpt_restore_mesh(), and update_cb().
Definition at line 1238 of file pbvh.c.
References PBVHNode::face_verts, PBVH::grids, PBVH::gridsize, PBVHNode::totprim, and PBVHNode::uniq_verts.
Referenced by sculpt_undo_push_node().
int BLI_pbvh_node_planes_contain_AABB | ( | PBVHNode * | node, |
void * | data | ||
) |
Definition at line 1486 of file pbvh.c.
References BLI_pbvh_node_get_BB(), data, dot_v3v3(), and i.
Referenced by BLI_pbvh_draw().
int BLI_pbvh_node_raycast | ( | PBVH * | bvh, |
PBVHNode * | node, | ||
float(*) | origco[3], | ||
float | ray_start[3], | ||
float | ray_normal[3], | ||
float * | dist | ||
) |
Definition at line 1384 of file pbvh.c.
References co, MVert::co, PBVHNode::face_vert_indices, PBVH::faces, PBVH::grids, PBVH::gridsize, i, NULL, PBVHNode::prim_indices, ray_face_intersection(), PBVHNode::totprim, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and PBVH::verts.
Referenced by sculpt_raycast_cb().
void BLI_pbvh_raycast | ( | PBVH * | bvh, |
BLI_pbvh_HitOccludedCallback | cb, | ||
void * | data, | ||
float | ray_start[3], | ||
float | ray_normal[3], | ||
int | original | ||
) |
Definition at line 1350 of file pbvh.c.
References BLI_pbvh_search_callback_occluded(), copy_v3_v3(), RaycastData::inv_dir, RaycastData::original, ray_aabb_intersect(), RaycastData::sign, and RaycastData::start.
Referenced by sculpt_stroke_get_location().
void BLI_pbvh_redraw_BB | ( | PBVH * | bvh, |
float | bb_min[3], | ||
float | bb_max[3] | ||
) |
Definition at line 1153 of file pbvh.c.
References BB_expand_with_bb(), BB_reset(), BB::bmax, BB::bmin, copy_v3_v3(), PBVHNode::flag, NULL, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), PBVH_UpdateRedraw, and PBVHNode::vb.
Referenced by sculpt_get_redraw_rect().
void BLI_pbvh_search_callback | ( | PBVH * | bvh, |
BLI_pbvh_SearchCallback | scb, | ||
void * | search_data, | ||
BLI_pbvh_HitCallback | hcb, | ||
void * | hit_data | ||
) |
Definition at line 825 of file pbvh.c.
References PBVHNode::flag, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), and PBVH_Leaf.
Referenced by BLI_pbvh_draw(), and sculpt_undo_restore().
static void BLI_pbvh_search_callback_occluded | ( | PBVH * | bvh, |
BLI_pbvh_SearchCallback | scb, | ||
void * | search_data, | ||
BLI_pbvh_HitOccludedCallback | hcb, | ||
void * | hit_data | ||
) | [static] |
Definition at line 897 of file pbvh.c.
References node_tree::data, PBVHNode::flag, FLT_MAX, free_tree(), node_tree::left, node_tree_insert(), NULL, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next_occluded(), PBVH_Leaf, node_tree::right, and traverse_tree().
Referenced by BLI_pbvh_raycast().
void BLI_pbvh_search_gather | ( | PBVH * | bvh, |
BLI_pbvh_SearchCallback | scb, | ||
void * | search_data, | ||
PBVHNode *** | r_array, | ||
int * | r_tot | ||
) |
Definition at line 784 of file pbvh.c.
References MEM_callocN(), MEM_freeN(), NULL, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), and PBVH_Leaf.
Referenced by BLI_pbvh_draw(), BLI_pbvh_update(), do_brush_action(), object_sculpt_modifiers_changed(), sculpt_flush_stroke_deform(), and sculpt_restore_mesh().
void BLI_pbvh_update | ( | PBVH * | bvh, |
int | flag, | ||
float(*) | face_nors[3] | ||
) |
Definition at line 1130 of file pbvh.c.
References BLI_pbvh_search_gather(), MEM_freeN(), PBVH::nodes, nodes, pbvh_flush_bb(), pbvh_update_BB_redraw(), pbvh_update_normals(), PBVH_UpdateBB, PBVH_UpdateNormals, PBVH_UpdateOriginalBB, PBVH_UpdateRedraw, SET_INT_IN_POINTER, and update_search_cb().
Referenced by BLI_pbvh_apply_vertCos(), cdDM_update_normals_from_pbvh(), sculpt_flush_update(), sculpt_get_redraw_planes(), sculpt_stroke_done(), and sculpt_undo_restore().
Definition at line 435 of file pbvh.c.
References PBVHNode::draw_buffers, PBVHNode::flag, G, GPU_build_grid_buffers(), PBVH::grids, PBVH::gridsize, PBVH_UpdateDrawBuffers, PBVHNode::prim_indices, and PBVHNode::totprim.
Referenced by build_sub().
Definition at line 364 of file pbvh.c.
References BLI_ghash_free(), BLI_ghash_new(), BLI_ghashIterator_free(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_ghashIterator_isDone(), BLI_ghashIterator_new(), BLI_ghashIterator_step(), BLI_ghashutil_intcmp(), BLI_ghashutil_inthash(), PBVHNode::draw_buffers, PBVHNode::face_vert_indices, PBVHNode::face_verts, PBVH::faces, PBVHNode::flag, G, GET_INT_FROM_POINTER, GPU_build_mesh_buffers(), i, map_insert_vert(), MEM_callocN(), NULL, PBVH_UpdateDrawBuffers, PBVHNode::prim_indices, PBVHNode::totprim, PBVHNode::uniq_verts, MFace::v1, MFace::v4, PBVHNode::vert_indices, and PBVH::verts.
Referenced by build_sub().
static void build_sub | ( | PBVH * | bvh, |
int | node_index, | ||
BB * | cb, | ||
BBC * | prim_bbc, | ||
int | offset, | ||
int | count | ||
) | [static] |
Definition at line 456 of file pbvh.c.
References BB_expand(), BB_expand_with_bb(), BB_reset(), BB_widest_axis(), BBC::bcentroid, BB::bmax, BB::bmin, build_grids_leaf_node(), build_mesh_leaf_node(), check_partitioning(), PBVHNode::children_offset, PBVH::faces, PBVHNode::flag, grow_nodes(), i, PBVH::nodes, NULL, PBVHNode::orig_vb, partition_indices(), PBVH_Leaf, PBVHNode::prim_indices, PBVH::prim_indices, PBVH::totnode, PBVHNode::totprim, and PBVHNode::vb.
Referenced by pbvh_build().
static void check_partitioning | ( | int * | prim_indices, |
int | lo, | ||
int | hi, | ||
int | axis, | ||
float | mid, | ||
BBC * | prim_bbc, | ||
int | index_of_2nd_partition | ||
) | [static] |
static void free_tree | ( | node_tree * | tree | ) | [static] |
Definition at line 877 of file pbvh.c.
References addon::engine::free(), node_tree::left, and node_tree::right.
Referenced by BLI_pbvh_search_callback_occluded().
static void grow_nodes | ( | PBVH * | bvh, |
int | totnode | ||
) | [static] |
Definition at line 321 of file pbvh.c.
References MEM_callocN(), MEM_freeN(), PBVH::node_mem_count, PBVH::nodes, and PBVH::totnode.
Referenced by build_sub().
static int map_insert_vert | ( | PBVH * | bvh, |
GHash * | map, | ||
unsigned int * | face_verts, | ||
unsigned int * | uniq_verts, | ||
int | vertex | ||
) | [static] |
Definition at line 339 of file pbvh.c.
References BLI_bitmap_get(), BLI_bitmap_set(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_lookup(), GET_INT_FROM_POINTER, SET_INT_IN_POINTER, and PBVH::vert_bitmap.
Referenced by build_mesh_leaf_node().
Definition at line 848 of file pbvh.c.
References node_tree::data, node_tree::left, node_tree::right, and PBVHNode::tmin.
Referenced by BLI_pbvh_search_callback_occluded().
static int partition_indices | ( | int * | prim_indices, |
int | lo, | ||
int | hi, | ||
int | axis, | ||
float | mid, | ||
BBC * | prim_bbc | ||
) | [static] |
Definition at line 291 of file pbvh.c.
References BBC::bcentroid, i, and SWAP.
Referenced by build_sub().
Definition at line 524 of file pbvh.c.
References build_sub(), i, MEM_callocN(), MEM_freeN(), PBVH::node_mem_count, PBVH::nodes, PBVH::prim_indices, PBVH::totnode, and PBVH::totprim.
Referenced by BLI_pbvh_build_grids(), and BLI_pbvh_build_mesh().
Definition at line 1099 of file pbvh.c.
References PBVHNode::children_offset, PBVHNode::flag, PBVH::nodes, PBVHNode::orig_vb, PBVH_Leaf, PBVH_UpdateBB, PBVH_UpdateOriginalBB, update(), update_node_vb(), and PBVHNode::vb.
Referenced by BLI_pbvh_update().
static void pbvh_iter_begin | ( | PBVHIter * | iter, |
PBVH * | bvh, | ||
BLI_pbvh_SearchCallback | scb, | ||
void * | search_data | ||
) | [static] |
Definition at line 673 of file pbvh.c.
References PBVHIter::bvh, PBVHStack::node, PBVH::nodes, PBVHStack::revisiting, PBVHIter::scb, PBVHIter::search_data, PBVHIter::stack, STACK_FIXED_DEPTH, PBVHIter::stackfixed, PBVHIter::stacksize, and PBVHIter::stackspace.
Referenced by BLI_pbvh_get_grid_updates(), BLI_pbvh_redraw_BB(), BLI_pbvh_search_callback(), BLI_pbvh_search_callback_occluded(), and BLI_pbvh_search_gather().
static void pbvh_iter_end | ( | PBVHIter * | iter | ) | [static] |
Definition at line 687 of file pbvh.c.
References MEM_freeN(), PBVHIter::stack, STACK_FIXED_DEPTH, and PBVHIter::stackspace.
Referenced by BLI_pbvh_get_grid_updates(), BLI_pbvh_redraw_BB(), BLI_pbvh_search_callback(), BLI_pbvh_search_callback_occluded(), and BLI_pbvh_search_gather().
Definition at line 712 of file pbvh.c.
References PBVHIter::bvh, PBVHNode::children_offset, PBVHNode::flag, PBVHStack::node, PBVH::nodes, NULL, PBVH_Leaf, pbvh_stack_push(), PBVHStack::revisiting, PBVHIter::scb, PBVHIter::search_data, PBVHIter::stack, and PBVHIter::stacksize.
Referenced by BLI_pbvh_get_grid_updates(), BLI_pbvh_redraw_BB(), BLI_pbvh_search_callback(), and BLI_pbvh_search_gather().
Definition at line 756 of file pbvh.c.
References PBVHIter::bvh, PBVHNode::children_offset, PBVHNode::flag, PBVHStack::node, PBVH::nodes, NULL, PBVH_Leaf, pbvh_stack_push(), PBVHIter::scb, PBVHIter::search_data, PBVHIter::stack, and PBVHIter::stacksize.
Referenced by BLI_pbvh_search_callback_occluded().
Definition at line 693 of file pbvh.c.
References MEM_callocN(), MEM_freeN(), PBVHStack::node, PBVHStack::revisiting, PBVHIter::stack, STACK_FIXED_DEPTH, PBVHIter::stacksize, and PBVHIter::stackspace.
Referenced by pbvh_iter_next(), and pbvh_iter_next_occluded().
Definition at line 1046 of file pbvh.c.
References PBVHNode::flag, PBVHNode::orig_vb, PBVH_UpdateBB, PBVH_UpdateOriginalBB, PBVH_UpdateRedraw, update_node_vb(), and PBVHNode::vb.
Referenced by BLI_pbvh_update().
static void pbvh_update_draw_buffers | ( | PBVH * | bvh, |
PBVHNode ** | nodes, | ||
int | totnode, | ||
int | smooth | ||
) | [static] |
Definition at line 1068 of file pbvh.c.
References PBVHNode::draw_buffers, PBVHNode::face_verts, PBVHNode::flag, GPU_update_grid_buffers(), GPU_update_mesh_buffers(), PBVH::grids, PBVH::gridsize, PBVH_UpdateDrawBuffers, PBVHNode::prim_indices, PBVHNode::totprim, PBVHNode::uniq_verts, PBVHNode::vert_indices, and PBVH::verts.
Referenced by BLI_pbvh_draw().
static void pbvh_update_normals | ( | PBVH * | bvh, |
PBVHNode ** | nodes, | ||
int | totnode, | ||
float(*) | face_nors[3] | ||
) | [static] |
Definition at line 944 of file pbvh.c.
References MVert::co, copy_v3_v3(), PBVH::faces, MVert::flag, PBVHNode::flag, PBVH::grids, i, ME_VERT_PBVH_UPDATE, MEM_callocN(), MEM_freeN(), MVert::no, normal_quad_v3(), normal_tri_v3(), normalize_v3(), PBVH_UpdateNormals, PBVHNode::prim_indices, PBVHNode::totprim, PBVH::totvert, PBVHNode::uniq_verts, MFace::v1, MFace::v2, MFace::v3, MFace::v4, PBVHNode::vert_indices, and PBVH::verts.
Referenced by BLI_pbvh_draw(), and BLI_pbvh_update().
static int ray_aabb_intersect | ( | PBVHNode * | node, |
void * | data_v | ||
) | [static] |
Definition at line 1306 of file pbvh.c.
References BLI_pbvh_node_get_BB(), BLI_pbvh_node_get_original_BB(), RaycastData::inv_dir, RaycastData::original, RaycastData::sign, RaycastData::start, and PBVHNode::tmin.
Referenced by BLI_pbvh_raycast().
static int ray_face_intersection | ( | float | ray_start[3], |
float | ray_normal[3], | ||
float * | t0, | ||
float * | t1, | ||
float * | t2, | ||
float * | t3, | ||
float * | fdist | ||
) | [static] |
Definition at line 1367 of file pbvh.c.
References isect_ray_tri_epsilon_v3(), and NULL.
Referenced by BLI_pbvh_node_raycast().
static void traverse_tree | ( | node_tree * | tree, |
BLI_pbvh_HitOccludedCallback | hcb, | ||
void * | hit_data, | ||
float * | tmin | ||
) | [static] |
Definition at line 868 of file pbvh.c.
References node_tree::data, node_tree::left, and node_tree::right.
Referenced by BLI_pbvh_search_callback_occluded().
Definition at line 254 of file pbvh.c.
References BB_expand(), BB_expand_with_bb(), BB_reset(), BLI_pbvh_vertex_iter_begin, BLI_pbvh_vertex_iter_end, PBVHNode::children_offset, PBVHVertexIter::co, PBVHNode::flag, PBVH::nodes, PBVH_ITER_ALL, PBVH_Leaf, and PBVHNode::vb.
Referenced by pbvh_flush_bb(), and pbvh_update_BB_redraw().
static int update_search_cb | ( | PBVHNode * | node, |
void * | data_v | ||
) | [static] |
Definition at line 934 of file pbvh.c.
References PBVHNode::flag, GET_INT_FROM_POINTER, and PBVH_Leaf.
Referenced by BLI_pbvh_draw(), and BLI_pbvh_update().