diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-10 10:52:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-10 10:55:03 +0300 |
commit | 0feeea1bd5fa6833bb9fc300db7b715ae5d94148 (patch) | |
tree | 34db87d75164741ece9f7c4a52143f5a8168d54c /source/blender/bmesh/intern/bmesh_polygon.h | |
parent | dc21ef7b86ca612e1ad7b5a64e1fdb474bd6bbe6 (diff) |
BMesh: avoid incorrect/invalid matrix calculation
- `BKE_object_scale_to_mat3` was used to get the worldspace scale,
without taking constraints, parenting etc into account.
- Don't pass object's into BMesh API, (prefer matrices instead).
- Avoid matrix invert for each edge-angle calculation.
- Avoid 2x matrix multiplies when looping over edge pairs.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_polygon.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.h b/source/blender/bmesh/intern/bmesh_polygon.h index 29bb49a8e40..2edfdaa8c03 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.h +++ b/source/blender/bmesh/intern/bmesh_polygon.h @@ -28,7 +28,6 @@ */ struct Heap; -struct Object; #include "BLI_compiler_attrs.h" @@ -45,9 +44,9 @@ float BM_face_calc_normal_vcos( float const (*vertexCos)[3]) ATTR_NONNULL(); float BM_face_calc_normal_subset(const BMLoop *l_first, const BMLoop *l_last, float r_no[3]) ATTR_NONNULL(); float BM_face_calc_area(const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -float BM_face_calc_area_worldspace(struct Object *ob, const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +float BM_face_calc_area_with_mat3(const BMFace *f, const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); float BM_face_calc_perimeter(const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -float BM_face_calc_perimeter_worldspace(struct Object *ob, const BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +float BM_face_calc_perimeter_with_mat3(const BMFace *f, const float mat3[3][3]) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); void BM_face_calc_tangent_edge(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); void BM_face_calc_tangent_edge_pair(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); void BM_face_calc_tangent_edge_diagonal(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); |