[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59221] branches/soc-2013-cycles_mblur/ intern/cycles/render/mesh.cpp: Added code to take into account all of the export steps in the mesh's
Gavin Howard
gavin.d.howard at gmail.com
Sun Aug 18 02:13:51 CEST 2013
Revision: 59221
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59221
Author: gdh
Date: 2013-08-18 00:13:51 +0000 (Sun, 18 Aug 2013)
Log Message:
-----------
Added code to take into account all of the export steps in the mesh's
BoundBox.
Modified Paths:
--------------
branches/soc-2013-cycles_mblur/intern/cycles/render/mesh.cpp
Modified: branches/soc-2013-cycles_mblur/intern/cycles/render/mesh.cpp
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/render/mesh.cpp 2013-08-17 21:24:46 UTC (rev 59220)
+++ branches/soc-2013-cycles_mblur/intern/cycles/render/mesh.cpp 2013-08-18 00:13:51 UTC (rev 59221)
@@ -154,6 +154,15 @@
for(size_t i = 0; i < curve_keys_size; i++)
bnds.grow(curve_keys[i].co, curve_keys[i].radius);
+
+ Attribute *attr = attributes.find(ATTR_STD_DMOTION);
+ if (attr) {
+ size_t steps_size = verts.size() * (mblur_steps - 1);
+ float3 *vert_steps = attr->data_float3();
+
+ for (size_t i = 0; i < steps_size; i++)
+ bnds.grow(vert_steps[i]);
+ }
if(!bnds.valid()) {
bnds = BoundBox::empty;
@@ -164,6 +173,14 @@
for(size_t i = 0; i < curve_keys_size; i++)
bnds.grow_safe(curve_keys[i].co, curve_keys[i].radius);
+
+ if (attr) {
+ size_t steps_size = verts.size() * (mblur_steps - 1);
+ float3 *vert_steps = attr->data_float3();
+
+ for (size_t i = 0; i < steps_size; i++)
+ bnds.grow_safe(vert_steps[i]);
+ }
}
}
@@ -173,6 +190,9 @@
}
bounds = bnds;
+
+ cout << "Bounds min: " << bounds.min.x << "," << bounds.min.y << "," << bounds.min.z;
+ cout << "\nBounds max: " << bounds.max.x << "," << bounds.max.y << "," << bounds.max.z << endl;
}
void Mesh::add_face_normals()
More information about the Bf-blender-cvs
mailing list