[Bf-blender-cvs] [06c1e78] master: Dyntopo: avoid redundant vector copy

Campbell Barton noreply at git.blender.org
Tue Jul 5 19:47:15 CEST 2016


Commit: 06c1e782b0269e61dfbce3ae3665f959eb2759c2
Author: Campbell Barton
Date:   Tue Jul 5 18:55:06 2016 +1000
Branches: master
https://developer.blender.org/rB06c1e782b0269e61dfbce3ae3665f959eb2759c2

Dyntopo: avoid redundant vector copy

===================================================================

M	source/blender/blenkernel/intern/pbvh.c

===================================================================

diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 58ec75d..6b6d1b4 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -1496,12 +1496,18 @@ typedef struct {
 static bool ray_aabb_intersect(PBVHNode *node, void *data_v)
 {
 	RaycastData *rcd = data_v;
-	float bb_min[3], bb_max[3];
+	const float *bb_min, *bb_max;
 
-	if (rcd->original)
-		BKE_pbvh_node_get_original_BB(node, bb_min, bb_max);
-	else
-		BKE_pbvh_node_get_BB(node, bb_min, bb_max);
+	if (rcd->original) {
+		/* BKE_pbvh_node_get_original_BB */
+		bb_min = node->orig_vb.bmin;
+		bb_max = node->orig_vb.bmax;
+	}
+	else {
+		/* BKE_pbvh_node_get_BB */
+		bb_min = node->vb.bmin;
+		bb_max = node->vb.bmax;
+	}
 
 	return isect_ray_aabb_v3(&rcd->ray, bb_min, bb_max, &node->tmin);
 }
@@ -1801,17 +1807,21 @@ static PlaneAABBIsect test_planes_aabb(const float bb_min[3],
 
 bool BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
 {
-	float bb_min[3], bb_max[3];
+	const float *bb_min, *bb_max;
+	/* BKE_pbvh_node_get_BB */
+	bb_min = node->vb.bmin;
+	bb_max = node->vb.bmax;
 	
-	BKE_pbvh_node_get_BB(node, bb_min, bb_max);
 	return test_planes_aabb(bb_min, bb_max, data) != ISECT_OUTSIDE;
 }
 
 bool BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data)
 {
-	float bb_min[3], bb_max[3];
+	const float *bb_min, *bb_max;
+	/* BKE_pbvh_node_get_BB */
+	bb_min = node->vb.bmin;
+	bb_max = node->vb.bmax;
 	
-	BKE_pbvh_node_get_BB(node, bb_min, bb_max);
 	return test_planes_aabb(bb_min, bb_max, data) != ISECT_INSIDE;
 }




More information about the Bf-blender-cvs mailing list