From 3a0593cc3d5de33248b3a7b913a45729c37dc1b4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Jul 2012 22:48:28 +0000 Subject: code cleanup: dont use function calls like dot_v3v3, pow and sqrt within macros which results in calling the function multiple times needlessly. also added some comments. --- source/blender/blenkernel/intern/armature.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/armature.c') diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 5822b296a8a..c10b1e2d4f4 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2049,7 +2049,8 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o cross_v3_v3v3(raxis, rmat[1], splineVec); rangle = dot_v3v3(rmat[1], splineVec); - rangle = acos(MAX2(-1.0f, MIN2(1.0f, rangle))); + CLAMP(rangle, -1.0f, 1.0f); + rangle = acosf(rangle); /* multiply the magnitude of the angle by the influence of the constraint to * control the influence of the SplineIK effect -- cgit v1.2.3