diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-02-03 20:40:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-02-03 20:40:21 +0300 |
commit | 5f056fb742fcc79df74d74911369e6b473ec10f0 (patch) | |
tree | da59398448e3e46f0ff121d035c251a3588743d9 /intern | |
parent | 85776521f8d3e49abddfa35ae36c5074a88d8936 (diff) | |
parent | 3d6e7cd67c2dac8acbce585efed2fa34341f2676 (diff) |
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index 4dba8ffbe0e..78db1d5c832 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -173,19 +173,20 @@ static bool ObtainCacheParticleData( CData->curve_firstkey.push_back_slow(keyno); float curve_length = 0.0f; - float3 pcKey; + float3 prev_co_world = make_float3(0.0f, 0.0f, 0.0f); + float3 prev_co_object = make_float3(0.0f, 0.0f, 0.0f); for (int step_no = 0; step_no < ren_step; step_no++) { - float nco[3]; - b_psys.co_hair(*b_ob, pa_no, step_no, nco); - float3 cKey = make_float3(nco[0], nco[1], nco[2]); - cKey = transform_point(&itfm, cKey); + float3 co_world = prev_co_world; + b_psys.co_hair(*b_ob, pa_no, step_no, &co_world.x); + float3 co_object = transform_point(&itfm, co_world); if (step_no > 0) { - const float step_length = len(cKey - pcKey); + const float step_length = len(co_object - prev_co_object); curve_length += step_length; } - CData->curvekey_co.push_back_slow(cKey); + CData->curvekey_co.push_back_slow(co_object); CData->curvekey_time.push_back_slow(curve_length); - pcKey = cKey; + prev_co_object = co_object; + prev_co_world = co_world; keynum++; } keyno += keynum; |