From 248b2fc6d6f929ee5f8e5f5ad2ee073a9a995998 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Oct 2012 15:20:53 +0000 Subject: bmesh-decimator update - update face normals when triangulating. - avoid divide by zero when interpolating customdata on a zero length edge. - replace zero float comparisons with fabsf() < FLT_EPSILON to avoid numeric error. also renamed BLI_heap_empty() --> BLI_heap_is_empty() so its obviously readonly function. --- source/blender/blenlib/BLI_heap.h | 5 ++--- source/blender/blenlib/intern/BLI_heap.c | 2 +- source/blender/blenlib/intern/quadric.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h index 9d7e6107f19..adbbf266b4e 100644 --- a/source/blender/blenlib/BLI_heap.h +++ b/source/blender/blenlib/BLI_heap.h @@ -54,7 +54,7 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr); void BLI_heap_remove(Heap *heap, HeapNode *node); /* Return 0 if the heap is empty, 1 otherwise. */ -int BLI_heap_empty(Heap *heap); +int BLI_heap_is_empty(Heap *heap); /* Return the size of the heap. */ int BLI_heap_size(Heap *heap); @@ -69,5 +69,4 @@ void *BLI_heap_popmin(Heap *heap); float BLI_heap_node_value(HeapNode *heap); void *BLI_heap_node_ptr(HeapNode *heap); -#endif - +#endif /* __BLI_HEAP_H__ */ diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 5e0762a5d68..5a33e998561 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -165,7 +165,7 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr) return node; } -int BLI_heap_empty(Heap *heap) +int BLI_heap_is_empty(Heap *heap) { return (heap->size == 0); } diff --git a/source/blender/blenlib/intern/quadric.c b/source/blender/blenlib/intern/quadric.c index 1c04beacbfb..bb39cb61e78 100644 --- a/source/blender/blenlib/intern/quadric.c +++ b/source/blender/blenlib/intern/quadric.c @@ -117,7 +117,7 @@ int BLI_quadric_optimize(const Quadric *q, float v[3]) m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2]); - if (det != 0.0f) { + if (fabsf(det) > FLT_EPSILON) { invert_m3(m); BLI_quadric_to_vector_v3(q, v); mul_m3_v3(m, v); -- cgit v1.2.3