Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-01-13 12:59:34 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-01-20 13:26:23 +0300
commit3b454eb92c81f50ea21eb93d5e3e3549bf9cc41b (patch)
treea447bd6ac24d26b752774fc049c1a89428400995 /intern
parentbd302ecf73169a02ba882a1de97e78fee6c01525 (diff)
Cycles: Simplify some code in Curve BVH reference fill
makes code slightly shorter and uses idea of const qualifiers.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/bvh/bvh_build.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index 66e9ecae327..036500843c7 100644
--- a/intern/cycles/bvh/bvh_build.cpp
+++ b/intern/cycles/bvh/bvh_build.cpp
@@ -156,12 +156,13 @@ void BVHBuild::add_reference_mesh(BoundBox& root, BoundBox& center, Mesh *mesh,
size_t num_curves = mesh->num_curves();
for(uint j = 0; j < num_curves; j++) {
- Mesh::Curve curve = mesh->get_curve(j);
+ const Mesh::Curve curve = mesh->get_curve(j);
PrimitiveType type = PRIMITIVE_CURVE;
+ const float *curve_radius = &mesh->curve_radius[0];
for(int k = 0; k < curve.num_keys - 1; k++) {
BoundBox bounds = BoundBox::empty;
- curve.bounds_grow(k, &mesh->curve_keys[0], &mesh->curve_radius[0], bounds);
+ curve.bounds_grow(k, &mesh->curve_keys[0], curve_radius, bounds);
/* motion curve */
if(curve_attr_mP) {
@@ -170,7 +171,7 @@ void BVHBuild::add_reference_mesh(BoundBox& root, BoundBox& center, Mesh *mesh,
const float3 *key_steps = curve_attr_mP->data_float3();
for(size_t step = 0; step < num_steps; step++) {
- curve.bounds_grow(k, key_steps + step*mesh_size, &mesh->curve_radius[0], bounds);
+ curve.bounds_grow(k, key_steps + step*mesh_size, curve_radius, bounds);
}
type = PRIMITIVE_MOTION_CURVE;