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>2020-05-06 08:38:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-06 08:38:32 +0300
commit6fe3bbed3438e6dc4f4cf3e45b4c0628b8f70bc9 (patch)
tree2f03dcfdc1cf5fff52c92ce736d6890682c849f8 /source/blender/blenlib
parent61d35c06a1e97ce2c9e99b8fcfd99560300002a4 (diff)
Cleanup: restore text alignment lost by clang-format
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/quadric.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/quadric.c b/source/blender/blenlib/intern/quadric.c
index 0a1ff9f8116..fc238966651 100644
--- a/source/blender/blenlib/intern/quadric.c
+++ b/source/blender/blenlib/intern/quadric.c
@@ -141,9 +141,14 @@ void BLI_quadric_mul(Quadric *a, const double scalar)
double BLI_quadric_evaluate(const Quadric *q, const double v[3])
{
- return ((q->a2 * v[0] * v[0]) + (q->ab * 2 * v[0] * v[1]) + (q->ac * 2 * v[0] * v[2]) +
- (q->ad * 2 * v[0]) + (q->b2 * v[1] * v[1]) + (q->bc * 2 * v[1] * v[2]) +
- (q->bd * 2 * v[1]) + (q->c2 * v[2] * v[2]) + (q->cd * 2 * v[2]) + (q->d2));
+ const double v00 = v[0] * v[0], v01 = v[0] * v[1], v02 = v[0] * v[2];
+ const double v11 = v[1] * v[1], v12 = v[1] * v[2];
+ const double v22 = v[1] * v[2];
+ return ((q->a2 * v00) + (q->ab * 2 * v01) + (q->ac * 2 * v02) + (q->ad * 2 * v[0]) + /* a */
+ (q->b2 * v11) + (q->bc * 2 * v12) + (q->bd * 2 * v[1]) + /* b */
+ (q->c2 * v22) + (q->cd * 2 * v[2]) + /* c */
+ (q->d2) /* d */
+ );
}
bool BLI_quadric_optimize(const Quadric *q, double v[3], const double epsilon)