diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-05-20 16:28:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-05-20 17:00:13 +0300 |
commit | 24e1d7f4f4aba8e94effd6aec4a3d7d8308d4015 (patch) | |
tree | 537ce4973f8a01065ac78696830400c8d9136762 /source/blender/blenlib | |
parent | 8edfcf653a97628504de893b0d9b091783d136fc (diff) |
BMesh: decimate wasn't using face/edge centers
When calculating quadrics, using the first-vertex isn't correct.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_quadric.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/quadric.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_quadric.h b/source/blender/blenlib/BLI_quadric.h index 82c39463dd2..251469ab88f 100644 --- a/source/blender/blenlib/BLI_quadric.h +++ b/source/blender/blenlib/BLI_quadric.h @@ -38,7 +38,7 @@ typedef struct Quadric { } Quadric; /* conversion */ -void BLI_quadric_from_v3_dist(Quadric *q, const float v[3], const float offset); +void BLI_quadric_from_plane(Quadric *q, const float v[4]); void BLI_quadric_to_tensor_m3(const Quadric *q, float m[3][3]); void BLI_quadric_to_vector_v3(const Quadric *q, float v[3]); diff --git a/source/blender/blenlib/intern/quadric.c b/source/blender/blenlib/intern/quadric.c index 814d05ca80e..4aa0cdd509d 100644 --- a/source/blender/blenlib/intern/quadric.c +++ b/source/blender/blenlib/intern/quadric.c @@ -42,7 +42,7 @@ #define QUADRIC_FLT_TOT (sizeof(Quadric) / sizeof(float)) -void BLI_quadric_from_v3_dist(Quadric *q, const float v[3], const float offset) +void BLI_quadric_from_plane(Quadric *q, const float v[4]) { q->a2 = v[0] * v[0]; q->b2 = v[1] * v[1]; @@ -52,11 +52,11 @@ void BLI_quadric_from_v3_dist(Quadric *q, const float v[3], const float offset) q->ac = v[0] * v[2]; q->bc = v[1] * v[2]; - q->ad = v[0] * offset; - q->bd = v[1] * offset; - q->cd = v[2] * offset; + q->ad = v[0] * v[3]; + q->bd = v[1] * v[3]; + q->cd = v[2] * v[3]; - q->d2 = offset * offset; + q->d2 = v[3] * v[3]; } void BLI_quadric_to_tensor_m3(const Quadric *q, float m[3][3]) |