[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38249] branches/soc-2011-onion/source/ blender/blenlib: renamed 'original' in pbvh ray casting operations to ' use_orig_bb' to be more clear that it is original bounding boxes that are being used.

Jason Wilkins Jason.A.Wilkins at gmail.com
Sat Jul 9 10:16:06 CEST 2011


Revision: 38249
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38249
Author:   jwilkins
Date:     2011-07-09 08:16:05 +0000 (Sat, 09 Jul 2011)
Log Message:
-----------
renamed 'original' in pbvh ray casting operations to 'use_orig_bb' to be more clear that it is original bounding boxes that are being used.  

pbvh keeps two sets of bounding boxes and the 'original' set is meant to be used when the user's ray casting callback is testing a saved copy of the original vertex coordinates.  This change just makes it more clear that the pbvh does not store the original vertex coordinates itself

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/blenlib/BLI_pbvh.h
    branches/soc-2011-onion/source/blender/blenlib/intern/pbvh.c

Modified: branches/soc-2011-onion/source/blender/blenlib/BLI_pbvh.h
===================================================================
--- branches/soc-2011-onion/source/blender/blenlib/BLI_pbvh.h	2011-07-09 07:12:30 UTC (rev 38248)
+++ branches/soc-2011-onion/source/blender/blenlib/BLI_pbvh.h	2011-07-09 08:16:05 UTC (rev 38249)
@@ -69,10 +69,10 @@
 typedef void (*BLI_pbvh_HitOccludedCallback)(PBVHNode *node, void *data, float* tmin);
 
 /* test AABB against sphere */
-typedef struct {
+typedef struct PBVHSearchSphereData {
 	const float *center;
 	float radius_squared;
-	int original;
+	int use_orig_bb;
 } PBVHSearchSphereData;
 int BLI_pbvh_search_sphere_cb(PBVHNode *node, void *data);
 
@@ -107,7 +107,7 @@
    hit first */
 
 void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
-			  float ray_start[3], float ray_normal[3], int original);
+			  float ray_start[3], float ray_normal[3], int use_orig_bb);
 int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3],
 	float ray_start[3], float ray_normal[3], float *dist,
 	int *hit_index, int *grid_hit_index);

Modified: branches/soc-2011-onion/source/blender/blenlib/intern/pbvh.c
===================================================================
--- branches/soc-2011-onion/source/blender/blenlib/intern/pbvh.c	2011-07-09 07:12:30 UTC (rev 38248)
+++ branches/soc-2011-onion/source/blender/blenlib/intern/pbvh.c	2011-07-09 08:16:05 UTC (rev 38249)
@@ -183,7 +183,7 @@
 	float t[3], bb_min[3], bb_max[3];
 	int i;
 
-	if(data->original)
+	if(data->use_orig_bb)
 		BLI_pbvh_node_get_original_BB(node, bb_min, bb_max);
 	else
 		BLI_pbvh_node_get_BB(node, bb_min, bb_max);
@@ -1435,7 +1435,7 @@
 	float start[3];
 	int sign[3];
 	float inv_dir[3];
-	int original;
+	int use_orig_bb;
 } RaycastData;
 
 /* Adapted from here: http://www.gamedev.net/community/forums/topic.asp?topic_id=459973 */
@@ -1445,7 +1445,7 @@
 	float bbox[2][3];
 	float tmin, tmax, tymin, tymax, tzmin, tzmax;
 
-	if(ray->original)
+	if(ray->use_orig_bb)
 		BLI_pbvh_node_get_original_BB(node, bbox[0], bbox[1]);
 	else
 		BLI_pbvh_node_get_BB(node, bbox[0], bbox[1]);
@@ -1484,7 +1484,7 @@
 }
 
 void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
-			  float ray_start[3], float ray_normal[3], int original)
+			  float ray_start[3], float ray_normal[3], int use_orig_bb)
 {
 	RaycastData rcd;
 
@@ -1495,7 +1495,7 @@
 	rcd.sign[0] = rcd.inv_dir[0] < 0;
 	rcd.sign[1] = rcd.inv_dir[1] < 0;
 	rcd.sign[2] = rcd.inv_dir[2] < 0;
-	rcd.original = original;
+	rcd.use_orig_bb = use_orig_bb;
 
 	BLI_pbvh_search_callback_occluded(bvh, ray_aabb_intersect, &rcd, cb, data);
 }
@@ -1825,7 +1825,7 @@
 {
 	PBVHSearchSphereData data;
 
-	data.original= 0;
+	data.use_orig_bb= 0;
 	data.center= center;
 	data.radius_squared= radius*radius;
 




More information about the Bf-blender-cvs mailing list