diff options
Diffstat (limited to 'intern/cycles/render/object.cpp')
-rw-r--r-- | intern/cycles/render/object.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index 588b4d50e1b..4862b47c342 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -89,12 +89,9 @@ void Object::apply_transform() mesh->verts[i] = transform_point(&tfm, mesh->verts[i]); for(size_t i = 0; i < mesh->curve_keys.size(); i++) - mesh->curve_keys[i].loc = transform_point(&tfm, mesh->curve_keys[i].loc); - - for(size_t i = 0; i < mesh->curve_keysCD.size(); i++) - mesh->curve_keysCD[i].tg = transform_direction(&tfm, mesh->curve_keysCD[i].tg); - + mesh->curve_keys[i].co = transform_point(&tfm, mesh->curve_keys[i].co); + Attribute *attr_tangent = mesh->curve_attributes.find(ATTR_STD_CURVE_TANGENT); Attribute *attr_fN = mesh->attributes.find(ATTR_STD_FACE_NORMAL); Attribute *attr_vN = mesh->attributes.find(ATTR_STD_VERTEX_NORMAL); @@ -119,6 +116,13 @@ void Object::apply_transform() vN[i] = transform_direction(&ntfm, vN[i]); } + if(attr_tangent) { + float3 *tangent = attr_tangent->data_float3(); + + for(size_t i = 0; i < mesh->curve_keys.size(); i++) + tangent[i] = transform_direction(&tfm, tangent[i]); + } + if(bounds.valid()) { mesh->compute_bounds(); compute_bounds(false, 0.0f); @@ -199,10 +203,10 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene surface_area += triangle_area(p1, p2, p3); } - foreach(Mesh::CurveSeg& t, mesh->curve_segs) { - float3 p1 = mesh->curve_keys[t.v[0]].loc; + foreach(Mesh::CurveSegment& t, mesh->curve_segments) { + float3 p1 = mesh->curve_keys[t.v[0]].co; float r1 = mesh->curve_keys[t.v[0]].radius; - float3 p2 = mesh->curve_keys[t.v[1]].loc; + float3 p2 = mesh->curve_keys[t.v[1]].co; float r2 = mesh->curve_keys[t.v[1]].radius; /* currently ignores segment overlaps*/ @@ -225,10 +229,10 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene surface_area += triangle_area(p1, p2, p3); } - foreach(Mesh::CurveSeg& t, mesh->curve_segs) { - float3 p1 = mesh->curve_keys[t.v[0]].loc; + foreach(Mesh::CurveSegment& t, mesh->curve_segments) { + float3 p1 = mesh->curve_keys[t.v[0]].co; float r1 = mesh->curve_keys[t.v[0]].radius; - float3 p2 = mesh->curve_keys[t.v[1]].loc; + float3 p2 = mesh->curve_keys[t.v[1]].co; float r2 = mesh->curve_keys[t.v[1]].radius; /* currently ignores segment overlaps*/ |