From ec3b0c6a968210512e0c36e1e62eefcbe0cf1ea0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 6 Nov 2011 15:17:43 +0000 Subject: misc macro --> bli math lib functions --- source/blender/editors/uvedit/uvedit_draw.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'source/blender/editors/uvedit/uvedit_draw.c') diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 8a50ec28bd6..0f21aa3759c 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -267,10 +267,10 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac #endif /* uv angles */ - VECSUB2D(av1, tf_uv[3], tf_uv[0]); normalize_v2(av1); - VECSUB2D(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); - VECSUB2D(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); - VECSUB2D(av4, tf_uv[2], tf_uv[3]); normalize_v2(av4); + sub_v2_v2v2(av1, tf_uv[3], tf_uv[0]); normalize_v2(av1); + sub_v2_v2v2(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); + sub_v2_v2v2(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); + sub_v2_v2v2(av4, tf_uv[2], tf_uv[3]); normalize_v2(av4); /* This is the correct angle however we are only comparing angles * uvang1 = 90-((angle_normalized_v2v2(av1, av2) * RAD2DEGF(1.0f))-90);*/ @@ -280,10 +280,10 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac uvang4 = angle_normalized_v2v2(av4, av1); /* 3d angles */ - VECSUB(av1, efa->v4->co, efa->v1->co); normalize_v3(av1); - VECSUB(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); - VECSUB(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); - VECSUB(av4, efa->v3->co, efa->v4->co); normalize_v3(av4); + sub_v3_v3v3(av1, efa->v4->co, efa->v1->co); normalize_v3(av1); + sub_v3_v3v3(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); + sub_v3_v3v3(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); + sub_v3_v3v3(av4, efa->v3->co, efa->v4->co); normalize_v3(av4); /* This is the correct angle however we are only comparing angles * ang1 = 90-((angle_normalized_v3v3(av1, av2) * RAD2DEGF(1.0f))-90);*/ @@ -328,9 +328,9 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac #endif /* uv angles */ - VECSUB2D(av1, tf_uv[2], tf_uv[0]); normalize_v2(av1); - VECSUB2D(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); - VECSUB2D(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); + sub_v2_v2v2(av1, tf_uv[2], tf_uv[0]); normalize_v2(av1); + sub_v2_v2v2(av2, tf_uv[0], tf_uv[1]); normalize_v2(av2); + sub_v2_v2v2(av3, tf_uv[1], tf_uv[2]); normalize_v2(av3); /* This is the correct angle however we are only comparing angles * uvang1 = 90-((angle_normalized_v2v2(av1, av2) * 180.0/M_PI)-90); */ @@ -339,9 +339,9 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac uvang3 = angle_normalized_v2v2(av3, av1); /* 3d angles */ - VECSUB(av1, efa->v3->co, efa->v1->co); normalize_v3(av1); - VECSUB(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); - VECSUB(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); + sub_v3_v3v3(av1, efa->v3->co, efa->v1->co); normalize_v3(av1); + sub_v3_v3v3(av2, efa->v1->co, efa->v2->co); normalize_v3(av2); + sub_v3_v3v3(av3, efa->v2->co, efa->v3->co); normalize_v3(av3); /* This is the correct angle however we are only comparing angles * ang1 = 90-((angle_normalized_v3v3(av1, av2) * 180.0/M_PI)-90); */ ang1 = angle_normalized_v3v3(av1, av2); -- cgit v1.2.3