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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-11-08 15:35:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2014-11-08 15:37:42 +0300
commit7b873b06627d5c56f443d5634d6064e118657082 (patch)
tree0c85a00ba2b47b4ff3731d350154c1e36841839f /intern/cycles/subd/subd_dice.cpp
parent112032f2ff797ae60ed80d492c607f6bb5e20e38 (diff)
Add safe_normalize to cycles, avoid checking length first
This won't give any big speedup, just avoids redundant sqrtf and may be useful in future. Differential Revision: https://developer.blender.org/D880
Diffstat (limited to 'intern/cycles/subd/subd_dice.cpp')
-rw-r--r--intern/cycles/subd/subd_dice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/subd/subd_dice.cpp b/intern/cycles/subd/subd_dice.cpp
index 05ff5ca4b65..6bd18d08ba0 100644
--- a/intern/cycles/subd/subd_dice.cpp
+++ b/intern/cycles/subd/subd_dice.cpp
@@ -117,8 +117,8 @@ void EdgeDice::stitch_triangles(Patch *patch, vector<int>& outer, vector<int>& i
}
else {
/* length of diagonals */
- float len1 = len(mesh_P[inner[i]] - mesh_P[outer[j+1]]);
- float len2 = len(mesh_P[outer[j]] - mesh_P[inner[i+1]]);
+ float len1 = len_squared(mesh_P[inner[i]] - mesh_P[outer[j+1]]);
+ float len2 = len_squared(mesh_P[outer[j]] - mesh_P[inner[i+1]]);
/* use smallest diagonal */
if(len1 < len2)